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

Re: [PATCH] Add "safe arrow/safe dereference" operator: &&->

Thread Previous | Thread Next
From:
Zefram
Date:
November 15, 2010 11:20
Subject:
Re: [PATCH] Add "safe arrow/safe dereference" operator: &&->
Message ID:
20101115192012.GJ4029@lake.fysh.org
Reverend Chip wrote:
>That ship has sailed, long ago.  The meanings of  + - "" etc. can all be
>arbitrary, already, thanks to L<overload>.

Only when applied directly to the ref to blessed object that has
overloading.  Objects don't get to muck about with the meaning of an
undef (or anything else, other than a ref to blessed object) that one
of their methods returns.

>                                            Holding -> out as
>untouchable makes little sense.

A blessed object already does get to influence the meaning of ->[], ->{},
and ->(), when applied to its ref, via overload.  It also, of course,
gets to influence ->foo applied to its ref, by simply defining methods
(or AUTOLOAD).  -> is indeed in that sense not particularly special among
operators.  But no operator is currently as special as you suggested.

-zefram

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