Jump to content

Loops/Foreach: Difference between revisions

(Loops/Foreach en Yabisic)
Line 2,379:
<lang smalltalk>aCollection do: [ :element | element displayNl ].</lang>
(Provided that the objects in the collection understand the <code>displayNl</code> method).
Most modern Smalltalks allow for a selector symbol to be sent a <tt>value:</tt> message; which allows for the very compact:
<lang smalltalk>aCollection do:#displayNl.</lang>
 
=={{header|Snabel}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.