From: Daniel N Date: 2006-11-09T22:04:35+09:00 Subject: Re: Array question ------=_Part_35704_9539147.1163077471021 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 11/10/06, Peter Szinek wrote: > > Hello, > > > I have a function like this: > > def f(*args) > #do something > end > > and I have an array, say > > a = [1,2,3] > > Now I would like to call f() with the contents of the array i.e. > > f(1,2,3) in this case (i.e. not f([1,2,3]) ) > > What is the most Rubyish way to accomplish this? > > TIA, > Peter > > -- Splat the array first with the * (splat) operator. f(*a) ------=_Part_35704_9539147.1163077471021--