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

Inf in Int, [LTA] error message, Int.Range (-Inf..Inf vs -Inf^..^Inf) #4903

Closed
p6rt opened this issue Dec 22, 2015 · 7 comments
Closed

Inf in Int, [LTA] error message, Int.Range (-Inf..Inf vs -Inf^..^Inf) #4903

p6rt opened this issue Dec 22, 2015 · 7 comments

Comments

@p6rt
Copy link

p6rt commented Dec 22, 2015

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

Searchable as RT126990$

@p6rt
Copy link
Author

p6rt commented Dec 22, 2015

From @AlexDaniel

Let's start with this​:

Code​:
my Int $x = Inf

Result​:
===SORRY!===
Cannot find method 'value'

LTA for sure (meaningless description, no line number).

According to S02 (https://design.perl6.org/S02.html#Immutable_types) it
should be possible to store Inf and NaN in Int.

This, however, is not what we have right now.

In other words, there are three (maybe more?) ways to improve this​:
1) Make it possible to store Inf in Int (therefore the error will go away)
2) Make it throw NYI warning now, perhaps implement it later
3) Decide that Inf is not compatible with Int, fix the docs and make it
throw a meaningful warning.

However, there is another issue that is closely related to this.

Code​:
say Int.Range

Result​:
-Inf..Inf

Whether this answer is correct or not depends on the decision above​:
1) If it is possible to put Inf into Int variable, then it is correct.
2) If it will be possible later, then… um… I don't know. Perhaps it is a
good idea to correct it now and then revert it later.
3) Just fix it! It should be -Inf^..^Inf (at least that's what would make
it clear that you cannot use Inf as Int)

IRC log​: http://irclog.perlgeek.de/perl6/2015-12-22#i_11757210

@p6rt
Copy link
Author

p6rt commented Dec 22, 2015

From @AlexDaniel

By the way, same LTA error is shown for Rat, Complex and possibly some
other types.

On Tue, Dec 22, 2015 at 5​:04 PM, perl6 via RT <perl6-bugs-followup@​perl.org>
wrote​:

Greetings,

This message has been automatically generated in response to the
creation of a trouble ticket regarding​:
"Inf in Int, LTA error message, Inf.Range (-Inf..Inf vs
-Inf^..^Inf)",
a summary of which appears below.

There is no need to reply to this message right now. Your ticket has been
assigned an ID of [perl #​126990].

Please include the string​:

     \[perl #&#8203;126990\]

in the subject line of all future correspondence about this issue. To do
so,
you may reply to this message.

                    Thank you,
                    perl6\-bugs\-followup@&#8203;perl\.org

-------------------------------------------------------------------------
Let's start with this​:

Code​:
my Int $x = Inf

Result​:
===SORRY!===
Cannot find method 'value'

LTA for sure (meaningless description, no line number).

According to S02 (https://design.perl6.org/S02.html#Immutable_types) it
should be possible to store Inf and NaN in Int.

This, however, is not what we have right now.

In other words, there are three (maybe more?) ways to improve this​:
1) Make it possible to store Inf in Int (therefore the error will go away)
2) Make it throw NYI warning now, perhaps implement it later
3) Decide that Inf is not compatible with Int, fix the docs and make it
throw a meaningful warning.

However, there is another issue that is closely related to this.

Code​:
say Int.Range

Result​:
-Inf..Inf

Whether this answer is correct or not depends on the decision above​:
1) If it is possible to put Inf into Int variable, then it is correct.
2) If it will be possible later, then… um… I don't know. Perhaps it is a
good idea to correct it now and then revert it later.
3) Just fix it! It should be -Inf^..^Inf (at least that's what would make
it clear that you cannot use Inf as Int)

IRC log​: http://irclog.perlgeek.de/perl6/2015-12-22#i_11757210

@p6rt
Copy link
Author

p6rt commented Dec 22, 2015

From @coke

On Tue Dec 22 07​:04​:38 2015, alex.jakimenko@​gmail.com wrote​:

Let's start with this​:

Code​:
my Int $x = Inf

Result​:
===SORRY!===
Cannot find method 'value'

LTA for sure (meaningless description, no line number).

According to S02 (https://design.perl6.org/S02.html#Immutable_types) it
should be possible to store Inf and NaN in Int.

This, however, is not what we have right now.

In other words, there are three (maybe more?) ways to improve this​:
1) Make it possible to store Inf in Int (therefore the error will go away)
2) Make it throw NYI warning now, perhaps implement it later
3) Decide that Inf is not compatible with Int, fix the docs and make it
throw a meaningful warning.

This was addressed in the rejected 61602 - note that the SYN are not necessarily the spec. We need a spec ruling to make this work, and making a performant implementation needs to happen first.

However, there is another issue that is closely related to this.

Code​:
say Int.Range

Result​:
-Inf..Inf

Whether this answer is correct or not depends on the decision above​:
1) If it is possible to put Inf into Int variable, then it is correct.
2) If it will be possible later, then… um… I don't know. Perhaps it is a
good idea to correct it now and then revert it later.
3) Just fix it! It should be -Inf^..^Inf (at least that's what would make
it clear that you cannot use Inf as Int)

IRC log​: http://irclog.perlgeek.de/perl6/2015-12-22#i_11757210

3 seems reasonable.

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Dec 22, 2015

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

@p6rt
Copy link
Author

p6rt commented Jan 8, 2016

From @lizmat

On 22 Dec 2015, at 16​:04, Alex Jakimenko (via RT) <perl6-bugs-followup@​perl.org> wrote​:

# New Ticket Created by Alex Jakimenko
# Please include the string​: [perl #​126990]
# in the subject line of all future correspondence about this issue.
# <URL​: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=126990 >

Let's start with this​:

Code​:
my Int $x = Inf

Result​:
===SORRY!===
Cannot find method ‘value'
LTA for sure (meaningless description, no line number).

Fixed with af87982 , tests are still needed. This is a dupe of RT #​127207 .

According to S02 (https://design.perl6.org/S02.html#Immutable_types) it
should be possible to store Inf and NaN in Int.

This, however, is not what we have right now.

In other words, there are three (maybe more?) ways to improve this​:
1) Make it possible to store Inf in Int (therefore the error will go away)
2) Make it throw NYI warning now, perhaps implement it later
3) Decide that Inf is not compatible with Int, fix the docs and make it
throw a meaningful warning.

However, there is another issue that is closely related to this.

Code​:
say Int.Range

Result​:
-Inf..Inf

Whether this answer is correct or not depends on the decision above​:
1) If it is possible to put Inf into Int variable, then it is correct.
2) If it will be possible later, then… um… I don't know. Perhaps it is a
good idea to correct it now and then revert it later.
3) Just fix it! It should be -Inf^..^Inf (at least that's what would make
it clear that you cannot use Inf as Int)

IRC log​: http://irclog.perlgeek.de/perl6/2015-12-22#i_11757210

Fixed with b69aa55c , making Int.Range show -Inf^..^Inf . I think this also still needs tests.

Liz

@p6rt
Copy link
Author

p6rt commented Jul 11, 2016

From @zoffixznet

Tests added in Raku/roast@b38fe5e6db and Raku/roast@679a57f

@p6rt
Copy link
Author

p6rt commented Jul 11, 2016

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

@p6rt p6rt closed this as completed Jul 11, 2016
@p6rt p6rt added the testneeded 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
Development

No branches or pull requests

1 participant