From: Brian Candler Date: 2003-04-28T18:17:24+09:00 Subject: Re: block.call vs. yield On Mon, Apr 28, 2003 at 06:06:36PM +0900, Gavin Sinclair wrote: > If you want to take a step back and look for a unifying concept, which > I applaud, then I think the only choice is to abolish "yield > semantics". The splat (*) operator allows you to achieve the same > result anyway - when you want to. > > hash.each do |o| > # Array === o > end > > is annoying to some people. They would rather have an error (wrong > number of parameters) than an unexpected value being assigned to the > parameter, and I sympathise. I am in that group. I have been caught out several times by writing mything.each do |thing| .. end where mything is a hash of objects, and I just get a confusing error message somewhere later on in my code, perhaps much later. If you want to match exactly one argument you can write ... do |thing,| but I never remember to do that. Regards, Brian.