On 21/12/2007, at 11:56 PM, P T Withington wrote:
> Cute! So ... is the 'spread' operator that spreads an array of
> arguments into a parameter list.
Sounds similar to the splat operator of Ruby:
def foo(first, second, *rest)
puts first, second, rest.inspect
end
foo(1,2)
=> 1 2 []
foo(1,2,3,4,5)
=> 1 2 [3, 4, 5]
rest = [3,4,5]
foo(1,2, *rest)
=> 1 2 [3, 4, 5]
rest = [3,4,5]
foo(1,2, rest)
=> 1 2 [[3, 4, 5]]
Cheers,
--
Nathan de Vries
_______________________________________________
Es4-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es4-discuss