From: Brian Candler Date: 2003-04-29T06:39:30+09:00 Subject: Re: block.call vs. yield On Mon, Apr 28, 2003 at 07:02:43PM +0900, Yukihiro Matsumoto wrote: > In message "Re: block.call vs. yield" > on 03/04/28, Gavin Sinclair writes: > > > |> ... do |thing,| > |> but I never remember to do that. > | > |And that's very ugly, IMO. > > I know, but I have to solve them one at a time. FYI, I proposed > block parameter that works like function arguments, but many hated > it because of its ugliness. Design is a hard thing indeed. I certainly agree there :-) I imagine 'yield semantics' were put in the language to solve some problem, or make it work better in some circumstances; do you have an example of that? If I understand rightly, the 'yield semantics' mean that: |a| given 0 arguments => a = nil given 1 argument => a = arg given 2+ arguments => a = [arg1, arg2, ...] That gives a slightly odd sort of polymorphism - to be useful, the block must be able to cope with either a single unwrapped object or an array which wraps multiple objects. Suppose block parameters worked like function arguments - how would life be worse? (ignoring backwards compatibility) Regards, Brian.