Is there a recursive version of let? For example, I know two variables can be declared this way:
Code: Select all
(let ((a 1)
(b 2))
(+ a b))
Code: Select all
(let ((a 1)
(b (+ a 1)))
(+ a b))
Thanks.
Code: Select all
(let ((a 1)
(b 2))
(+ a b))
Code: Select all
(let ((a 1)
(b (+ a 1)))
(+ a b))
Well, "better" depends upon what your goals are. Are you aiming for faster execution, fewer memory resources, et cetera?ouphe wrote:One more thing: assuming my (admittedly amateur) problem should ever occur, which of the two examples would be better coding practice (using let* instead of let in the second, of course)?
Code: Select all
(let* ((line-width 80)
(line 10)
(char-offset 5) )
(+ (* line-width line) char-offset) )
(let* ((location 800)
(char-offset 5) )
(+ location char-offset) )
Code: Select all
(let ((phi (+ 1 (/ phi))))
phi)