0

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 Answers2

3

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:

  1. qux will be run before baz is run
  2. both bar and baz will be run before foo is run

In particular, qux can be run before or after bar, and even a sequence like quxbarbazfoo 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.

C. K. Young
  • 219,335
  • 46
  • 382
  • 435
2

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).

Scott Hunter
  • 48,888
  • 12
  • 60
  • 101