Jump to content

Category:Smalltalk: Difference between revisions

Line 480:
(knowing that the "ifXX"-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- theor 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.
Line 492:
[ loop code . condition expression ] whileTrue.
[ loop code ] doWhile:[ condition ].
[ loop code ] doUntil:[ condition ].
 
n timesRepeat:[ block to be looped over ] "n being an integer"
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.