From: Daniel Berger Date: 2002-11-28T01:34:56+09:00 Subject: Re: ranges and the 'times' method ts wrote: > >>>>> "D" == Daniel Berger writes: > > D> 1) Should 'times' be modified to support ranges? > > Well, you want #upto no ? Yes, I realize that. I was just making a point. :) > > > D> 2) If not, should it raise a NameError exception? > > I've not understood why you want a NameError, #times return its argument > > Guy Decoux Because 'times' should fail when called by an invalid type (in this case a Range object). Ruby doesn't parse it that way it seems - I just thought it should. To answer you and the others who posted: I understand *why* it's doing what it does - I'm just wondering if the behavior should (or could) be changed. >Javier Fontan wrote: >(3..5).times { puts "yo" } Actually, this syntactic approach *does* cause a NameError. :) Regards, Dan