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

2017-07-05 Thread Jan-Olof Hendig via RT
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)
> >  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.
> > # https://rt.perl.org/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  at  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 https://github.com/perl6/roast/commit/68d34de4b8. Resolving 
issue.



Re: [perl #131272] .pickpairs .Int-ifes the argument, but .pick doesn't (say ^5 .BagHash.pick(2.5))

2017-05-08 Thread Elizabeth Mattijsen
Fixed with 31be51284e70badd8ed , tests needed.

> On 8 May 2017, at 20:25, Aleks-Daniel Jakimenko-Aleksejev (via RT) 
>  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. 
> # https://rt.perl.org/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  at  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)


Re: [perl #131272] .pickpairs .Int-ifes the argument, but .pick doesn't (say ^5 .BagHash.pick(2.5))

2017-05-08 Thread Elizabeth Mattijsen via RT
Fixed with 31be51284e70badd8ed , tests needed.

> On 8 May 2017, at 20:25, Aleks-Daniel Jakimenko-Aleksejev (via RT) 
>  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. 
> # https://rt.perl.org/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  at  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)



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

2017-05-08 Thread via RT
# 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. 
# https://rt.perl.org/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  at  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)