From: Josh Cheek Date: 2010-07-01T18:59:51+09:00 Subject: Re: pathname.rb:270: warning: `*' interpreted as argument prefix --0015174c45eeeba42c048a508758 Content-Type: text/plain; charset=ISO-8859-1 On Wed, Jun 30, 2010 at 8:55 AM, Brian Candler wrote: > Josh Cheek wrote: > > Note: can anyone explain to me what unary * is? > > It's just the "splat". AFAIK it's not really an operator and is not > mapped to a method call; it's part of the language syntax. > -- > Posted via http://www.ruby-forum.com/. > > I am still unsure what it is, I think that when it is parsed, it just invokes the to_a method, and then does some interpreter level magic to line up the args and the params. Anyway, it definitely invokes to_a (I expect this is similar to how the ampersand invokes to_proc) def y(x) def x.to_a() [12] end yield *x end y(/1,2,3/) { |param| param } # => 12 --0015174c45eeeba42c048a508758--