Donald Raab: Smalltalk Blocks (opens in new tab)
The expression of the square bracketPhoto by on In the Smalltalk programming language, blocks are anonymous deferred pieces of code that can be stored in variables or passed as parameters. Literal blocks start and end with square brackets — []. In Pharo Smalltalk, a block is an instance of the BlockClosure class. In a block, the pipe character separates the parameters on the left and the expression on the right (e.g. [ :parameter | expression ]. A zero argument block will have no pipe (e.g. [...
Read the original article