From: Eric Hodel Date: 2005-10-28T10:56:30+09:00 Subject: Re: Argument Passing Syntax On Oct 27, 2005, at 12:31 PM, gwtmp01@mac.com wrote: > Why are arguments to the '[]' method parsed differently > than a standard method? [snip] > irb> a.m1(1, 2 => 3) > [1, {2=>3}] > => nil uses call_args (and friends) > irb> a[1 => 2] > [{1=>2}] > => nil uses assoc_list, for Hash::[] > irb> a[1, 2 => 3] > SyntaxError: compile error > (irb):15: syntax error > a[1, 2 => 3] > ^ > from (irb):15 I imagine the second syntax was added only for Hash::[]. -- Eric Hodel - drbrain@segment7.net - http://segment7.net FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04