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

.pickpairs .Int-ifes the argument, but .pick doesn't (say ^5 .BagHash.pick(2.5)) #6228

Closed
p6rt opened this issue May 8, 2017 · 5 comments
Closed

Comments

@p6rt
Copy link

p6rt commented May 8, 2017

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

Searchable as RT131272$

@p6rt
Copy link
Author

p6rt commented May 8, 2017

From @AlexDaniel

Code​:
say ^5 .BagHash.pickpairs(2.5);

Result​:
(1 => 1 4 => 1)

Code​:
say ^5 .BagHash.pick(2.5);

Result​:
count computed to 2.5, which cannot be used
  in block <unit> at <tmp> line 1

I find it impossible to predict when non-Int args are alright and when they are not. I would expect consistency of some sort.

(same thing with .grab and .grabpairs)

@p6rt
Copy link
Author

p6rt commented May 8, 2017

From @lizmat

Fixed with 31be51284e70badd8ed , tests needed.

On 8 May 2017, at 20​:25, 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 #​131272]
# in the subject line of all future correspondence about this issue.
# <URL​: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=131272 >

Code​:
say ^5 .BagHash.pickpairs(2.5);

Result​:
(1 => 1 4 => 1)

Code​:
say ^5 .BagHash.pick(2.5);

Result​:
count computed to 2.5, which cannot be used
in block <unit> at <tmp> line 1

I find it impossible to predict when non-Int args are alright and when they are not. I would expect consistency of some sort.

(same thing with .grab and .grabpairs)

@p6rt
Copy link
Author

p6rt commented May 8, 2017

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

@p6rt
Copy link
Author

p6rt commented Jul 5, 2017

From @dogbert17

On Mon, 08 May 2017 11​:51​:25 -0700, elizabeth wrote​:

Fixed with 31be51284e70badd8ed , tests needed.

On 8 May 2017, at 20​:25, 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 #​131272]
# in the subject line of all future correspondence about this issue.
# <URL​: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=131272 >

Code​:
say ^5 .BagHash.pickpairs(2.5);

Result​:
(1 => 1 4 => 1)

Code​:
say ^5 .BagHash.pick(2.5);

Result​:
count computed to 2.5, which cannot be used
in block <unit> at <tmp> line 1

I find it impossible to predict when non-Int args are alright and
when they are not. I would expect consistency of some sort.

(same thing with .grab and .grabpairs)

Tests added with Raku/roast@68d34de4b8. Resolving issue.

@p6rt p6rt closed this as completed Jul 5, 2017
@p6rt
Copy link
Author

p6rt commented Jul 5, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant