On Feb 10, 2010, at 16:36 , Albert Schlef wrote:

> Ryan Davis wrote:
>> Array[...] is, as you point out in the comment, a=20
>> method invocation to Array::[](*items).
>=20
> I don't think so. Array() is a method of the Kernel module. So, I =
think,=20
> `Array[1,2,3]` equals `Array( [1,2,3] )`.

If there is one thing I know about ruby, it's the damn grammar. :P

% echo "Array[1,2,3]" | parse_tree_show=20
s(:call,
 s(:const, :Array),
 :[],
 s(:arglist, s(:lit, 1), s(:lit, 2), s(:lit, 3)))

Ruby's syntax allows you to not use "." for [] and []=3D, which is why =
we can do things like my_hash[key] or my_array[42] =3D 24 instead of =
my_hash.[](key) or my_array.[]=3D(42, 24). Classes are objects too and =
subject to the same syntactical rules.