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

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

Thread Previous | Thread Next
From:
David Golden
Date:
December 8, 2010 04:56
Subject:
Re: Make $obj->$method honours "&{}" overloading on $method
Message ID:
AANLkTi=cUsWzwVQQL8fqPyPGXY_4knnJaq0_1bA5AW4Q@mail.gmail.com
On Tue, Dec 7, 2010 at 6:59 PM, Vincent Pit <perl@profvince.com> 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


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About