On Thu, 5 Oct 2006, Jeremy Tregunna wrote: >> for(i, 99, 1, >> writeln(i, " of beer on the wall, ", i, " of beer,") >> writeln("take one down, pass it around,") >> writeln(bottle(i - 1), " of beer on the wall.") >> ) > > Well yes. But only three of those arguments are evaluated (99, 1, and the > body of the loop). "i" is never evaluated, we just inspect the name supplied > by the user, and use it to set a slot which you can use in the body which > represents the element you're looping over. 99 and 1 have a cached result > set so they're nice and quick. The cost of a method/block to activate in Io > is roughly 4x to 20x greater than for a message to evaluate, which is why we > tend to use messages instead of blocks. (Just as a side note, I generally > avoid using the for loop and opt for Ranges myself, they just read better: > 99 to(1) foreach(i, ...); but the same principal applies.) jeremy- can you elaborate on what messages are? where are the messages in this code snipper - or are there? alternatively can you just point me to a good rtfm link? regards. -a -- in order to be effective truth must penetrate like an arrow - and that is likely to hurt. -- wei wu wei