[perl #119121] [BUG] Heredoc indented with a tab doesn't de-indent properly in Rakudo

2014-10-17 Thread Christian Bartolomaeus via RT
I'm closing this ticket since this works now and there are tests in 
S02-literals/heredocs.t (cmp. commit 
https://github.com/perl6/roast/commit/978e4a8ac166821ab18a8c02c906063b6e489dd6)

$ perl6 -e 'say (EVAL q:to/E/;\n\tfoo\n\tbar\n\tE) eq foo\nbar\n'
True

$ perl6 -e 'say (EVAL q:to/E/;\n\tfoo\n\tbar\nE) eq \tfoo\n\tbar\n'
True



[perl #120831] [BUG] LTA error message when declaring 'my Int a' in Rakudo

2014-10-17 Thread Christian Bartolomaeus via RT
Since the current error message looks reasonable to me (though different from 
STD's) I went ahead and added a test to S32-exceptions/misc.t with the 
following commit: https://github.com/perl6/roast/commit/5265f7d69e

But: The new error message only happens with my Int a;. Without the semicolon 
we get the old error message.

$ perl6-m -e 'my Int a;'
===SORRY!=== Error while compiling -e
Malformed my (did you mean to declare a sigilless \a or $a?)
at -e:1
-- my Int a⏏;

$ perl6-m -e 'my Int a'
===SORRY!===
Type 'Int' is not declared. Did you mean 'int'?
at -e:1
-- my Int ⏏a
Malformed my
at -e:1
-- my Int ⏏a
expecting any of:
scoped declarator

$ viv -c -e 'my Int a;'
===SORRY!===
Multiple prefix constraints not yet supported at (eval) line 1:
-- my Int ⏏a;
Malformed my at (eval) line 1:
-- my Int ⏏a;
expecting any of:
multi_declarator
typename
Parse failed

$ viv -c -e 'my Int a'
===SORRY!===
Multiple prefix constraints not yet supported at (eval) line 1:
-- my Int ⏏a
Malformed my at (eval) line 1:
-- my Int ⏏a
expecting any of:
multi_declarator
typename
Parse failed



[perl #120232] [BUG] sprintf doesn't format %floats with many significant digits properly

2014-10-17 Thread Christian Bartolomaeus via RT
This works for Moar, Parrot and JVM:

$ perl6 -e 'printf(%.50f, 1.115)'
1.115000

I added a test to S32-str/sprintf.t with the following commit: 
https://github.com/perl6/roast/commit/46ef5bf0e9. I'm closing the ticket.


[perl #120397] [BUG] Segfault (Moar, JVM) and Null PMC access (Parrot) when assigning to a variable declared in a subsignature in a variable declaration in Rakudo

2014-10-17 Thread Christian Bartolomaeus via RT
Status update: Right now this is no longer a Null PMC access error on Parrot 
but we get a segfault on Moar as well:

$ perl6-m -e 'my $a ($b, $c); $b = 42;'
Segmentation fault

$ perl6-p -e 'my $a ($b, $c); $b = 42;'
Cannot assign to an immutable value
  in block unit at -e:1

$ perl6-j -e 'my $a ($b, $c); $b = 42;'
java.lang.NullPointerException
  in block unit at -e:1



[perl #120380] [BUG] Something is extremely slow with a look with string concat in Rakudo on the JVM

2014-10-17 Thread Christian Bartolomaeus via RT
To me it looks like the loop and the string concat are okay-ish (this is on a 
not too beefy machine (i3 3.33 GHz, 8 GiB RAM):

$ perl6-m -e 'my $file = ; for ^2 {$file ~= $_;};'

real0m0.500s
user0m0.436s
sys 0m0.060s

$ perl6-p -e 'my $file = ; for ^2 {$file ~= $_;};'

real0m1.717s
user0m1.588s
sys 0m0.116s

$ perl6-j -e 'my $file = ; for ^2 {$file ~= $_;};'

real0m10.312s
user0m19.917s
sys 0m0.352s

The smartmatch makes it somewhat slower (but much slower for parrot):

$ perl6-m -e 'my $file = ; for ^2 {$file ~= $_;}; $file ~~ /(\d+) +% 
;/;'

real0m1.210s
user0m1.140s
sys 0m0.064s

$ perl6-p -e 'my $file = ; for ^2 {$file ~= $_;}; $file ~~ /(\d+) +% 
;/;'

real0m12.436s
user0m12.141s
sys 0m0.240s

$ perl6-j -e 'my $file = ; for ^2 {$file ~= $_;}; $file ~~ /(\d+) +% 
;/;'

real0m13.147s
user0m25.122s
sys 0m0.428s

And now with say (STDOUT redirected to files, which have 20002 lines each) 
which makes it significantly slower:

$ perl6-m -e 'my $file = ; for ^2 {$file ~= $_;}; say $file ~~ /(\d+) 
+% ;/;'  foo1

real0m20.079s
user0m19.217s
sys 0m0.776s

$ perl6-p -e 'my $file = ; for ^2 {$file ~= $_;}; say $file ~~ /(\d+) 
+% ;/;'  foo2

real1m58.058s
user1m56.899s
sys 0m0.328s

$ perl6-j -e 'my $file = ; for ^2 {$file ~= $_;}; say $file ~~ /(\d+) 
+% ;/;'  foo3

real0m38.323s
user0m59.948s
sys 0m0.536s

All in all I'd say that's reasonable for the time being. (Especially the times 
with JVM are nowhere near 4 minutes.) If you disagree, please reopen the ticket.


[perl #120529] [BUG] qx// and run() do not respect %*ENV change in rakudo-parrot

2014-10-17 Thread Christian Bartolomaeus via RT
This works fine with Moar and JVM, but is still an issue with Parrot:

$ perl6-m -e '%*ENVENV_TEST=foo; say qx/env/ ~~ /ENV_TEST/'   ## same 
result with perl6-j
「ENV_TEST」

$ perl6-p -e '%*ENVENV_TEST=foo; say qx/env/ ~~ /ENV_TEST/'
Nil

I added a test (fudged 'todo' for Parrot) to S02-literals/quoting.t with the 
following commit: https://github.com/perl6/roast/commit/a3b0edce25


[perl #120838] [BUG] LTA error message (on JVM) when passing something to named parameter :$b($c)

2014-10-17 Thread Christian Bartolomaeus via RT
Status update: It looks like STD's opinion on this has changed:

$ viv -c -e 'sub a (:$b($c)) {say $c}; a(:bfoo)'
===SORRY!===
Subsignature not allowed after named parameter; please insert whitespace at 
(eval) line 1:
-- sub a (:$b⏏($c)) {say $c}; a(:bfoo)
Parse failed

Rakudo's error messages are different though:

$ perl6-m -e 'sub a (:$b($c)) {say $c}; a(:bfoo)'
Too few positionals passed; expected 1 argument but got 0 in sub-signature of 
parameter $b
  in sub a at -e:1
  in block unit at -e:1

$ perl6-p -e 'sub a (:$b($c)) {say $c}; a(:bfoo)'
Not enough positional parameters passed; got 0 but expected 1 in sub-signature 
of parameter $b
  in sub a at -e:1
  in block unit at -e:1

$ perl6-j -e 'sub a (:$b($c)) {say $c}; a(:bfoo)'
Flattening named argument must have VMHash REPR
  in sub a at -e:1
  in block unit at -e:1



[perl #120919] [BUG] Private methods in roles don't bind 'self' correctly in Rakudo

2014-10-17 Thread Christian Bartolomaeus via RT
This works on Moar but fails on Parrot and JVM:

$ perl6-m -e 'role A { method pub { self!priv }; method !priv () { say OH HAI 
} }; class C does A { }; C.new.pub;'
OH HAI

$ perl6-p -e 'role A { method pub { self!priv }; method !priv () { say OH HAI 
} }; class C does A { }; C.new.pub;'
Cannot type check against type variable $?CLASS
  in any type_check at gen/parrot/Metamodel.nqp:297
  in block  at gen/parrot/CORE.setting:963
  in method BUILDALL at gen/parrot/CORE.setting:946
  in method bless at gen/parrot/CORE.setting:935
  in method new at gen/parrot/CORE.setting:920
  in method new at gen/parrot/CORE.setting:918
  in method priv at -e:1
  in method pub at -e:1
  in block unit at -e:1

$ perl6-j -e 'role A { method pub { self!priv }; method !priv () { say OH HAI 
} }; class C does A { }; C.new.pub;'
Cannot type check against type variable $?CLASS
  in any type_check at gen/jvm/Metamodel.nqp:297
  in block  at gen/jvm/CORE.setting:949
  in method BUILDALL at gen/jvm/CORE.setting:932
  in method bless at gen/jvm/CORE.setting:921
  in method new at gen/jvm/CORE.setting:905
  in method priv at -e:1
  in method pub at -e:1
  in block unit at -e:1

I added a test (skipped for Parrot and JVM) to S14-roles/basic.t with the 
following commit: https://github.com/perl6/roast/commit/8942c27ab2


[perl #120931] [BUG] Infinite recursion when calling a role method from within the role block in Rakudo

2014-10-17 Thread Christian Bartolomaeus via RT
This works now:

$ perl6-m -e 'role R { method foo {}; R.foo }; say alive'
alive

$ perl6-p -e 'role R { method foo {}; R.foo }; say alive'
alive

$ perl6-j -e 'role R { method foo {}; R.foo }; say alive'
alive

I added a test to  S14-roles/basic.t with the following commit: 
https://github.com/perl6/roast/commit/195e181557. I'm closing this ticket now.


Re: [perl #99658] sequence operator '...' timeout

2014-10-17 Thread Parrot Raiser
Wouldn't 1,3,5,7 be a more reasonable result? The next value, 9 is
greater than the end term, so it should stop?

On 10/16/14, Carl Mäsak via RT perl6-bugs-follo...@perl.org wrote:
 bartolin ():
 Actually I don't think S03 says that '1,3,5 ... 8' should act as
 '1,3,5 ... *'

 As I understand it '1,3,5 ... 8' gives an infinite list with all even
 numbers. '1,3,5 ... *' also gives an infinite list with all even
 numbers -- but this one is lazy.

 So there is a difference in behaviour: When assigning to an array with
 'my @odd = 1,3,5 ... 8;' all elements of the sequence have to be
 computed and smart matched agains '8'. This match never results in
 True and therefore we get a timeout, finally. In the other case ('my
 @odd = 1,3,5 ... *') the sequence has no limit (quote from S03) and
 the assignment can be lazy e.g. the values don't have to be computed
 and smart matched against something.

 I think this reasoning is sound, and whereas it would be awesome if we could
 always read the mind of the user and not get stuck in infinite loops trying
 to compute infinite sequences -- the place we are is kind of a local minimum
 and has an internal consistency.

 That is, we could perhaps do better in the future, and not hang on this one.
 But it's not clear to me how to do that without making the current model
 more complex for relatively little gain.

 Rejecting ticket.



[perl6/specs] a6c0bb: Add mkpath()

2014-10-17 Thread GitHub
  Branch: refs/heads/master
  Home:   https://github.com/perl6/specs
  Commit: a6c0bb79fb089b41497d80c55c7d71da115bb10a
  
https://github.com/perl6/specs/commit/a6c0bb79fb089b41497d80c55c7d71da115bb10a
  Author: Elizabeth Mattijsen l...@dijkmat.nl
  Date:   2014-10-17 (Fri, 17 Oct 2014)

  Changed paths:
M S16-io.pod

  Log Message:
  ---
  Add mkpath()




[perl #123002] [BUG] NullPointerException when calling a sub which runs EVAL on minimal role declaration

2014-10-17 Thread via RT
# New Ticket Created by  Christian Bartolomaeus 
# Please include the string:  [perl #123002]
# in the subject line of all future correspondence about this issue. 
# URL: https://rt.perl.org/Ticket/Display.html?id=123002 


I got a NullPointerException with a golfed version of a failing test from roast 
(test for RT #114380 in S14-roles/basic.t). The test in question uses 
eval_lives_ok which does something similiar to the golfed example via 
Test.pm. The test in question runs fine with lives_ok instead of 
eval_lives_ok

$ perl6-j --version
This is perl6 version 2014.09-222-g0dcd0d6 built on JVM

$ perl6-j -e sub foo { EVAL 'role R { }' }; foo; say 'alive'
===SORRY!===
java.lang.NullPointerException

Using EVAL on the role declaration directly doesn't fail:

$ perl6-j -e EVAL 'role R { }'; say 'alive'
alive

With the help from psch (http://irclog.perlgeek.de/perl6/2014-10-17#i_9527240) 
I tried to get some more info with jdb, but everything I got was:


$ jdb -sourcepath nqp/src/vpathm/jvm/runtime/ -attach 8000
Set uncaught java.lang.Throwable
Set deferred uncaught java.lang.Throwable
Initializing jdb ...
 
VM Started: No frames on the current call stack

main[1] catch java.lang.NullPointerException
Set all java.lang.NullPointerException
main[1] run
 
Exception occurred: java.lang.NullPointerException (to be caught at: 
64411D3B4B0DBD5895A2F295CC3F75570C8D73C2.qb_54(), line=1,497 
bci=2,686)thread=main, org.perl6.nqp.runtime.Ops.getobjsc(), line=3,811 bci=1

main[1] up
main[2] list
Source file not found: src/Perl6/World.nqp
main[2] resume
All threads resumed.
 
The application exited


Additional informations where available with --ll-exception:


$ perl6-j --ll-exception -e sub foo { EVAL 'role R { }' }; foo;
java.lang.NullPointerException
  in compile_in_context (src/Perl6/World.nqp:1497)
  in pkg_set_role_body_block (src/Perl6/World.nqp:1745)
  in package_def (src/Perl6/Actions.nqp:1953)
  in !reduce (gen/jvm/stage2/QRegex.nqp:771)
  in !cursor_pass (gen/jvm/stage2/QRegex.nqp:732)
  in package_def (src/Perl6/Grammar.nqp:2395)
  in package_declarator:symrole (src/Perl6/Grammar.nqp)
  in !protoregex (gen/jvm/stage2/QRegex.nqp:808)
  in package_declarator (src/Perl6/Grammar.nqp)
  in term:sympackage_declarator (src/Perl6/Grammar.nqp)
  in !protoregex (gen/jvm/stage2/QRegex.nqp:808)
  in term (src/Perl6/Grammar.nqp)
  in termish (src/Perl6/Grammar.nqp:3557)
  in EXPR (gen/jvm/stage2/NQPHLL.nqp:558)
  in EXPR (src/Perl6/Grammar.nqp:3588)
  in statement (src/Perl6/Grammar.nqp:1300)
  in statementlist (src/Perl6/Grammar.nqp:1235)
  in LANG (gen/jvm/stage2/NQPHLL.nqp:766)
  in FOREIGN_LANG (src/Perl6/Grammar.nqp:1638)
  in comp_unit (src/Perl6/Grammar.nqp:1093)
  in TOP (src/Perl6/Grammar.nqp:356)
  in parse (gen/jvm/stage2/QRegex.nqp:1400)
  in parse (gen/jvm/stage2/NQPHLL.nqp:1425)
  in compile (gen/jvm/stage2/NQPHLL.nqp:1381)
  in EVAL (gen/jvm/CORE.setting:763)
  in EVAL (gen/jvm/CORE.setting:756)
  in foo (-e:1)
  in unit (-e:1)
  in unit-outer (-e:1)
  in eval (gen/jvm/stage2/NQPHLL.nqp:1145)
  in  (gen/jvm/stage2/NQPHLL.nqp:1234)
  in command_eval (gen/jvm/stage2/NQPHLL.nqp:1231)
  in command_eval (src/Perl6/Compiler.nqp:17)
  in command_line (gen/jvm/stage2/NQPHLL.nqp:1216)
  in MAIN (gen/jvm/main.nqp:39)
  in mainline (gen/jvm/main.nqp:35)
  in  (gen/jvm/main.nqp)



[perl #121802] Lazy series failure on jvm - prime example from 2012 advent day 14

2014-10-17 Thread Christian Bartolomaeus via RT
The tests are now passing on JVM. I unfudged them with the following commit: 
https://github.com/perl6/roast/commit/741b08ee70


[perl #121722] for 42 {NEXT (state $val) = $_} # fails on MOAR

2014-10-17 Thread Christian Bartolomaeus via RT
Hmm, it looks like that was not all -- or there is a new problem.

$ perl6-m -e 'for 42 {NEXT (state $val) = $_}; say alive'
alive

This does not fail any longer. But the tests in integration/advent2012-day15.t 
don't pass. I'd say the following command shows more:

$ perl6-m -e 'for 42 {NEXT (state $val) max= $_; LAST say last: , $val;}; say 
alive'
last: -Inf
alive

$ perl6-p -e 'for 42 {NEXT (state $val) max= $_; LAST say last: , $val;}; say 
alive'
alive

$ perl6-j -e 'for 42 {NEXT (state $val) max= $_; LAST say last: , $val;}; say 
alive'
last: 42
alive

On Parrot LAST does not fire, on Moar it fires but $val has a weird value, only 
on JVM it fires and $val is 42.





[perl #121149] [BUG] $*IN.get doesn't work on rakudo-jvm

2014-10-17 Thread Christian Bartolomaeus via RT
This works now:

$ cat hellow_world.txt
Hello world!
$ perl6-j -e 'say $*IN.get'  hello_world.txt
Hello world!

So this is closable with a test.