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

Nesting wrapping roles bind 'callsame' to the wrong recipient in Rakudo #3037

Open
p6rt opened this issue Jan 30, 2013 · 4 comments
Open

Nesting wrapping roles bind 'callsame' to the wrong recipient in Rakudo #3037

p6rt opened this issue Jan 30, 2013 · 4 comments
Labels
Bug

Comments

@p6rt
Copy link

@p6rt p6rt commented Jan 30, 2013

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

Searchable as RT116595$

@p6rt

This comment has been minimized.

Copy link
Author

@p6rt p6rt commented Jan 30, 2013

From @masak

<masak> hm, not sure I can golf this significantly.
<masak> does the following look odd to anyone?
<masak> r​: role Filter[$factor] { method next { repeat until $.value %
$factor { say "R$factor, $.value"; callsame } } }; class Stream { has
$.value is rw = 1; method next { say "bottom out $.value"; ++$.value
}; method filter { self but Filter[$.value] } }; .next && say .value
for Stream.new, *.filter ... *
<p6eval> rakudo b3fc32​: OUTPUT«(timeout)bottom out 1␤2␤R2, 2␤bottom
out 2␤3␤R3, 3␤R2, 3␤bottom out 3␤R2, 4␤R2, 4␤R2, 4␤R2, 4 [...]
<masak> more specifically, why, after 'bottom out 3', does it never
bottom out again?
<masak> it's a stack of nested roles, it should bottom out all the time.
<masak> the fact that it doesn't feels like a mis-reference somewhere.
<masak> n​: role Filter[$factor] { method next { repeat until $.value %
$factor { say "R$factor, $.value"; callsame } } }; class Stream { has
$.value is rw = 1; method next { say "bottom out $.value"; ++$.value
}; method filter { self but Filter[$.value] } }; .next && say .value
for Stream.new, *.filter ... *
<p6eval> niecza v24-18-gaf64300​: OUTPUT«(timeout)bottom out 1␤2␤R2,
2␤bottom out 2␤R3, 3␤R2, 3␤bottom out 3␤R2, 4␤bottom out 4␤R5, 5␤R3,
5␤R2, 5␤bottom out 5␤R2, 6␤bottom out 6 [...]
* masak submits rakudobug
<masak> if I find a way to golf the thing, I'll add that to the ticket.

@p6rt

This comment has been minimized.

Copy link
Author

@p6rt p6rt commented Jan 30, 2013

From @masak

<masak> rn​: role F[$n] { method x { callsame; callsame until $.v % $n }
}; class S { has $.v is rw = 1; method x { ++$.v } }; my $s = S.new; for
^3 { $s.x; say $s.v; $s = $s but F[$s.v] }
<p6eval> niecza v24-18-gaf64300​: OUTPUT«2␤3␤5␤»
<p6eval> ..rakudo b3fc32​: OUTPUT«(timeout)2␤3␤»
<masak> jnthn​: this is as short as I'm able to golf it.
<masak> jnthn​: the problem happens in the 'callsame' in the 'until' loop,
and the .x method in the S object never gets triggered. or rather, it
gets triggered in Niecza, but it gets waylaid in Rakudo.

@p6rt

This comment has been minimized.

Copy link
Author

@p6rt p6rt commented Jan 30, 2013

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

@p6rt

This comment has been minimized.

Copy link
Author

@p6rt p6rt commented Jun 21, 2018

From @coke

On Wed, 30 Jan 2013 07​:17​:38 -0800, masak wrote​:

<masak> rn​: role F[$n] { method x { callsame; callsame until $.v % $n }
}; class S { has $.v is rw = 1; method x { ++$.v } }; my $s = S.new; for
^3 { $s.x; say $s.v; $s = $s but F[$s.v] }
<p6eval> niecza v24-18-gaf64300​: OUTPUT«2␤3␤5␤»
<p6eval> ..rakudo b3fc32​: OUTPUT«(timeout)2␤3␤»
<masak> jnthn​: this is as short as I'm able to golf it.
<masak> jnthn​: the problem happens in the 'callsame' in the 'until' loop,
and the .x method in the S object never gets triggered. or rather, it
gets triggered in Niecza, but it gets waylaid in Rakudo.

Unchanged behavior in 2018.05-55-g95aa77c94
--
Will "Coke" Coleda

@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
Projects
None yet
1 participant
You can’t perform that action at this time.