From: MonkeeSage Date: 2007-12-05T23:50:52+09:00 Subject: Re: Expanding array as function arguments On Dec 5, 7:13 am, Witold Rugowski wrote: > Sergio Gil Pérez de la Manga wrote: > > > foo *[1,2,3] > > > ( > > similar to grouping several arguments into an array if method > > definition: > > > def foo(*args) > > end > > > foo 1, 2, 3 > > ) > > Thnx a lot ;) > -- > Posted viahttp://www.ruby-forum.com/. A note on splat; it can be used to both gather and unpack elements, depending on the context. For example... def baz(a, b, c) p a, b, c end def foo(*bar) # gathering - bar = [1, 2, 3] baz(*bar) # unpacking - bar = 1, 2, 3 end foo(1, 2, 3) Regards, Jordan