From: Robert Dober Date: 2007-02-17T16:46:49+09:00 Subject: Re: is it behaving strange ? On 2/17/07, hemant wrote: > On 2/17/07, Pe�a, Botp wrote: > > fr: sur max [mailto:sur.max@gmail.com] > > # definitely, it seems so natural using > > # = *a,b > > > > indeed, as robert pointed out. > > but the magic generally leans towards, producing (and thereby questioning) *a, like > > > > def x > > *a > > end > > > > or > > > > def x > > 1,2,3 > > end > > > > so what does *a produce, or 1,2,3? an array, a list, or an unarrayed array (to quote dblack)? those are just names, but what is it really, what are its properties/methods/etc? > > > > # and this gives the feel of ruby. isn't it ? > > > > i'm not sure (because the magic tends to fall on hole, a cul de sac), maybe because i seldom use it, ... only matz knows. > > Take a look at these > > >> instruments = {'trombones' => 1, 'clarinets' => 2} > >> p instruments.to_a > [["trombones", 1], ["clarinets", 2]] > >> p *instruments > ["trombones", 1] > ["clarinets", 2] > > Normally * uses to_a or to_ary, but certainly its more devious than it > appears. And where exactly is this operator defined in ruby source > tree? eval.c ? > > > > > -- > gnufied > ----------- > There was only one Road; that it was like a great river: its springs > were at every doorstep, and every path was its tributary. > http://people.inxsasia.com/~hemant > > I really start to love Smalltalk's syntax more and more... Maybe sometimes less is more. Than OTOH what fun Quiz113 was! But fun can be dangerous I guess :( Cheers Robert -- We have not succeeded in answering all of our questions. In fact, in some ways, we are more confused than ever. But we feel we are confused on a higher level and about more important things. -Anonymous