Implications of "true block closures" and lack thereof?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Implications of "true block closures" and lack thereof?

Griff-2
Reading the documentation I see that "true block closures" are now
implemented. For now, I'm not familiar with either true or untrue block
closures :). So, what were the implications of not having this feature
before?


Reply | Threaded
Open this post in threaded view
|

Re: Implications of "true block closures" and lack thereof?

Bernhard Kohlhaas-6
Griff wrote:
> Reading the documentation I see that "true block closures" are now
> implemented. For now, I'm not familiar with either true or untrue block
> closures :). So, what were the implications of not having this feature
> before?
>

Griff,

You can read about my encounter of this behavior in the following
newsgroups thread: http://tinyurl.com/jvbhn .

Basically the program seemed to be that there weren't separate memory
slots created for local variables defined within blocks, if a block was
invoked (instantiated) multiple times within the same method. Since they
all shared the same memory slot the variable "event" in the example just
contains the value of the last assignment.

The workaround at the time was to put such a block in a separate method,
because then there would a separate method context (and thus block
context) created each time the method was invoked.

Bernhard
(who hopes he got this explanation more or less right).