Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variable declaration inside statement_modifier for inside junction triggers bogus redeclaration error in Rakudo #2648

Open
p6rt opened this issue Feb 15, 2012 · 5 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Feb 15, 2012

Migrated from rt.perl.org#110820 (status was 'open')

Searchable as RT110820$

@p6rt
Copy link
Author

p6rt commented Feb 15, 2012

From @masak

<masak> nom​: sub balanced { all((my $c += $_ eq "[" ?? 1 !! -1) < 0
for $^s.comb) && !$c }; .say when &balanced for (^(2 **
6))».fmt("%06b")».trans("01" => "[]")
<p6eval> nom bd5adb​: OUTPUT«===SORRY!===␤Redeclaration of symbol $c␤at
/tmp/f7OZkWSnoP​:1␤»
<masak> huh.
<masak> nom​: all(my $c for ())
<p6eval> nom bd5adb​: OUTPUT«===SORRY!===␤Redeclaration of symbol $c␤at
/tmp/XLWPyMzIwp​:1␤»
<masak> that's the shortest I can make it.
* masak submits rakudobug

@p6rt
Copy link
Author

p6rt commented Nov 21, 2012

From @FROGGS

it's at least not the same problem anymore​:

<FROGGS> r​: all(my $c for ())
<p6eval> rakudo bf472b​: OUTPUT«===SORRY!===␤Unable to parse expression
in argument list; couldn't find final ')' at line 2, near "for ())"␤»

@p6rt
Copy link
Author

p6rt commented Nov 21, 2012

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Jul 20, 2015

From @perlpilot

I'm not sure this is a bug. The postfix for is a statement modifier, and it's being used in an argument list context. For it to parse right, you'd have to do something like this​:

  all( do { my $c for () } );

or even

  all( (my $c for ()) );

I didn't test the version with the balanced sub, but I guess it would require something similar.

-Scott

On Wed Feb 15 06​:37​:15 2012, masak wrote​:

<masak> nom​: sub balanced { all((my $c += $_ eq "[" ?? 1 !! -1) < 0
for $^s.comb) && !$c }; .say when &balanced for (^(2 **
6))».fmt("%06b")».trans("01" => "[]")
<p6eval> nom bd5adb​: OUTPUT«===SORRY!===␤Redeclaration of symbol $c␤at
/tmp/f7OZkWSnoP​:1␤»
<masak> huh.
<masak> nom​: all(my $c for ())
<p6eval> nom bd5adb​: OUTPUT«===SORRY!===␤Redeclaration of symbol $c␤at
/tmp/XLWPyMzIwp​:1␤»
<masak> that's the shortest I can make it.
* masak submits rakudobug

--
perlpilot

@p6rt
Copy link
Author

p6rt commented Dec 3, 2017

From @AlexDaniel

This wasn't updated in a while. As of today (2017.11,HEAD(e5b660e)), it still complains about final ) like mentioned in one of the recent comments. And yes, this tickets seems to be rejectable.

On 2015-07-20 09​:27​:25, duff wrote​:

I'm not sure this is a bug. The postfix for is a statement modifier,
and it's being used in an argument list context. For it to parse
right, you'd have to do something like this​:

all( do { my $c for () } );

or even

all( (my $c for ()) );

I didn't test the version with the balanced sub, but I guess it would
require something similar.

-Scott

On Wed Feb 15 06​:37​:15 2012, masak wrote​:

<masak> nom​: sub balanced { all((my $c += $_ eq "[" ?? 1 !! -1) < 0
for $^s.comb) && !$c }; .say when &balanced for (^(2 **
6))».fmt("%06b")».trans("01" => "[]")
<p6eval> nom bd5adb​: OUTPUT«===SORRY!===␤Redeclaration of symbol
$c␤at
/tmp/f7OZkWSnoP​:1␤»
<masak> huh.
<masak> nom​: all(my $c for ())
<p6eval> nom bd5adb​: OUTPUT«===SORRY!===␤Redeclaration of symbol
$c␤at
/tmp/XLWPyMzIwp​:1␤»
<masak> that's the shortest I can make it.
* masak submits rakudobug

@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant