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

Trouble when iteration variables don't add up #424

Closed
p6rt opened this issue Nov 24, 2008 · 11 comments
Closed

Trouble when iteration variables don't add up #424

p6rt opened this issue Nov 24, 2008 · 11 comments

Comments

@p6rt
Copy link

p6rt commented Nov 24, 2008

Migrated from rt.perl.org#60780 (status was 'resolved')

Searchable as RT60780$

@p6rt
Copy link
Author

p6rt commented Nov 24, 2008

From @masak

<masak> rakudo​: for 1..5 -> $a, $b { say $a, $b }
<p6eval> rakudo 33137​: OUTPUT[12␤34␤StopIteration␤current instr.​:
'_block11' pc 78 (EVAL_15​:29)␤]

I haven't searched the specs or the tests for what should happen, but
I'm pretty sure this shouldn't throw an exception.

@p6rt
Copy link
Author

p6rt commented Jan 11, 2009

@pmichaud - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Jan 11, 2009

From @pmichaud

On Mon Nov 24 09​:12​:36 2008, masak wrote​:

<masak> rakudo​: for 1..5 -> $a, $b { say $a, $b }
<p6eval> rakudo 33137​: OUTPUT[12␤34␤StopIteration␤current instr.​:
'_block11' pc 78 (EVAL_15​:29)␤]

I haven't searched the specs or the tests for what should happen, but
I'm pretty sure this shouldn't throw an exception.

Stalling this ticket until there's a description of what should happen
(either in S04 or S07) and tests to match.

Thanks!

Pm

@p6rt
Copy link
Author

p6rt commented Jan 11, 2009

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

@p6rt
Copy link
Author

p6rt commented Apr 5, 2010

From @coke

On Sun Jan 11 00​:21​:58 2009, pmichaud wrote​:

On Mon Nov 24 09​:12​:36 2008, masak wrote​:

<masak> rakudo​: for 1..5 -> $a, $b { say $a, $b }
<p6eval> rakudo 33137​: OUTPUT[12␤34␤StopIteration␤current instr.​:
'_block11' pc 78 (EVAL_15​:29)␤]

I haven't searched the specs or the tests for what should happen,
but
I'm pretty sure this shouldn't throw an exception.

Stalling this ticket until there's a description of what should happen
(either in S04 or S07) and tests to match.

Thanks!

Pm

17​:17 < CokeBot9000> TimToady​:
  http://rt.perl.org/rt3/Ticket/Display.html?id=60780
- I
  would imagine that on the last loop through, a
would get
  5, and b would get whatever undef is these days.
17​:18 <@​TimToady> no, it just fails to bind, unless you declare the
second
  parameter as optional
17​:19 < CokeBot9000> (fails to bind) - just on the last iteration, yes?
17​:20 <@​TimToady> yes, just the last iteration

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Apr 5, 2010

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

@p6rt
Copy link
Author

p6rt commented Sep 20, 2011

From @coke

On Mon Apr 05 14​:21​:29 2010, coke wrote​:

On Sun Jan 11 00​:21​:58 2009, pmichaud wrote​:

On Mon Nov 24 09​:12​:36 2008, masak wrote​:

<masak> rakudo​: for 1..5 -> $a, $b { say $a, $b }
<p6eval> rakudo 33137​: OUTPUT[12␤34␤StopIteration␤current instr.​:
'_block11' pc 78 (EVAL_15​:29)␤]

I haven't searched the specs or the tests for what should happen,
but
I'm pretty sure this shouldn't throw an exception.

Stalling this ticket until there's a description of what should happen
(either in S04 or S07) and tests to match.

Thanks!

Pm

17​:17 < CokeBot9000> TimToady​:
http://rt.perl.org/rt3/Ticket/Display.html?id=60780
- I
would imagine that on the last loop through, a
would get
5, and b would get whatever undef is these days.
17​:18 <@​TimToady> no, it just fails to bind, unless you declare the
second
parameter as optional
17​:19 < CokeBot9000> (fails to bind) - just on the last iteration, yes?
17​:20 <@​TimToady> yes, just the last iteration

23​:56 < [Coke]> rakudo​: for 1..5 -> $a, $b { say $a, $b }
23​:56 <+p6eval> rakudo cbdd9b​: OUTPUT«12␤34␤Not enough positional parameters passed;
  got 1 but expected 2␤ in block <anon> at /tmp/DxYdxC7jfN​:1␤ in
  method reify at src/gen/CORE.setting​:3690␤ in method reify at
  src/gen/CORE.setting​:3595␤ in method reify at
  src/gen/CORE.setting​:3595␤ in method gimme…

23​:56 < [Coke]> rakudo​: for 1..5 -> $a, $b? { say $a, $b }
23​:56 <+p6eval> rakudo cbdd9b​: OUTPUT«12␤34␤5Mu()␤»

good enough for tests?

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Oct 21, 2011

From @coke

On Mon Sep 19 20​:57​:19 2011, coke wrote​:

On Mon Apr 05 14​:21​:29 2010, coke wrote​:

On Sun Jan 11 00​:21​:58 2009, pmichaud wrote​:

On Mon Nov 24 09​:12​:36 2008, masak wrote​:

<masak> rakudo​: for 1..5 -> $a, $b { say $a, $b }
<p6eval> rakudo 33137​: OUTPUT[12␤34␤StopIteration␤current
instr.​:
'_block11' pc 78 (EVAL_15​:29)␤]

I haven't searched the specs or the tests for what should
happen,
but
I'm pretty sure this shouldn't throw an exception.

Stalling this ticket until there's a description of what should
happen
(either in S04 or S07) and tests to match.

Thanks!

Pm

17​:17 < CokeBot9000> TimToady​:

http://rt.perl.org/rt3/Ticket/Display.html?id=60780

- I
would imagine that on the last loop through, a
would get
5, and b would get whatever undef is these
days.
17​:18 <@​TimToady> no, it just fails to bind, unless you declare the
second
parameter as optional
17​:19 < CokeBot9000> (fails to bind) - just on the last iteration,
yes?
17​:20 <@​TimToady> yes, just the last iteration

23​:56 < [Coke]> rakudo​: for 1..5 -> $a, $b { say $a, $b }
23​:56 <+p6eval> rakudo cbdd9b​: OUTPUT«12␤34␤Not enough positional
parameters passed;
got 1 but expected 2␤ in block <anon> at
/tmp/DxYdxC7jfN​:1␤ in
method reify at src/gen/CORE.setting​:3690␤ in method
reify at
src/gen/CORE.setting​:3595␤ in method reify at
src/gen/CORE.setting​:3595␤ in method gimme…

23​:56 < [Coke]> rakudo​: for 1..5 -> $a, $b? { say $a, $b }
23​:56 <+p6eval> rakudo cbdd9b​: OUTPUT«12␤34␤5Mu()␤»

good enough for tests?

We've regressed​:

09​:13 < [Coke]> rakudo​: for 1..5 -> $a, $b { say $a, $b }
09​:14 <+p6eval> rakudo 142c41​: OUTPUT«12␤34␤Not enough positional
parameters
  passed; got 1 but expected 2␤ in block <anon> at
  /tmp/BU0IJx3rtJ​:1␤ in method reify at
  src/gen/CORE.setting​:4045␤ in method reify at
  src/gen/CORE.setting​:3952␤ in method reify at
  src/gen/CORE.setting​:3952␤ in method gimme…

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Oct 21, 2011

From @coke

On Fri, Oct 21, 2011 at 9​:14 AM, Will Coleda via RT
<perl6-bugs-followup@​perl.org> wrote​:

On Mon Sep 19 20​:57​:19 2011, coke wrote​:

On Mon Apr 05 14​:21​:29 2010, coke wrote​:

On Sun Jan 11 00​:21​:58 2009, pmichaud wrote​:

On Mon Nov 24 09​:12​:36 2008, masak wrote​:

<masak> rakudo​: for 1..5 -> $a, $b { say $a, $b }
<p6eval> rakudo 33137​: OUTPUT[12␤34␤StopIteration␤current
instr.​:
'_block11' pc 78 (EVAL_15​:29)␤]

I haven't searched the specs or the tests for what should
happen,
but
I'm pretty sure this shouldn't throw an exception.

Stalling this ticket until there's a description of what should
happen
(either in S04 or S07) and tests to match.

Thanks!

Pm

17​:17 < CokeBot9000> TimToady​:

http://rt.perl.org/rt3/Ticket/Display.html?id=60780

- I
                     would imagine that on the last loop through, a
would get
                     5, and b would get whatever undef is these
days.
17​:18 <@​TimToady> no, it just fails to bind, unless you declare the
second
                  parameter as optional
17​:19 < CokeBot9000> (fails to bind) - just on the last iteration,
yes?
17​:20 <@​TimToady> yes, just the last iteration

23​:56 < [Coke]> rakudo​: for 1..5 -> $a, $b { say $a, $b }
23​:56 <+p6eval> rakudo cbdd9b​: OUTPUT«12␤34␤Not enough positional
parameters passed;
                got 1 but expected 2␤  in block <anon> at
/tmp/DxYdxC7jfN​:1␤  in
                method reify at src/gen/CORE.setting​:3690␤  in method
reify at
                src/gen/CORE.setting​:3595␤  in method reify at
                src/gen/CORE.setting​:3595␤  in method gimme…

23​:56 < [Coke]> rakudo​: for 1..5 -> $a, $b? { say $a, $b }
23​:56 <+p6eval> rakudo cbdd9b​: OUTPUT«12␤34␤5Mu()␤»

good enough for tests?

We've regressed​:

09​:13 < [Coke]> rakudo​: for 1..5 -> $a, $b { say $a, $b }
09​:14 <+p6eval> rakudo 142c41​: OUTPUT«12␤34␤Not enough positional
parameters
               passed; got 1 but expected 2␤  in block <anon> at
               /tmp/BU0IJx3rtJ​:1␤  in method reify at
               src/gen/CORE.setting​:4045␤  in method reify at
               src/gen/CORE.setting​:3952␤  in method reify at
               src/gen/CORE.setting​:3952␤  in method gimme…

--
Will "Coke" Coleda

Whoops. This isn't a regression, I just didn't test both variants.​:

09​:31 < [Coke]> rakudo​: for 1..5 -> $a, $b? { say $a, $b }
09​:31 <+p6eval> rakudo 142c41​: OUTPUT«12␤34␤5Mu()␤»

So, no change, everything works, yes, good enough for tests, marking ticket.

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Nov 1, 2011

From @moritz

Now tested in S04-statements/for.t.

@p6rt
Copy link
Author

p6rt commented Nov 1, 2011

@moritz - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Nov 1, 2011
@p6rt p6rt added the testneeded label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant