From: Todd Benson Date: 2009-05-13T11:02:45+09:00 Subject: Re: Whaaaaat? On Tue, May 12, 2009 at 8:34 PM, Tom Cloyd wrote: > Robert Dober wrote: >> >> On Wed, May 13, 2009 at 1:57 AM, Tom Cloyd wrote: >> >>> >>> Why can't ruby just do what I mean, rather than what I say? Is that >>> asking >>> too much? (heh heh) >>> >> >> But it does, I am sure you just forgot the *, right? >> [*0..5].include? 42 >> --> false >> Cheers >> Robert >> >> >> > > Robert, > > Interesting, but obscure. I just did a quick dig into Thomas (Pickaxe, 3rd > ed.), to try to figure out what [*1..5] does, and I still don't get it. Can > you explain? The"pre-appending" (yes I'm aware that's not a word or proper conjuction) _star_ flattens arrays/ranges. Well, not exactly; it allows you to use a "list" of things. Some people avoid it because of a supposed performance issue. Pick your battle, I guess. It happens to be useful to me. I really hope they don't get rid of that nomenclature (much like getting rid of #inject; if so, goodbye Ruby for me). Todd