On 2004-04-15 at 16:49:28, Mark J. Reed wrote: > Not sure that JavaScript is relevant here, since the "equivalent" > syntax there, ".", is the same as the method call syntax. But see my > proposal below.
Before the nit-pickers jump in, I was oversimplifying above. The "method call syntax" in JavaScript is really just the operator '(' args* ')', appended to an expression whose value is a reference to a Function object. JavaScript object.meth(foo) functions roughly like a cross between Perl5 $object->{'meth'}->($foo) and $object->meth($foo): like the former, it looks up the value of key 'meth', expects it to be a code reference, and then executes it; like the latter, it passes the receiver along with the specified args. -Mark