[perl #130513] [REGRESSION] .List no longer works on shaped arrays (my @a[2;2]; say @a.List)

2017-01-04 Thread via RT
# New Ticket Created by  Aleks-Daniel Jakimenko-Aleksejev 
# Please include the string:  [perl #130513]
# in the subject line of all future correspondence about this issue. 
# https://rt.perl.org/Ticket/Display.html?id=130513 >


Code:
my @a[2;2]; say @a.List


Result (2015.12,2016.06):
((Any) (Any) (Any) (Any))


Result (2016.07.1,HEAD):
Cannot access 2 dimension array with 1 indices
  in block  at /tmp/8Bs1nJFDSo line 1



Bisectable points to 
https://github.com/rakudo/rakudo/commit/e99082382905e2da6a8962a8b97663d32736c739


Maybe it is not supposed to work, but the commit message does not mention that. 
Therefore I am assuming that the change was unintentional.


[perl #130511] [LTA] [REGRESSION] No such symbol '' ( &::(‘½’) )

2017-01-04 Thread via RT
# New Ticket Created by  Aleks-Daniel Jakimenko-Aleksejev 
# Please include the string:  [perl #130511]
# in the subject line of all future correspondence about this issue. 
# https://rt.perl.org/Ticket/Display.html?id=130511 >


Code:
&::(‘½’)


Result (2015.12,2016.11):
No such symbol '&::½'
  in block  at /tmp/IgxZiYFkJS line 1

Actually thrown at:
  in block  at /tmp/IgxZiYFkJS line 1



Result (2016.12,HEAD):
No such symbol ''
  in block  at /tmp/IgxZiYFkJS line 1

Actually thrown at:
  in block  at /tmp/IgxZiYFkJS line 1



It should not print an empty string.


Bisectable points to 
https://github.com/rakudo/rakudo/commit/939d27370861ee383d874104453f04b333b2f66e


[perl #130510] [REGRESSION] Cannot assign an array of shape 2 2 to an array of shape 2 2 (my @c[2;2] .= new(:shape(2, 2), , ))

2017-01-04 Thread via RT
# New Ticket Created by  Aleks-Daniel Jakimenko-Aleksejev 
# Please include the string:  [perl #130510]
# in the subject line of all future correspondence about this issue. 
# https://rt.perl.org/Ticket/Display.html?id=130510 >


Code:
my @c[2;2] .= new(:shape(2, 2), , )'


Result (2015.12,2016.10):
[[1 a] [2 b]]
(1 a 2 b)


Result (2016.11,HEAD):
Cannot assign an array of shape 2 2 to an array of shape 2 2
  in block  at /tmp/9MD__1ftfd line 1
«exit code = 1»



Bisectable points to two related commits:
https://github.com/rakudo/rakudo/commit/1293188342fdb66aa6cd00668d988a710a36f489
https://github.com/rakudo/rakudo/commit/c5d33a2d4b1dc7548fdfce0207b46e62d304e114


Error appeared after the first one, but looked like this:

Assignment to array with shape 2 2 must provide structured data
  in block  at /tmp/jA3o34pAeI line 1


Actual nonsense in the error message was introduced after the second commit:

Cannot assign an array of shape 2 2 to an array of shape 2 2
in block  at /tmp/jA3o34pAeI line 1



[perl #130509] [LTA] [REGRESSION] error message points to CORE.setting, previously it did not (my $x = fail)

2017-01-04 Thread via RT
# New Ticket Created by  Aleks-Daniel Jakimenko-Aleksejev 
# Please include the string:  [perl #130509]
# in the subject line of all future correspondence about this issue. 
# https://rt.perl.org/Ticket/Display.html?id=130509 >


Code:
my $x = fail


Result (2015.12,2016.05):
Failed
  in block  at /tmp/YwY2tDA0RS line 1


Result (2016.06,HEAD):
Failed
  in any  at 
/tmp/whateverable/rakudo-moar/996ab6a04025353083bbf03f03192444c30e3872/share/perl6/runtime/CORE.setting.moarvm
 line 1
  in block  at /tmp/YwY2tDA0RS line 1



It is mostly OK, but the previous error message was slightly better because it 
did not point to “CORE.setting.moarvm line 1” (which brings no useful 
information).


[perl #130508] [@LARRY] Backslashed digits in character classes are inconsistent (/ <[\5]> /)

2017-01-04 Thread via RT
# New Ticket Created by  Aleks-Daniel Jakimenko-Aleksejev 
# Please include the string:  [perl #130508]
# in the subject line of all future correspondence about this issue. 
# https://rt.perl.org/Ticket/Display.html?id=130508 >


First, two examples:

Code:
say “5” ~~ /<[\5]>/

Result:
「5」


Code:
say “0” ~~ /<[\0]>/

Result:
Nil



Why? Because backslashed zero stands for a null byte:

Code:
say “\0” ~~ /<[\0]>/

Result:
「␀」


The fact that some backslashed digits do one thing and others do something else 
is inconsistent by itself.

However, we might also look at the behavior elsewhere:


Code:
say “2” ~~ / \2 /

Result:
===SORRY!=== Error while compiling -e
Unrecognized backslash sequence (did you mean $1?)
at -e:1
--> say “2” ~~ / \2⏏ /



Code:
say “2” eq “\2”

Result:
===SORRY!=== Error while compiling -e
Unrecognized backslash sequence (did you mean $1?)
at -e:1
--> say “2” eq “\2⏏”


If we cannot recognize this backslash sequence, let's not recognize it 
everywhere?


[perl #130507] [BUG] "once" block doesn't run if it isn't reached the first time the parent block runs

2017-01-04 Thread via RT
# New Ticket Created by  Michael Schaap 
# Please include the string:  [perl #130507]
# in the subject line of all future correspondence about this issue. 
# https://rt.perl.org/Ticket/Display.html?id=130507 >


 for ^10 -> $i {
 once { say "This runs." }
 say $i;
 once { say "This runs as well." }
 next if $i < 5;
 once { say "This should run but doesn't." }
 }

Actual output:

 This runs.
 0
 This runs as well.
 1
 2
 3
 4
 5
 6
 7
 8
 9

Expected output:

 This runs.
 0
 This runs as well.
 1
 2
 3
 4
 5
 This should run but doesn't.
 6
 7
 8
 9

Possibly related bug: https://rt.perl.org/Ticket/Display.html?id=102994

Latest Rakudo Star:
This is Rakudo version 2016.11 built on MoarVM version 2016.11
implementing Perl 6.c.





[perl #130506] [LTA] Malformed printf pattern produces an error message without a useful line number (printf("%d, %d", 1))

2017-01-04 Thread via RT
# New Ticket Created by  Aleks-Daniel Jakimenko-Aleksejev 
# Please include the string:  [perl #130506]
# in the subject line of all future correspondence about this issue. 
# https://rt.perl.org/Ticket/Display.html?id=130506 >


Code:
printf("%d, %d", 1);

Result:
Your printf-style directives specify 2 arguments, but 1 argument was supplied
  in any  at 
/home/camelia/rakudo-m-inst-1/share/perl6/runtime/CORE.setting.moarvm line 1




“CORE.setting.moarvm line 1” is not very helpful. I was expecting it to point 
to the user code (e.g. “at :1”).


[perl #130505] [LTA] double SORRY (BEGIN (1, 2)[*-1])

2017-01-04 Thread via RT
# New Ticket Created by  Aleks-Daniel Jakimenko-Aleksejev 
# Please include the string:  [perl #130505]
# in the subject line of all future correspondence about this issue. 
# https://rt.perl.org/Ticket/Display.html?id=130505 >


Code:
BEGIN (1, 2)[*-1]

Result:
===SORRY!=== Error while compiling 
An exception occurred while evaluating a BEGIN
at :1
Exception details:
  ===SORRY!=== Error while compiling 
  Cannot invoke this object (REPR: Null; VMNull)
  at :


Once is enough, especially given that it says “at : ” which is not useful.


[perl #130503] Hyper method call of AT-KEY/AT-POS fails with empty arrays (my @x; say @x»[0])

2017-01-04 Thread via RT
# New Ticket Created by  Aleks-Daniel Jakimenko-Aleksejev 
# Please include the string:  [perl #130503]
# in the subject line of all future correspondence about this issue. 
# https://rt.perl.org/Ticket/Display.html?id=130503 >


Code:
my @x; say @x»[0]

Result:
This type (Scalar) does not support elems
  in block  at -e line 1


I think it should work (and should do nothing, as there are no elements in the 
array).




Here is an interesting thing. If you take, say, 2016.05 and try this:

Code:
my @x; dd @x; say @x»[0]

Result (2016.05):
Array @x = []
()


It works! But if you remove dd:

Code:
my @x; say @x»[0]

Result:
This type (Scalar) does not support elems
  in block  at /tmp/DPLGku74eh line 1


So it worked with dd, but didn't work without it. Weird. Anyway, this detail is 
probably not relevant anymore.


[perl #130502] [LTA] error message complains too much about Metamodel.nqp (Buf.new('0'))

2017-01-04 Thread via RT
# New Ticket Created by  Aleks-Daniel Jakimenko-Aleksejev 
# Please include the string:  [perl #130502]
# in the subject line of all future correspondence about this issue. 
# https://rt.perl.org/Ticket/Display.html?id=130502 >


Code:
say Buf.new('0')

Result:
Type check failed in initializing element #0 to Buf; expected uint8 but got Str 
("0")
  in any  at gen/moar/Metamodel.nqp line 1727
  in block  at /tmp/9PmeQTevmg line 1

Actually thrown at:
  in any  at gen/moar/Metamodel.nqp line 3072
  in any  at gen/moar/Metamodel.nqp line 1727
in block  at /tmp/9PmeQTevmg line 1



It points three times to a line in Metamodel.nqp, and only once to the actual 
user file. Perhaps there is a way to improve it? Maybe not just for this case, 
but for any exception?


[perl #130501] augment on enums

2017-01-04 Thread via RT
# New Ticket Created by  Wenzel Peppmeyer 
# Please include the string:  [perl #130501]
# in the subject line of all future correspondence about this issue. 
# https://rt.perl.org/Ticket/Display.html?id=130501 >


use MONKEY-TYPING; augment class Bool { method m { say 'oi‽' } }; (1 < 2).m

# It's at least ENOSPEC and ENODOC and may be a undesired side effect of
# leaking Rakudo internals.
# It's a little confusing that `augment enum` doesn't work, because it
# works for role, class and slang.
# please update: https://github.com/perl6/doc/issues/1115
# please update: https://github.com/perl6/roast/issues/214


[perl #130498] [BUG] roundrobin doesn't work as expected on arrays

2017-01-04 Thread Zoffix Znet via RT
per jnthn++ https://irclog.perlgeek.de/perl6-dev/2017-01-04#i_13854591

Turns out this is not a bug, but a consequence of arrays itemizing their 
contents. You can still use the array, but you need to ».list on it it to 
de-itemize the contents; same with `zip`:

 m: my @l = (0,1,2),(3,4,5),(6,7); say zip @l».list.Slip;
 rakudo-moar 40d7de: OUTPUT«((0 3 6) (1 4 7))␤»
 m: my @l = (0,1,2),(3,4,5),(6,7); say roundrobin @l».list.Slip;
 rakudo-moar 40d7de: OUTPUT«((0 3 6) (1 4 7) (2 5))␤»


[perl #130498] [BUG] roundrobin doesn't work as expected on arrays

2017-01-04 Thread Zoffix Znet via RT
On IRC I said this was a bug, because the behaviour seemed so surprising, but 
now that I made a fix for it (diff attached), I find breakage in 
t/spec/S03-metaops/zip.t and t/spec/S32-container/roundrobin.t that test for 
what I see is a contradictory (to this ticket) behaviour for RT#126522.

Basically roundrobin, zip, and a few others aren't meant to treat itemized 
lists as lists and instead treat them as a single item. This is why the 
behaviour in this ticket is observed: array's elements are itemized and so get 
treated differently.

So this is just a pitfall of sorts and isn't a bug?

diff --git a/src/core/List.pm b/src/core/List.pm
index 4edd254..172009b 100644
--- a/src/core/List.pm
+++ b/src/core/List.pm
@@ -1593,14 +1593,14 @@ multi sub infix:(+lol) {
 return Seq.new(Rakudo::Internals.EmptyIterator) if $arity == 0;
 eager my @l = (^$arity).map: -> $i {
 my \elem = lol[$i];
-if nqp::iscont(elem) {
-$laze = False;
-Rakudo::Internals.WhateverIterator((elem,))
-}
-else {
+if nqp::istype(elem, Iterable) {
 $laze = False unless elem.is-lazy;
 Rakudo::Internals.WhateverIterator(elem)
 }
+else {
+$laze = False;
+Rakudo::Internals.WhateverIterator((elem,))
+}
 }
 
 gather {
@@ -1622,13 +1622,13 @@ my  := :;
 sub roundrobin(**@lol is raw) {
 my $laze = False;
 my @iters = do for @lol -> \elem {
-if nqp::iscont(elem) {
-(elem,).iterator
-}
-else {
+if nqp::istype(elem, Iterable) {
 $laze = True if elem.is-lazy;
 elem.iterator
 }
+else {
+(elem,).iterator
+}
 }
 gather {
 while @iters {


[perl #130500] [LTA] Download Page on Rakudo.org

2017-01-04 Thread via RT
# New Ticket Created by  Zoffix Znet 
# Please include the string:  [perl #130500]
# in the subject line of all future correspondence about this issue. 
# https://rt.perl.org/Ticket/Display.html?id=130500 >


See https://irclog.perlgeek.de/perl6-dev/2017-01-04#i_13854039

We had a user who's using rakudobrew because from the download page they 
thought that's the easiest way to use Perl 6.

We probably should download Rakudobrew and promote Rakudo Star more (see also 
stmuk's comments in that log that having two lists of instructions on 
rakudo.org and perl6.org is just doubling the workload)


[perl #130498] [BUG] roundrobin doesn't work as expected on arrays

2017-01-04 Thread via RT
# New Ticket Created by  Michael Schaap 
# Please include the string:  [perl #130498]
# in the subject line of all future correspondence about this issue. 
# https://rt.perl.org/Ticket/Display.html?id=130498 >


 my @l = (0,1,2),(3,4,5),(6,7);
 say roundrobin(|@l);

outputs

 (((0 1 2) (3 4 5) (6 7)))

instead of the expected

 ((0 3 6) (1 4 7) (2 5))

The following *does* work:

 my $l = ((1,2,3),(4,5,6),(7,8));
 say roundrobin(|$l);

Note that zip (the function) has the same issue, but Z (the operator) 
does not:

 my @l = (0,1,2),(3,4,5),(6,7);
 my $l = ((0,1,2),(3,4,5),(6,7));
 say zip(|@l);
 say zip(|$l);
 say [Z] @l;
 say [Z] $l;

outputs:

 (((0 1 2) (3 4 5) (6 7)))
 ((0 3 6) (1 4 7))
 ((0 3 6) (1 4 7))
 ((0 3 6) (1 4 7))

Unfortunately, there is no operator for roundrobin (right?) that I can 
use as a workaround.

Latest Rakudo Star:

This is Rakudo version 2016.11 built on MoarVM version 2016.11
implementing Perl 6.c.


[perl #127863] [BUG] MixHash not cloning properly

2017-01-04 Thread Zoffix Znet via RT
On Fri, 08 Apr 2016 14:45:30 -0700, grond...@yahoo.fr wrote:
> IRC extract from today:
> 
> 23:35 < grondilu> m: my MixHash $a .= new; my MixHash $b = $a.clone;
> $a++; dd $b;
> 23:35 <+camelia> rakudo-moar 40a953: OUTPUT«MixHash $b =
> ("foo"=>1).MixHash␤»

Thank you for the report. This is now fixed.

Fix: https://github.com/rakudo/rakudo/commit/1ee9c825f8
Tests: https://github.com/perl6/roast/commit/37b3e121bb