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

infix:<...> shouldn't autothread because of a junction in the RHS in Rakudo #3024

Closed
p6rt opened this issue Jan 10, 2013 · 5 comments
Closed

Comments

@p6rt
Copy link

p6rt commented Jan 10, 2013

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

Searchable as RT116348$

@p6rt
Copy link
Author

p6rt commented Jan 10, 2013

From @masak

<[Coke]> r​: sub postfix​:<!!> ($x) { my $a = $x %% 2 ?? 2 !! 3; [*] $a,
$a+2 ... $x } ; say 4!!; say 5!!
<p6eval> rakudo e26703​: OUTPUT«8␤15␤»
<masak> r​: sub postfix​:<!!>($x) { [*] $x, $x - 2 ... 2|3 }; say 4!!; say 5!!
<p6eval> rakudo e26703​: OUTPUT«(timeout)»
<masak> huh!
<masak> r​: sub postfix​:<!!>($x) { [*] $x, $x - 2 ... any(2, 3) }; say
4!!; say 5!!
<p6eval> rakudo e26703​: OUTPUT«(timeout)»
<masak> something's wrong here.
<masak> "I notice that I am confused."
<jnthn> Maybe.
<jnthn> I think the 2|3 may be auto-threading earlier than any("you
expect", "it should be")
<jnthn> So it results in two sequences
<jnthn> One of which never terminates.
<masak> oh!
<masak> jnthn​: yes, I think you're right.
<TimToady> the RHS of ... should be able to do a smartmatch, so
shouldn't autothread, I'd think
* masak submits rakudobug
<jnthn> TimToady​: wfm, it's probably not hard to fix it that way.
<TimToady> I certainly expected 2|3 to work there

@p6rt
Copy link
Author

p6rt commented Jan 10, 2013

From @jnthn

On Thu Jan 10 12​:49​:08 2013, masak wrote​:

<[Coke]> r​: sub postfix​:<!!> ($x) { my $a = $x %% 2 ?? 2 !! 3; [*] $a,
$a+2 ... $x } ; say 4!!; say 5!!
<p6eval> rakudo e26703​: OUTPUT«8␤15␤»
<masak> r​: sub postfix​:<!!>($x) { [*] $x, $x - 2 ... 2|3 }; say 4!!;
say 5!!
<p6eval> rakudo e26703​: OUTPUT«(timeout)»
<masak> huh!
<masak> r​: sub postfix​:<!!>($x) { [*] $x, $x - 2 ... any(2, 3) }; say
4!!; say 5!!
<p6eval> rakudo e26703​: OUTPUT«(timeout)»
<masak> something's wrong here.
<masak> "I notice that I am confused."
<jnthn> Maybe.
<jnthn> I think the 2|3 may be auto-threading earlier than any("you
expect", "it should be")
<jnthn> So it results in two sequences
<jnthn> One of which never terminates.
<masak> oh!
<masak> jnthn​: yes, I think you're right.
<TimToady> the RHS of ... should be able to do a smartmatch, so
shouldn't autothread, I'd think
* masak submits rakudobug
<jnthn> TimToady​: wfm, it's probably not hard to fix it that way.
<TimToady> I certainly expected 2|3 to work there

I've pushed a fix that seems to do the job, at least for this case​:

sub postfix​:<!!>($x) { [*] $x, $x - 2 ... 2|3 }; say 4!!; say 5!!
8
15

Think it should hold up. Tagging testneeded.

/jnthn

@p6rt
Copy link
Author

p6rt commented Jan 10, 2013

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

@p6rt
Copy link
Author

p6rt commented Sep 24, 2014

From @usev6

I added a test to S03-sequence/misc.t with the following commit​: Raku/roast@7f16f13

@p6rt p6rt closed this as completed Sep 24, 2014
@p6rt
Copy link
Author

p6rt commented Sep 24, 2014

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

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