Re:Alan Kay on Lisp and Fexprs
by _delirium on Sunday February 14, 2010 @08:32PM
(#1125673)
There's a similarity in that neither fexprs nor lazy functions evaluate their arguments up front, but lazy functions will eventually, if they run and access that argument at all, get an evaluated version of it. Fexprs can get the actual raw unevaluated argument and poke at it, so if you call (foo (+ 1 2)), foo gets the syntax-tree (+ 1 2) if it's an fexpr, while if it's a function, lazy or otherwise, it will only ever see the value 3.
[ Parent
| on HN ]
...so, basically it gives the same ease of understanding program flow that lazy evaluation offers, but without the distracting complexity of referential transparency? Okay, then.
[...] but without the distracting complexity of referential transparency?
How could referential transparency possibly be distracting or complex?
In exactly the same way that lazy evaluation makes program flow easy to follow.
Or perhaps in the same way that the internet makes sarcasm easily recognized, I suppose...
Aha!
So the value of your words depended on evaluating them in a sarcastic context. This lack of referential transparency made it difficult to reason about them at compile-time.
In this way, they are similar to C#'s expression trees, whereby lambdas passed as an argument where the parameter is of type Expression<T> receive an expression tree describing the lambda, rather than an actual callable object.