[Haskell-cafe] Lambda and closures in PHP -- could someone please
jules at jellybean.co.uk
Thu Jun 19 01:53:47 EDT 2008
Richard A. O'Keefe wrote:
> - what you get is a reference to a variable (as you do in Scheme)
> but loop variables really are variables, not names for values,
> so lambdas created in different iterations of the same loop point
> so the same loop variable, and do not remember the value it had
> when they were created. The proposal explains how to work around this.
I think I'm of the opinion that variable capture from lambda formation
should always be by value. However you can certainly make an argument
that that's inconsistent in a language which generally has
mutation/reference semantics. Whichever choice you make, though,
document it loudly I predict it will be a source of confusion.
More information about the Haskell-Cafe