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

[perl #79820] Make my $pi := 4; a syntax error

Thread Previous | Thread Next
Nicholas Clark
November 27, 2010 08:52
[perl #79820] Make my $pi := 4; a syntax error
Message ID:
# New Ticket Created by  Nicholas Clark 
# Please include the string:  [perl #79820]
# in the subject line of all future correspondence about this issue. 
# <URL: >

Currently the := in my $pi := 4; is interpreted as an empty attribute list.
As of 5.12.0, using := here issue a deprecation warning.

No Perl 5 code on CPAN is using :=

If code generators need the flexibility to generate empty attribute lists,
it's trivial to do so by adding a space before the =

I believe that there is consensus that

a: it would be useful to have a binding operator in Perl 5
b: that := is the obvious candidate

hence at some point we need to re-use := for this.

Use of := for binding can't be distinguished from use of it to mean an empty
attribute list. Hence I propose that we make := a syntax error for 5.14, so
that there is at least 1 major version of Perl 5 where any accidental use will
be caught with a clear, comprehensible syntax error message.

Nicholas Clark

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