Is it because we want to conserve memory space?
-
possible duplicate of [Using Let in Scheme](http://stackoverflow.com/questions/946050/using-let-in-scheme) – runDOSrun Feb 23 '15 at 00:04
2 Answers
Scott's answer is correct, but I want to pitch in with another perspective.
Scheme culture cares a great deal about functional programming. Functional code should not care about ordering of operations. This is, in fact, why an expression like (foo (bar) (baz (qux)))
does not say anything about which order those functions will be run, except that:
qux
will be run beforebaz
is run- both
bar
andbaz
will be run beforefoo
is run
In particular, qux
can be run before or after bar
, and even a sequence like qux
→ bar
→ baz
→ foo
is valid.
For a similar reason, let
should be used by default; it signals to the reader that the usual functional assumptions apply, that the bindings can be evaluated in any order. let*
should only be used to alert the reader to the unusual behaviour of having bindings depend on previous ones in the same let*
form.

- 219,335
- 46
- 382
- 435
let*
, at the cost of being more capable, has to serialize the terms being defined (since each can depend on previous ones), whereas the terms in a let
can be set up in any order (and even in parallel, should the architecture allow for that).

- 48,888
- 12
- 60
- 101