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

Trying to put an infinite range into a native array no longer throws (my int @a = ^Inf) #5941

Closed
p6rt opened this issue Dec 29, 2016 · 9 comments

Comments

@p6rt
Copy link

p6rt commented Dec 29, 2016

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

Searchable as RT130443$

@p6rt
Copy link
Author

p6rt commented Dec 29, 2016

From @AlexDaniel

Code​:
my int @​a = ^Inf; dd @​a

Result (2015.12,2016.02)​:
This type cannot unbox to a native integer
  in block <unit> at /tmp/fdFVh_0R7j line 1

Result (2016.03,HEAD)​:
array[int].new()

In other words, ^Inf does nothing when assigned to @​a. Even though the previous error message was LTA, the behavior was better because it wasn't swallowing it silently.

Bisectable points to rakudo/rakudo@2a20197

@p6rt
Copy link
Author

p6rt commented Dec 29, 2016

From @zoffixznet

The problem is the operator returns a failure, but since we're assigning it doesn't get sunk and so is silent.

I see 16 fail()s in src/core/native_array.pm and I'm unsure what the best way to do this (lizmat, any idea?)

Along with the silent one for STORE, the .splice ones also explode prematurely by being stuffed into a native type somewhere​:

my int @​a = ^Inf; # Failure is silent
my int @​a; @​a.append​: 1...*; # Failure explodes
my int @​a; @​a.unshift​: 1...*; # Failure explodes
my int @​a; @​a.splice​: 1...*; # Failure, gives​:
<camelia> rakudo-moar 19df35​: OUTPUT«This type cannot unbox to a native integer​: P6opaque, Failure␤ in block <unit> at <tmp> line 1␤␤»

On Thu, 29 Dec 2016 09​:33​:20 -0800, alex.jakimenko@​gmail.com wrote​:

Code​:
my int @​a = ^Inf; dd @​a

Result (2015.12,2016.02)​:
This type cannot unbox to a native integer
in block <unit> at /tmp/fdFVh_0R7j line 1

Result (2016.03,HEAD)​:
array[int].new()

In other words, ^Inf does nothing when assigned to @​a. Even though the
previous error message was LTA, the behavior was better because it
wasn't swallowing it silently.

Bisectable points to
rakudo/rakudo@2a20197

@p6rt
Copy link
Author

p6rt commented Dec 29, 2016

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

@p6rt
Copy link
Author

p6rt commented Dec 29, 2016

From @zoffixznet

*operation

.oO( where's the edit button when you need it /o\ )

@p6rt
Copy link
Author

p6rt commented Dec 29, 2016

From @geekosaur

On Thu, Dec 29, 2016 at 1​:43 PM, Zoffix Znet via RT <
perl6-bugs-followup@​perl.org> wrote​:

I see 16 fail()s in src/core/native_array.pm and I'm unsure what the best
way to do this (lizmat, any idea?)

Is this making moritz's point on IRC yesterday?
2016 Dec 28 18​:39​:27 <moritz> I think fail() was a mistake, and it's time
we admitted it

--
brandon s allbery kf8nh sine nomine associates
allbery.b@​gmail.com ballbery@​sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net

@p6rt
Copy link
Author

p6rt commented Dec 29, 2016

From @lizmat

Fixed with aa35065, tests needed.

On 29 Dec 2016, at 18​:33, Aleks-Daniel Jakimenko-Aleksejev (via RT) <perl6-bugs-followup@​perl.org> wrote​:

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

Code​:
my int @​a = ^Inf; dd @​a

Result (2015.12,2016.02)​:
This type cannot unbox to a native integer
in block <unit> at /tmp/fdFVh_0R7j line 1

Result (2016.03,HEAD)​:
array[int].new()

In other words, ^Inf does nothing when assigned to @​a. Even though the previous error message was LTA, the behavior was better because it wasn't swallowing it silently.

Bisectable points to rakudo/rakudo@2a20197

@p6rt
Copy link
Author

p6rt commented Dec 29, 2016

From @zoffixznet

On Thu, 29 Dec 2016 10​:47​:39 -0800, allbery.b@​gmail.com wrote​:

On Thu, Dec 29, 2016 at 1​:43 PM, Zoffix Znet via RT <
perl6-bugs-followup@​perl.org> wrote​:

Is this making moritz's point on IRC yesterday?

By that logic we should be throwing away all the features, the first time we encounter a buggy interaction.
https://irclog.perlgeek.de/perl6-dev/2016-12-28#i_13814034

@p6rt
Copy link
Author

p6rt commented Jan 1, 2017

@p6rt
Copy link
Author

p6rt commented Jan 1, 2017

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

@p6rt p6rt closed this as completed Jan 1, 2017
@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