Category:Smalltalk: Difference between revisions

Content added Content deleted
Line 409: Line 409:
(knowing that the if methods send <tt>"value"</tt> to the corresponding arg and return that)
(knowing that the if methods send <tt>"value"</tt> to the corresponding arg and return that)


In this style, all of Smalltalk's control structures, loops, enumeration, stream readers and event the exception handling constructs are built. And since every class is open, you can easily add additional convenient control functions.
In this style, all of Smalltalk's control structures, loops, enumeration, stream readers and event the exception handling constructs are built. And since every class is open for extension, you can easily add additional convenient control functions (which is one place, where dialects differ, so very often, one has to transport some of those when porting apps from one dialect to another).


The following is only a tiny subset - there are virtually hundreds or thousands of uses of blocks for control structures in the system.
The following is only a tiny subset - there are virtually hundreds or thousands of uses of blocks for control structures in the system.