From: ara.t.howard@... Date: 2006-11-16T01:20:31+09:00 Subject: Re: Design problem with 'inject' On Thu, 16 Nov 2006, Robert Klemme wrote: > Small correction: if called *without arguments* the first invocation will > look like this: > > |enumerable_element_1, enumerable_element_2| > >>> %w{foo bar baz}.inject {|*a| p a} > ["foo", "bar"] > [nil, "baz"] > => nil >>> %w{foo bar baz}.inject(nil) {|*a| p a} > [nil, "foo"] > [nil, "bar"] > [nil, "baz"] > => nil > > This is actually useful to do something like this: > >>> %w{foo bar baz}.inject() {|a,b| a+", "+b} > => "foo, bar, baz" wow - you learn something every day - that's great! cheers. -a -- my religion is very simple. my religion is kindness. -- the dalai lama