Re: [perl #61206] :x($n) where $n ~~ Range doesn't work properly in Rakudo

2008-12-22 Thread Carl Mäsak
Patrick (>): > I would prefer to see this done by using a smart match on the :x() > argument instead of explicitly checking it for a Range and grabbing > min/max from there. Using a smart match would allow things like > :x(1|5|7) and :x({ .is_prime }) to work properly. We might as well add spect

[perl #61206] :x($n) where $n ~~ Range doesn't work properly in Rakudo

2008-12-22 Thread Patrick R. Michaud via RT
On Mon Dec 22 16:41:53 2008, zev wrote: > Oops. The last patch wasn't quite right. This one passes the tests > (which I found). I also added spectests that are marked TODO (but which > pass with this patch applied). I would prefer to see this done by using a smart match on the :x() argument ins

Re: [perl #61598] [PATCH] Implementation of Array.elems

2008-12-22 Thread Vasily Chekalkin
Patrick R. Michaud via RT wrote: On Mon, Dec 22, 2008 at 04:15:20AM -0800, Vasily Chekalkin wrote: Trivial patch for Array.elems attached. As far as I can tell, Array.elems already works in trunk without the patch. Is there a specific test or set of tests this enables, or a case that isn't be

Re: [perl #61610] Something is inconsistent with the undef warnings of .reduce

2008-12-22 Thread Vasily Chekalkin
Mark J. Reed wrote: Arity 2 and a 1-elem list seems to be special-cased; otherwise, it consistently warns once per undefined value in the expansion: 1-elem List reduce patch attached. Test added in r24567 -- Bacek commit 9c1a3058064067dacab4c5f623a59ae768f19182 Author: Vasily Chekalkin Date:

Re: [perl #61610] Something is inconsistent with the undef warnings of .reduce

2008-12-22 Thread Mark J. Reed
Ok, so with that patch, the case of a 1-element list and a binary sub now behaves the same as any other combination of arity n with a list whose length is not k(n-1)+1. I guess that's progress. :) Thanks, Vasily. I'd still like to see the undef warnings reduced to one, rather than one for every

[perl #61618] [PATCH] Report the number of elements in an infinite range correctly

2008-12-22 Thread via RT
# New Ticket Created by Cory Spencer # Please include the string: [perl #61618] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=61618 > The attatched patch lets an infinite Range (ie. (1..Inf)) report its length as Inf. I

Re: [perl #61610] Something is inconsistent with the undef warnings of .reduce

2008-12-22 Thread Mark J. Reed
Arity 2 and a 1-elem list seems to be special-cased; otherwise, it consistently warns once per undefined value in the expansion: (1..4).reduce({$^a+$^b+$^c+$^d})# no warnings (1..5).reduce({$^a+$^b+$^c+$^d})# two warnings: (1+2+3+4)+5+undef+undef (1..6).reduce({$^a+$^b+$^c+$^d})# one w

[perl #61610] Something is inconsistent with the undef warnings of .reduce

2008-12-22 Thread Carl Mäsak
# New Ticket Created by "Carl Mäsak" # Please include the string: [perl #61610] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=61610 > rakudo: say (1..10).reduce({$^a + $^b + $^c}) rakudo 34244: OUTPUT[Use of uninitialize

[perl #61576] "+Inf" and numeric comparisons in Rakudo

2008-12-22 Thread Patrick R. Michaud via RT
On Sun Dec 21 08:46:48 2008, masak wrote: > even so, we don't want the case of my $a = [].min; > if $a < 3 { say 'yes'; } > because right now "+Inf" is probably treated as < 3 > rakudo: say "+Inf" < 3; > rakudo 34203: OUTPUT[1␤] > * masak submits rakudobug Now working in r34248, thanks

[perl #61618] [PATCH] Report the number of elements in an infinite range correctly

2008-12-22 Thread Patrick R. Michaud via RT
On Mon Dec 22 09:46:43 2008, cspencer wrote: > > The attatched patch lets an infinite Range (ie. (1..Inf)) report its > length as Inf. > > It also adds temporary !FAIL cases when an infinite range is converted > into a list or string context. The patch needs some rework before it can be accept

[perl #61606] &sub.arity doesn't treat named parameters as optional

2008-12-22 Thread Patrick R. Michaud via RT
On Mon Dec 22 06:24:11 2008, moritz wrote: > Rakudo (r34146) correctly excludes optional arguments from its counting, > but not named ones, which are also optional: > > $ ./perl6 -e 'sub a($x, $y?) { }; sub b ($x, :$y) { }; say &a.arity; say > &b.arity' > 1 > 2 # should be 1 as well > $ Now fixed

Re: [perl #61596] Rakudo does the Wrong Thing when defining subs via eval string

2008-12-22 Thread Larry Wall
On Mon, Dec 22, 2008 at 01:29:06AM -0800, Carl Mäsak wrote: : # New Ticket Created by "Carl Mäsak" : # Please include the string: [perl #61596] : # in the subject line of all future correspondence about this issue. : # http://rt.perl.org/rt3/Ticket/Display.html?id=61596 > : : : rakudo: eval

Re: [perl #61598] [PATCH] Implementation of Array.elems

2008-12-22 Thread Patrick R. Michaud
On Mon, Dec 22, 2008 at 04:15:20AM -0800, Vasily Chekalkin wrote: > Trivial patch for Array.elems attached. As far as I can tell, Array.elems already works in trunk without the patch. Is there a specific test or set of tests this enables, or a case that isn't being handled? Pm

Re: [perl #61602] Fix Integral values of Inf/NaN

2008-12-22 Thread Patrick R. Michaud
On Mon, Dec 22, 2008 at 06:00:31AM -0800, Cory Spencer wrote: > When calling the .int method on Inf/Nan, the reported value is incorrect: >"Inf.int.say" produces "-2147483648" > and >"NaN.int.say" produces "-2147483648" This turns out to be the way that Parrot converts infinities to intege

[perl #61604] [TODO] allow 'does RoleName' inside a class

2008-12-22 Thread via RT
# New Ticket Created by Moritz Lenz # Please include the string: [perl #61604] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=61604 > currently (r34146) Rakudo allows 'class MyClass does RoleName { ... }', but not 'class My

[perl #61606] &sub.arity doesn't treat named parameters as optional

2008-12-22 Thread via RT
# New Ticket Created by Moritz Lenz # Please include the string: [perl #61606] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=61606 > Rakudo (r34146) correctly excludes optional arguments from its counting, but not named on

[perl #61598] [PATCH] Implementation of Array.elems

2008-12-22 Thread via RT
# New Ticket Created by Vasily Chekalkin # Please include the string: [perl #61598] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=61598 > Hello. Trivial patch for Array.elems attached. Quote from spectest: t/spec/S29-ar

[perl #61608] [BUG] Can't use the sub form of push(@*INC, @list)

2008-12-22 Thread via RT
# New Ticket Created by Moritz Lenz # Please include the string: [perl #61608] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=61608 > Rakudo r34146: $ ./perl6 -e '@*INC.push("b")' # lives, rakudo++ $ ./perl6 -e 'my @a

[perl #61602] Fix Integral values of Inf/NaN

2008-12-22 Thread via RT
# New Ticket Created by Cory Spencer # Please include the string: [perl #61602] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=61602 > When calling the .int method on Inf/Nan, the reported value is incorrect: "Inf.int.

[perl #61596] Rakudo does the Wrong Thing when defining subs via eval string

2008-12-22 Thread Carl Mäsak
# New Ticket Created by "Carl Mäsak" # Please include the string: [perl #61596] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=61596 > rakudo: eval "sub x { say q }"; say "before call"; x rakudo 34238: OUTPUT[O, NI HAO␤be