develooper Front page | perl.perl5.porters | Postings from December 2010

Re: Make $obj->$method honours "&{}" overloading on $method

Thread Previous | Thread Next
David Golden
December 8, 2010 04:56
Re: Make $obj->$method honours "&{}" overloading on $method
Message ID:
On Tue, Dec 7, 2010 at 6:59 PM, Vincent Pit <> wrote:
> syntax already has two meanings, depending on whether $method is a code
> reference or something else (which then gets stringified, either through
> stringification overloading or the usual way). I would expect that
> syntax to honour both overloading behaviours that are covered by those
> two meanings : code dereference overloading, and then stringification
> overloading.

When both overloadings are present, that's an arbitrary choice of
order.  I would agree with coderef first as the "natural" ordering,
but I think it should still issue a warning about "ambiguous coderef
and string overloading resolved as coderef".

-- David

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About