From: Arlen Cuss Date: 2008-02-21T11:03:25+09:00 Subject: Re: What does *args do? ------=_Part_721_27631298.1203559406806 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi there, On Thu, Feb 21, 2008 at 12:04 PM, Stedwick wrote: > Got it, thanks. I love the term "splat" lol. Personally, I'm a big fan > of passing hashes {} as arguments. In that case, the syntax which Rails often uses in Ruby might be of interest to you: >> def fn(a, b, opthash) >> p a >> p b >> p opthash >> end => nil >> fn 1, 2, {:a => false} 1 2 {:a=>false} => nil >> fn 1, 2, :a => false, :joker => 92 1 2 {:joker=>92, :a=>false} => nil >> If you just append hash arguments to the end of a function call, it'll combine it into a hash and use it as the last parameter. Arlen ------=_Part_721_27631298.1203559406806--