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

[perl #123184] pos++

Thread Previous
From:
Father Chrysostomos
Date:
November 11, 2014 22:01
Subject:
[perl #123184] pos++
Message ID:
rt-4.0.18-20460-1415743271-1440.123184-75-0@perl.org
# New Ticket Created by  Father Chrysostomos 
# Please include the string:  [perl #123184]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=123184 >


Yes, I actually tried to do pos++ recently, and quickly realised why it didn’t work.

But ‘pos++;’ could only mean one thing, so why shouldn’t perl do that?

Making this work for the unambiguous cases that are currently syntax errors is not that hard, and I can make it generic enough to work with custom lvalue subs, too.

The only drawback I can think of is that, while the first line here will work, the second will not, since it is not sufficiently unambiguous:

  pos++;
  pos++ if $necessary;

-- 

Father Chrysostomos


Thread Previous


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