Apply a callback to an array: Difference between revisions

Content deleted Content added
→‎[[Toka]]: Updated to work with Toka R1
This was C in Smalltalk; use collect.
Line 591:
== [[Smalltalk]] ==
[[Category:Smalltalk]]
 
| anArray |
anArray = #( 1 2 3 4 5 ) collect: [:n | n * n].
anArray do: [ :x | Transcript nextPut: x * x ]
 
== [[Tcl]] ==