develooper Front page | perl.perl5.porters | Postings from December 2012

[perl #116020] toggle operator missing reset: proposal

Thread Previous
From:
tlhackque via RT
Date:
December 11, 2012 02:31
Subject:
[perl #116020] toggle operator missing reset: proposal
Message ID:
rt-3.6.HEAD-17500-1355159389-344.116020-15-0@perl.org
Fair observation.

Other syntax would work - pehaps "reset [label]" ?  

Surely an arrayref is currently a nonsensical argument to reset...which 
is what this would look like to current Perl.  To make it easy to 
parse, we could even say reset ['label'] - so no special handling in 
the []s.

I'm not a Perl internals person, so certainly other ideas will come to 
more internals-savvy folks.  

I'm just hoping that some variant of this will take someone's fancy who 
can implement it and remove this long-standing restriction in the 
language.

On Mon Dec 10 07:51:43 2012, davem wrote:
> On Sat, Dec 08, 2012 at 03:56:33AM -0800, via RT wrote:
> >   Since we can label any statement (now), why not have the reset
> operator take a label argument?
> >   Then reset can act on the toggle(s) in that statement.
> >
> >   So the minimum implemention would permit:
> > sub extract {
> >    my $out = '';
> >    reset TOGGLE;
> 
> but C<reset TOGGLE> currently means the same as C<reset "TOGGLE">
> (which means the same as C<reset "EGLOT">).
> 




---
via perlbug:  queue: perl5 status: open
https://rt.perl.org:443/rt3/Ticket/Display.html?id=116020

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