« Return to Thread: Double the size

Double the size

by Brian Murphy-Dye-2 :: Rate this Message:

Reply to Author | View in Thread

The following code snippet shows a size of 10, but #do: processes  
those 10 items twice. Any ideas what I'm doing wrong?

m := MagmaCollection new.
1 to: 10 do: [:each | m add: each].
Transcript show: String cr, 'size: ', m size asString, String cr.
m do: [:each | Transcript show: each asString, String cr].

Brian.

 « Return to Thread: Double the size