From: Jeremy Tregunna Date: 2006-10-05T23:50:26+09:00 Subject: Re: dynamically changing superclass/mixins On 06-10-05, at 09:35, Trans wrote: >> 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. > > I agree. Multiple blocks are nice, but it could be be done with a > block > notation too if one wanted: > > if(cond) {writeln("aye")} {writeln("nay")} > > Hmm... does Io support currying? Then: > > if(cond)(writeln("aye"))(writeln("nay")) No, Io doesn't support currying out of the box; we just don't empose an arity field on our methods/blocks. That is to say, you could define a method which takes 3 arguments, if you only supply 2, the last argument will receive "nil" as its value instead of a message expression. However, many attempts have been made (successfully I might add) to add different levels of currying to Io. Asking on our mailing list is likely to get you one or two examples =] -- Jeremy Tregunna jtregunna@blurgle.ca