From: Robert Dober Date: 2009-05-13T17:50:48+09:00 Subject: Re: Whaaaaat? On Wed, May 13, 2009 at 4:02 AM, Todd Benson wrote: > 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). I do not believe I have ever heard of that intention, if they get rid of *0..3 than there is nothing one can do, if they get rid of inject we will just reimplement it ;) Robert -- Si tu veux construire un bateau ... Ne rassemble pas des hommes pour aller chercher du bois, préparer des outils, répartir les tâches, alléger le travail… mais enseigne aux gens la nostalgie de l’infini de la mer. If you want to build a ship, don’t herd people together to collect wood and don’t assign them tasks and work, but rather teach them to long for the endless immensity of the sea. -- Antoine de Saint-Exupéry