Quoting constructs: Difference between revisions

Line 432:
 
====Blocks====
Somewhat between literal constants and instantiated object are blocks, which represent a closure (lambda function). Here, the codea object is constructed as literal at compile time, and a closure object (which wraps the code plus the visible variables) into an object at execution time.
Blocks thus represent a piece of code which can be stored in an instance variable, passed as argument or returned from a method.
<br>Block syntax is very compact:
Anonymous user