From: David Alan Black Date: 2002-01-01T02:48:38+09:00 Subject: [ruby-talk:29877] Re: Proc.class vs yield Hi -- On Tue, 1 Jan 2002, Joel VanderWerf wrote: > David Alan Black wrote: > > > Hmmm... I wonder whether part of what you're not liking is the fact > > that the {} operator is overloaded: it's a block constructor and also > > a hash constructor. So there needs to be a way to deal with things > > like: > > > > some_method( { "hi" }, { "one" => 1 }, { |x| puts x }) > > There is still some room to overload {} a bit more. The syntax > > some_method {|x| x+1} {|y| y-1} > > has no meaning currently--it's a parse error. Could this syntax be given > a meaning so that > > def some_method(&b1, &b2) > end > > allowed the method to use both blocks? What would yield do? > I'm not sure I'd propose this for RCR, since I haven't seen a use for it > that couldn't be handled some other way. But still it would be kinda > nice. It would allow you to write control structures a la Tcl: That would be a mighty big RC :-) > while {} { > > } > I don't know Tcl. What does that structure give you? David -- David Alan Black home: dblack@candle.superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav