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

a macro with $_ as an argument doesn't work in a statement_mod 'for' loop in Rakudo #3025

Open
p6rt opened this issue Jan 13, 2013 · 5 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Jan 13, 2013

Migrated from rt.perl.org#116370 (status was 'stalled')

Searchable as RT116370$

@p6rt
Copy link
Author

p6rt commented Jan 13, 2013

From @masak

<quester> rn​: macro postfix​:<!>($n) { quasi { {{{$n}}}+1 } } ; say $_! for 3..5;
<p6eval> ..rakudo c3f565​: OUTPUT«use of uninitialized variable $_ of
type Any in numeric context␤1␤use of uninitialized variable $_ of type
Any in numeric context␤1␤use of uninitialized variable $_ of type Any
in numeric context␤1␤»
<quester> rn​: macro postfix​:<!>($n) { quasi { {{{$n}}}+1 } } ; for
3..5 {say $_!};
<+p6eval> rakudo c3f565​: OUTPUT«4␤5␤6␤»
* quester agrees that this is enough spam, but idly wonders if this is
a rakudo bug
<masak> quester​: yes, that looks like a rakudobug.
* masak submits

I *think* this is buggy behavior, and that the first result should
equal the second one. Will need to think a bit deeper about it to be
sure, though.

@p6rt
Copy link
Author

p6rt commented Apr 28, 2015

From @usev6

On Sun Jan 13 02​:51​:19 2013, masak wrote​:

<quester> rn​: macro postfix​:<!>($n) { quasi { {{{$n}}}+1 } } ; say $_!
for 3..5;
<p6eval> ..rakudo c3f565​: OUTPUT«use of uninitialized variable $_ of
type Any in numeric context␤1␤use of uninitialized variable $_ of type
Any in numeric context␤1␤use of uninitialized variable $_ of type Any
in numeric context␤1␤»
<quester> rn​: macro postfix​:<!>($n) { quasi { {{{$n}}}+1 } } ; for
3..5 {say $_!};
<+p6eval> rakudo c3f565​: OUTPUT«4␤5␤6␤»
* quester agrees that this is enough spam, but idly wonders if this is
a rakudo bug
<masak> quester​: yes, that looks like a rakudobug.
* masak submits

I *think* this is buggy behavior, and that the first result should
equal the second one. Will need to think a bit deeper about it to be
sure, though.

With todays changes the first result equals the second one​:

$ perl6-m -e 'macro postfix​:<!>($n) { quasi { {{{$n}}}+1 } } ; say $_! for 3..5;'
4
4
4

$ perl6-m -e 'macro postfix​:<!>($n) { quasi { {{{$n}}}+1 } } ; for 3..5 {say $_!};'
4
4
4

But back in 2013 the output was «4␤5␤6␤».

@p6rt
Copy link
Author

p6rt commented Apr 28, 2015

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

@p6rt
Copy link
Author

p6rt commented May 1, 2015

From @masak

bartolin (>)​:

But back in 2013 the output was «4␤5␤6␤».

I'd say «4␤5␤6␤» is the correct output. There's nothing to suggest to me that it should get stuck on 4.

So either this ticket should be closed (because the original problem is now gone) and another one opened with the new problem, or this one should be renamed and re-purposed.

@p6rt
Copy link
Author

p6rt commented Apr 26, 2016

@coke - Status changed from 'open' to 'stalled'

@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