Loops/Continue: Difference between revisions

Content added Content deleted
Line 1,975: Line 1,975:


=={{header|Smalltalk}}==
=={{header|Smalltalk}}==
{{works with|Pharo}} ¹
{{works with|Pharo}} {{works with|Smalltalk/X}} actually works with all dialects ¹
<lang Smalltalk>
<lang Smalltalk>
1 to: 10 do: [ :i |
1 to: 10 do: [ :i |
Line 1,988: Line 1,988:
]
]
</lang>
</lang>
&sup1; actually with all; if valueWithExit is not present in the Block class, it can be added as:
&sup1; if valueWithExit is not present in the Block class, it can be added as:
<lang Smalltalk>Block >> valueWithExit
<lang Smalltalk>valueWithExit
^ self value:[^ nil]</lang>
^ self value:[^ nil]</lang>