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

Not enough thunking of the rhs of //= and ||= in Rakudo #2095

Closed
p6rt opened this issue Aug 24, 2010 · 6 comments
Closed

Not enough thunking of the rhs of //= and ||= in Rakudo #2095

p6rt opened this issue Aug 24, 2010 · 6 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Aug 24, 2010

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

Searchable as RT77420$

@p6rt
Copy link
Author

p6rt commented Aug 24, 2010

From @masak

<thundergnat> rakudo​: my ($i, $j); for (1..5) {print $i //= $j+=5;
$i++; print ",$j "}
<p6eval> rakudo 82c9e9​: OUTPUT«5,5 6,10 7,15 8,20 9,25 »
<thundergnat> Is that a bug or a feature?
<thundergnat> I would have expected 5,5 6,5 7,5 8,5 9,5
<masak> why? you're not resetting $j between iterations.
<TimToady> looks like a bug to me
<masak> oh!
<masak> thundergnat++
* masak submits rakudobug
<TimToady> pugs​: my ($i, $j); for (1..5) {print $i //= $j+=5; $i++;
print ",$j "}
<thundergnat> actually, same for ||
<p6eval> pugs​: OUTPUT«5,5 6,5 7,5 8,5 9,5 »
<TimToady> pugs has it correct
<masak> aye, those should be thunks.
<masak> rakudo​: my ($i, $j); for (1..5) {print $i ||= $j+=5; $i++;
print ",$j "}
<p6eval> rakudo 82c9e9​: OUTPUT«5,5 6,10 7,15 8,20 9,25 »

@p6rt
Copy link
Author

p6rt commented Aug 27, 2010

From @thundergnat

For what it is worth, it seems that this was done once before but
somehow got undone. See commit @​​:
http://github.com/rakudo/rakudo/commit/b117c67290798be851d56e2b13e0b9dfed939895

@p6rt
Copy link
Author

p6rt commented Jan 30, 2011

From @masak

<sorear> perl6​: my %h; %h<blue> //= say(1); %h<blue> //= say(2);
<p6eval> pugs, niecza v1-203-gbc5d7f7​: OUTPUT«1␤»
<p6eval> ..rakudo 549d2a​: OUTPUT«1␤2␤»
<masak> there you go.
* masak submits rakudobug, Justin Case

@p6rt
Copy link
Author

p6rt commented Apr 30, 2012

From @masak

<jnthn> masak​: I thought we had an RT for //= and ||= and so on not doing
the right thing with the RHS, but can't find it.
<masak> jnthn​: lemme find it for you.
<jnthn> masak​: Feel free to try your luck :)
<masak> jnthn​: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=77420
<jnthn> masak​: Feel free to just resolve it; we have test coverage now.
* masak resolves it

@p6rt
Copy link
Author

p6rt commented Apr 30, 2012

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

@p6rt
Copy link
Author

p6rt commented Apr 30, 2012

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

@p6rt p6rt closed this as completed Apr 30, 2012
@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