Paul Battley
10/5/2006 12:19:00 PM
On 05/10/06, Trans <transfire@gmail.com> wrote:
>
> Jeremy Tregunna wrote:
>
> > We don't need block notation, everywhere you'd use blocks in Ruby, we
> > just use message objects. They're cheap, have the same benefits, and
> > tie well into Io's conceptual unification.
>
> Which is why you write a for loop like this?
>
> 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.")
> )
Clippy says, 'It looks like you're being sarcastic!' (Correct me if I'm wrong.)
It doesn't look much like Ruby, granted, but it *does* tie in with the
rest of Io. Consider if/else:
if(cond, writeln("aye"), writeln("nay"))
Being able to pass multiple 'blocks' to a method facilitates things
like the above, which aren't possible with Ruby's single-block
approach.
Io's an interesting language.
Paul.