From: James Edward Gray II Date: 2005-08-27T03:49:37+09:00 Subject: Re: ruby quiz question '*' on the initialize parameters On Aug 26, 2005, at 1:39 PM, Gaston Garcia wrote: > well, now I got lost with that reverse example. but I did get the > first one. It just means that if you have an Array of arguments, you can expand it out into the individual members when passing as the final argument in a method. See if this clears it up: irb(main):001:0> def show( one, two = nil, three = nil ) irb(main):002:1> puts "one = #{one.inspect}" irb(main):003:1> puts "two = #{two.inspect}" irb(main):004:1> puts "three = #{three.inspect}" irb(main):005:1> end => nil irb(main):006:0> arr = [1, 2, 3] => [1, 2, 3] irb(main):007:0> show arr one = [1, 2, 3] two = nil three = nil => nil irb(main):008:0> show *arr one = 1 two = 2 three = 3 => nil In the first call, I pass a single argument (an Array of numbers). In the second call, I pass the numbers themselves (three arguments). Hope that helps. James Edward Gray II