Details
Description
The current implementation will create a class/object to hold "shared"
variables between methods and closures even when they are not really
"shared". Take the following example for instance:
<snip>
def adder(amount as int):
return <value as int | return amount+value>
</snip>
The compiler will create a shared state object to hold the amount
parameter even though it's never accessed outside the closure (and thus
not properly "shared").
FYI, there is a lot of work from the Lisp/Scheme community on closure optimizations.