From: David Alan Black Date: 2002-01-02T01:34:52+09:00 Subject: [ruby-talk:29964] Re: Proc.class vs yield Hi -- On Tue, 1 Jan 2002, Michael Lucas-Smith wrote: > I'm not against the iterative features. I just want them to be flexible. > What if you need two blocks to effectively iterate? ever seen the method > inject:into: in Smalltalk? how about hierarchy iteration. first block to > tell it what method to call to iterate over the children, second block > to perform the collect/select/reject. OK, I think I see now that you're talking about perhaps having the last block be *the* block, if it's greater than the number of &args. As far as the desireability of this change goes, we've probably reached the point of "agree to disagree" :-) I'll just add that the stuff you describe above is, certainly, feasible in Ruby; in other words, even though the proc/lambda keyword may seem cumbersome, it can be used to pass blocks around and "call" can be used to call them. Also, some of what you're describing can, I think, be accomplished with chained iterator calls. Finally... this is interesting because it's sort of reminiscent of discussions of parallel iterators but kind of turned sideways: rather than having one iterator that iterates for two receivers, you're talking about one receiver that takes multiple iterators. (If I'm getting it right.) [re: {} idea:] > It was just an idea - because someone mentioned that currently there > might be a problem with the fact that {} is used for blocks and hashs. Yeah, that was me, a few thousand words ago :-) David -- David Alan Black home: dblack@candle.superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav