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

The maximum of a range from zero to infinity (0..Inf or 0..*) is far too small in Rakudo #3188

Closed
p6rt opened this issue Jul 11, 2013 · 7 comments

Comments

@p6rt
Copy link

p6rt commented Jul 11, 2013

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

Searchable as RT118867$

@p6rt
Copy link
Author

p6rt commented Jul 11, 2013

From @masak

<masak> r​: say [max] 1..*
<camelia> rakudo b19f72​: OUTPUT«-Inf␤»
<masak> er.
<moritz> wtf.
* masak submits rakudobug
<FROGGS> hehe

@p6rt
Copy link
Author

p6rt commented Oct 11, 2014

From @pmichaud

On Thu Jul 11 06​:55​:23 2013, masak wrote​:

<masak> r​: say [max] 1..*
<camelia> rakudo b19f72​: OUTPUT«-Inf␤»
<masak> er.
<moritz> wtf.
* masak submits rakudobug
<FROGGS> hehe

I believe the underlying cause of this bug is RT #​122948.

  11​:31 <pmichaud> r​: say &infix​:<max>(|(1..*))
  11​:31 <camelia> rakudo-{parrot,moar} fd017a​: OUTPUT«-Inf␤»

Pm

@p6rt
Copy link
Author

p6rt commented Oct 11, 2014

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

@p6rt
Copy link
Author

p6rt commented Oct 11, 2014

From @pmichaud

RT #​122948 is indeed the underlying cause of this bug, but fixing #​122948 will result in either an infinite hang or an exception thrown from eagerly evaluating an infinite list.

If we want some other behavior to take place here, we'll have to rework the implementation of list-infix reduction, &infix​:<max>, or &infix​:<[max]>.

Pm

@p6rt
Copy link
Author

p6rt commented Oct 12, 2014

From @masak

Pm (>)​:

RT #​122948 is indeed the underlying cause of this bug, but fixing
#​122948 will result in either an infinite hang or an exception thrown
from eagerly evaluating an infinite list.

If we want some other behavior to take place here, we'll have to
rework the implementation of list-infix reduction, &infix​:<max>, or
&infix​:<[max]>.

Ok.

For what it's worth, I would probably accept an infinite hang in this case. The ticket was more about the answer being ridiculous. If there's currently a consistent model in place that predicts/explains the infinite hang, then this ticket and its use case isn't enough (IMO) to sway that.

In other words, fixing RT #​122948 ought to be enough for closing this one.

@p6rt
Copy link
Author

p6rt commented Oct 12, 2014

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

@p6rt p6rt closed this as completed Oct 12, 2014
@p6rt
Copy link
Author

p6rt commented Aug 27, 2015

From @coke

On Thu Jul 11 06​:55​:23 2013, masak wrote​:

<masak> r​: say [max] 1..*
<camelia> rakudo b19f72​: OUTPUT«-Inf␤»
<masak> er.
<moritz> wtf.
* masak submits rakudobug
<FROGGS> hehe

This is fixed in the glr branch. Closable with tests.

Good luck writing a test that tests that we successfully entered an infinite loop.

--
Will "Coke" Coleda

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