plaidgroup / plaid-lang

The Plaid Programming Language Tools
11 stars 1 forks source link

Lambda does not capture state fields correctly #31

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I've attached a test that demonstrates the current behavior of lambdas.  What 
is expected is when 
the lambda qux is called, it should print the value of the field foo when the 
lambda was initially 
created, which is "foo".  Instead, it prints "bar", the value of the field foo 
when the lambda is called.  
This is inconsistent with the typical behavior of lambdas in functional 
languages, which is to capture 
the current value of whatever variables are referenced in their bodies, 
regardless of whether those 
variables change later on.

Original issue reported on code.google.com by mhahn...@gmail.com on 1 Jun 2010 at 9:00

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by mhahn...@gmail.com on 2 Jun 2010 at 2:38