|
|
|
|
|
by billsix
2778 days ago
|
|
They are very similar. They are both applicative-order, meaning that the arguments to a procedure are evaluated before the procedure is applied. The evaluation of a lambda results in a function value, which captures the enclosing scope, but the procedure is not yet applied to anything. But the main difference that I've seen anecdotally is that imperative programmers as a whole tend to get confused by nested expressions, or lets just say they prefer sequential statements over nested expressions. My assumption is that they don't fully understand the order of evaluation in their language of choice. |
|
Common Lisp is left to right, so that (list (inc i) (inc i) (inc i)) will reliably produce (1 2 3) if i starts at zero.