From: David Alan Black Date: 2002-01-01T05:28:03+09:00 Subject: [ruby-talk:29890] Re: Proc.class vs yield Hello -- On Tue, 1 Jan 2002, Joel VanderWerf wrote: > > > 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? > > Since you're explicitly converting each block to a proc, you don't need > yield in this case. Maybe yield would look for a third, unobjectified, > block? It's not that one *needs* yield, but that one *wants* it :-) [...] > In Tcl, { ... } denotes a string without interpolation, like '...' in > Ruby. So if you want to define a C-style for-loop in Ruby, you could, > but it would look like: > > for {$x = 0} {$x < 100} {$x += 1} { > puts $x > } I'm afraid I don't get that example at all. But in any case, I'm fonder of Ruby-style for-loops than C-style for loops in Ruby :-) Or iterating over ranges, or whatever. David -- David Alan Black home: dblack@candle.superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav