Skip Menu |
Report information
Id: 125337
Status: open
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: alex.jakimenko [at] gmail.com
Cc:
AdminCc:

Severity: (no value)
Tag: (no value)
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Date: Fri, 5 Jun 2015 20:28:55 +0300
From: Alex Jakimenko <alex.jakimenko [...] gmail.com>
Subject: NaN in sequences – weirdness and the lack of laziness
To: rakudobug [...] perl.org
Download (untitled) / with headers
text/plain 305b
This is just weird:

Code:
.say for 1...NaN;

Result:
1
0
-1
-2
-3
-4
... and so on ...

Surprisingly it counts down. Maybe it should produce an error.

Also, all of these are not lazy:

my @a = 1...NaN;
my @a = 1...-Inf;
my @a = NaN...1;
my @a = Inf...0;
my @a = -Inf...0;

Any of these lines will hang.
Download (untitled) / with headers
text/plain 253b
For @LARRY: since NaNs are not comparable, sequences and ranges with NaN end points should be Failures. Is there agreement on that? IRC commentary: http://irclog.perlgeek.de/perl6-dev/2016-07-22#i_12884778 -- Cheers, ZZ | https://twitter.com/zoffix


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org