develooper Front page | perl.perl5.porters | Postings from August 2019

what would make a good (additional) infix aliases operator?

Thread Next
From:
David Nicol
Date:
August 2, 2019 14:43
Subject:
what would make a good (additional) infix aliases operator?
Message ID:
CAFwScO_-kNH9y0gRjtJyMog9x5uG_vbFMzQuN0qGcg5f2SHxuA@mail.gmail.com
Imagining an infix operator with syntax and precedence the same as = but it
does aliasing instead of value assignment.

What would be a good character sequence for this? := perhaps? := is
assignment in some languages, and isn't meaningful in Perl.

Or maybe an infix aliasing operator could be another letter that is used
with the binding operator?


     my $new_alias := $scalar;   # newbies will think this is assignment

     my $new_alias =~ a $scalar;   # ugly but clearly different

    \my $new_alias = \$scalar;  # this works now, right?


-- 
"Plant yourself like a tree beside the river of truth and tell the whole
world: No, you move."

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