From: gwtmp01@... Date: 2006-10-12T04:52:02+09:00 Subject: Re: What about 'splay'? On Oct 11, 2006, at 3:31 PM, Eero Saynatkari wrote: > I am confused: > > *[1,2] => 1,2 > > Right? Read this: > > [1,2].to_a => 1,2 > > Unless I am misunderstanding something, that is definitely not > *creating* an Array. The splat operator has language semantics that go beyond the mapping of its operand to an array. I view it as a two step process, the first step is to map the operand to an array, this is handled by to_ary, to_a, or the proposed (to_splat|to_values|*@) methods. The second step is handled by the language runtime itself so that the two calls to do_something below result in different argument lists: a = [1,2] do_something(a) # one argument, an array do_something(*a) # two arguments, both fixnums An analogy might be the language semantics of method lookup and how it is associated with method_missing. A user provided method_missing is utilized by the method lookup process but isn't a substitute for the entire lookup process. At the moment I like *@ as the method to be associated with the prefix * operator. And maybe its default implementation should be to call to_ary or to_a if they are defined? Gary Wright