I would like to define two variables in let, one of which depends on the value of the other, for example:
(let ((a (func)) (b (if (eq a 1) 2 3))) ...)
Obviously this is the wrong way to do this, emacs says a not valid. What is the right way to do this?
a
Yes, you need to use let* instead of let .
let*
let
Essentially, let* is a shortcut for nested let s:
(let ((a 1)) (let ((b (1+ a))) (let ((c (* 2 b))) ...)))
equivalently
(let* ((a 1) (b (1+ a)) (c (* 2 b))) ...)
Source: https://habr.com/ru/post/1502666/More articles:BigCommerce: How Can I Customize CategoryProductListing - bigcommerceClojure: how is the map different from comp? - listFailed to install joomla in localhost - phpmake a facebook post in python - pythonpython string for datetime, find yesterday, then go back to the string - pythonLinux webcam image capture - linuxHow to track application crash in a hero? - node.jsChanging run-time application name on Mac for JavaFX-based application - javafx-2How to set default theme for users in gitlab - user-interfaceinstall_name_tool -change fails and ignores the -headerpad_max_install_names flag - gccAll Articles