develooper Front page | perl.perl6.language | Postings from October 2001

Re: A3, the ';' operator, and hyper-operators

Thread Previous | Thread Next
From:
Dan Sugalski
Date:
October 4, 2001 07:06
Subject:
Re: A3, the ';' operator, and hyper-operators
Message ID:
5.1.0.14.2.20011004100520.0237fd80@pop.sidhe.org
At 02:18 PM 10/4/2001 +1000, Damian Conway wrote:
>    > ** Miscellaneous
>    >
>    > Why 'operator:+' instead of 'operator::+'? (Other than the
>    > potential verbosity required to declare operators within a
>    > particular package.) I would think it more intuitive to think of
>    > 'operator' as a provided package (within every package).
>    >
>    > Hmm, lexicals.
>
>Yep. Overloaded operators will be inherently lexical (to keep them from
>running amok), so they can't be in packages.

This is for when we change the parser, right? Overloaded operators attached 
to variables will leak out and go wherever they go.

    $foo + $bar

will call $foo's overloaded add if it has one no matter where $foo's used.

					Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
dan@sidhe.org                         have teddy bears and even
                                      teddy bears get drunk


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