On Dec 5, 2007 1:43 PM, Witold Rugowski <rugowski / nhw.pl> wrote:
> Hi!
> I wonder if it is possible to expand array as function arguments. Like
>
> def foo( a, b, c)
> end
>
> foo [1,2,3].to_args
>
>
> Is possible to do it?

foo *[1,2,3]

(
similar to grouping several arguments into an array if method definition:

def foo(*args)
end

foo 1, 2, 3
)

--=20
Sergio Gil P=E9rez de la Manga
e-mail > sgilperez / gmail.com
blog > http://www.lacoctelera.com/porras