A-M baby
This commit is contained in:
parent
764da6cbbb
commit
db842d013d
19005 changed files with 197040 additions and 7 deletions
10
Task/Loops-Nested/Smalltalk/loops-nested-3.st
Normal file
10
Task/Loops-Nested/Smalltalk/loops-nested-3.st
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
!Block methodsFor:'looping'!
|
||||
loopWithExit
|
||||
"the receiver must be a block of one argument. It is evaluated in a loop forever,
|
||||
and is passed a block, which, if sent a value:-message, will exit the receiver block,
|
||||
returning the parameter of the value:-message. Used for loops with exit in the middle."
|
||||
|
||||
|exitBlock|
|
||||
|
||||
exitBlock := [:exitValue | ^ exitValue].
|
||||
[true] whileTrue:[ self value:exitBlock ]
|
||||
Loading…
Add table
Add a link
Reference in a new issue