[perl #85750] Test failures on OpenBSD

2014-10-02 Thread Carl Mäsak via RT
bartolin masak: S03-operators/arith.t mentions 
http://mathworld.wolfram.com/Indeterminate.html, as I understand it this argues 
in favour of 1 ** Inf == NaN
masak bartolin: sure, I'm already concinced that *math* makes the argument 
for 1 ** Inf == NaN.
masak but IEEE 754 deviates from math in some places where it finds doing so 
convenient in a computing environment.
masak for example, 0 ** 0
masak m: say 0 ** 0
camelia rakudo-moar d60a8f: OUTPUT«1␤»
masak m: say Inf ** 0
camelia rakudo-moar d60a8f: OUTPUT«1␤»
bartolin ok, just wanted to note the link 
masak bartolin: yes -- thank you.
masak bartolin: adding to ticket.



[perl #122746] [BUG] Stringification of AST parameter not captured properly in postfix macro in Rakudo

2014-10-02 Thread Carl Mäsak via RT
masak ():
 masak m: macro postfix:!!($o) { quasi { die Null check failed for
 , $o.Str unless defined {{{$o}}}; {{{$o}}} } }; say 42!!; my
 $cookies; my $food = $cookies!!
 16:18 +camelia rakudo-moar 51ddd5: OUTPUT«42␤Null check failed for ␤
  in any [...]»
 masak so close.
 * masak submits rakudobug
 masak (it should capture the string '$cookies' in $o.Str, IMO)
 masak that is, the error message shoulda been 'Null check failed for
 $cookies'

This works now, thanks for moritz++.

$ cat RT-122746-code
macro postfix:!!($o) {
quasi {
die Null check failed for , $o.Str
unless defined {{{$o}}};
{{{$o}}}
}
}

say 42!!;

my $cookies;
my $food = $cookies!!
masak@siddharta ~/mine/macro-grant $ perl6 RT-122746-code
42
Null check failed for $cookies
  in any  at RT-122746-code:3
  in block unit at RT-122746-code:12

Marking ticket as testneeded.


[perl #111964] [BUG] LTA error message when passing an Int argument to base conversion in Rakudo

2014-10-02 Thread Christian Bartolomaeus via RT
The error message now hopefully is adequat:

 my $x=31; say :8($x)
You have confused the number 31 with the textual representation 31;
if you wanted to render the number in the given base, use $number.base($radix)
  in block unit at unknown file:1

There is a test for the correct exception type (X::Numeric::Confused) in 
S02-literals/radix.t 


[perl #122882] [BUG] Symmetric set difference (^) doesn't right-associate or chain in Rakudo

2014-10-02 Thread Carl Mäsak via RT
lizmat $ 6 'say a network (^) b network (^) a network'
lizmat set(b)
lizmat #122882 can be marked as TEST NEEDED :-)

Marked as testneeded.


state and = vs :=

2014-10-02 Thread Father Chrysostomos
Does ‘state’ govern ‘:=’ the way it governs ‘=’?  In other words, just as this:

state $x = 1;

only assigns to $x once (per closure), does the same apply to this?

state $x := $y;

I can’t find anything in the specs that implies that it does.

The reason I ask is that I am currently implementing binding for Perl 5, but 
the syntax is different—

\$x = \$y;

(The reason for the different syntax is that, when we tried to use :=, we could 
not find a coherent way to handle edge cases [e.g., flattening vs not 
flattening].  Reusing existing Perl 5 syntax seemed the most straightforward 
and intuitive approach.)

—and I am debating whether \state $x = \$y should bind only once or every time 
the surrounding code is executed.  I could argue it either way (though I am 
leaning toward the latter), so I thought to find out what Perl 6 does.



[perl6/specs] f11c62: Add inner link for Adverbial Pair forms

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

  Changed paths:
M S02-bits.pod

  Log Message:
  ---
  Add inner link for Adverbial Pair forms




[perl #122879] REPL broken on Parrot

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


The REPL of Rakudo 2014.09 on Parrot doesn't show the prompt anymore, and if 
it is given any input (even an empty line), it exits with the following 
message:

seek failed: -1
current instr.: '' pc 26739 (gen/parrot/stage2/NQPHLL.pir:10264) 
(gen/parrot/stage2/NQPHLL.nqp:1084)
called from Sub 'interactive' pc 26661 (gen/parrot/stage2/NQPHLL.pir:10227) 
(gen/parrot/stage2/NQPHLL.nqp:1082)
called from Sub 'command_eval' pc 29765 (gen/parrot/stage2/NQPHLL.pir:11523) 
(gen/parrot/stage2/NQPHLL.nqp:1297)
called from Sub 'command_eval' pc 355 (src/gen/perl6-compiler.pir:186) 
(src/Perl6/Compiler.nqp:17)
called from Sub 'command_line' pc 28643 (gen/parrot/stage2/NQPHLL.pir:11077) 
(gen/parrot/stage2/NQPHLL.nqp:1245)
called from Sub 'MAIN' pc 350 (src/gen/perl6.pir:129) (gen/parrot/main.nqp:39)
called from Sub 'mainline' pc 317 (src/gen/perl6.pir:111) 
(gen/parrot/main.nqp:31)
called from Sub '' pc 1222 (src/gen/perl6.pir:438) (gen/parrot/main.nqp:55)

Running scripts non-interactively still appears to work, and the MoarVM 
backend is not affected at all.


[perl6/specs] e83a75: Remove SEQ() fossil

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

  Changed paths:
M S02-bits.pod

  Log Message:
  ---
  Remove SEQ() fossil

This appears to be an implementation specific rakudo thing nowadays




[perl6/specs] 66edfb: adding missing =over

2014-10-02 Thread GitHub
  Branch: refs/heads/master
  Home:   https://github.com/perl6/specs
  Commit: 66edfbe68aef73cf34482e8f8a7508f51c3de087
  
https://github.com/perl6/specs/commit/66edfbe68aef73cf34482e8f8a7508f51c3de087
  Author: L. Grondin grond...@yahoo.fr
  Date:   2014-10-01 (Wed, 01 Oct 2014)

  Changed paths:
M S32-setting-library/IO.pod

  Log Message:
  ---
  adding missing =over




[perl #122839] Rakudo* 2014:08 panda doesn't see bundled modules

2014-10-02 Thread Tobias Leich via RT
what is your panda --installed list?


[perl6/specs] b89831: fix minor syntax error

2014-10-02 Thread GitHub
  Branch: refs/heads/master
  Home:   https://github.com/perl6/specs
  Commit: b89831bcc08db79b28a430a5a5f334a286ff735e
  
https://github.com/perl6/specs/commit/b89831bcc08db79b28a430a5a5f334a286ff735e
  Author: L. Grondin grond...@yahoo.fr
  Date:   2014-10-01 (Wed, 01 Oct 2014)

  Changed paths:
M S32-setting-library/IO.pod

  Log Message:
  ---
  fix minor syntax error




[perl6/specs] aadf05: Make anonymous variables silent in all contexts

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

  Changed paths:
M S02-bits.pod

  Log Message:
  ---
  Make anonymous variables silent in all contexts

If you're actually specifying something like ($a, $, $b) in your code, you
expect the 2nd value to drop on the floor.  So why warn about that at all?
Assuming that's what will result in the message: means.




[perl #122882] [BUG] Symmetric set difference (^) doesn't right-associate or chain in Rakudo

2014-10-02 Thread Patrick R. Michaud via RT
Added tests in roast/S03-operators/set.t, marking ticket resolved.

Pm


Re: state and = vs :=

2014-10-02 Thread Elizabeth Mattijsen
On 01 Oct 2014, at 07:48, Father Chrysostomos spr...@cpan.org wrote:
 Does ‘state’ govern ‘:=’ the way it governs ‘=’?  In other words, just as 
 this:
 
state $x = 1;
 
 only assigns to $x once (per closure), does the same apply to this?
 
state $x := $y;
 
 I can’t find anything in the specs that implies that it does.
 
 The reason I ask is that I am currently implementing binding for Perl 5, but 
 the syntax is different—
 
\$x = \$y;
 
 (The reason for the different syntax is that, when we tried to use :=, we 
 could not find a coherent way to handle edge cases [e.g., flattening vs not 
 flattening].  Reusing existing Perl 5 syntax seemed the most straightforward 
 and intuitive approach.)
 
 —and I am debating whether \state $x = \$y should bind only once or every 
 time the surrounding code is executed.  I could argue it either way (though I 
 am leaning toward the latter), so I thought to find out what Perl 6 does.

It would seem that binding state variables will be something that will be 
prohibited in Perl 6, until such time we find a good use case for it.


[15:55:36] lizmat  well, all of this was because of a question of Father 
Chrysostomos (a very productive p5p contributor) on p6l
[15:57:01] jnthn   OK. Well, I'll leave it at, I'm happy enough with the 
current semantics, so unless TimToady++ feels they have to chnage, then I'm not 
inclined to do much about the status quo.
[15:57:44] jnthn   (Where by the current semantics I mean, what Moar 
does, and I'm about certain what we do on JVM. I don't actually know how things 
are on Parrot.)
[15:57:59] lizmat  eh, but the current semantics silently do the wrong 
thing, no ?
[15:59:11] jnthn   lizmat: Depends how you define the semantics of state.
[15:59:44] jnthn   lizmat: Note that if you go binding a temp or let var 
you are in equal trouble.
[16:00:03] moritzwouldn't mind compile-time disallowing rebinding 
temp/let/state vars
[16:00:05] jnthn   'cus those are certainly about value, not container
[16:00:14] lizmat moritz +1
[16:00:18] jnthn   I took state to be wanting the same semantics
[16:00:31] jnthn   Yeah, I could go with a conservative approach of just 
disallow it
[16:00:53] lizmat  I'll answer FC


Hope this answer your question,


Liz

Re: state and = vs :=

2014-10-02 Thread Jonathan Worthington

On 10/2/2014 16:03, Elizabeth Mattijsen wrote:

On 01 Oct 2014, at 07:48, Father Chrysostomos spr...@cpan.org wrote:

Does ‘state’ govern ‘:=’ the way it governs ‘=’?  In other words, just as this:

state $x = 1;

only assigns to $x once (per closure), does the same apply to this?

state $x := $y;

I can’t find anything in the specs that implies that it does.

The reason I ask is that I am currently implementing binding for Perl 5, but 
the syntax is different—

\$x = \$y;

(The reason for the different syntax is that, when we tried to use :=, we could 
not find a coherent way to handle edge cases [e.g., flattening vs not 
flattening].  Reusing existing Perl 5 syntax seemed the most straightforward 
and intuitive approach.)

—and I am debating whether \state $x = \$y should bind only once or every time 
the surrounding code is executed.  I could argue it either way (though I am 
leaning toward the latter), so I thought to find out what Perl 6 does.

It would seem that binding state variables will be something that will be 
prohibited in Perl 6, until such time we find a good use case for it.


[15:55:36] lizmatwell, all of this was because of a question of 
Father Chrysostomos (a very productive p5p contributor) on p6l
[15:57:01] jnthn OK. Well, I'll leave it at, I'm happy enough with 
the current semantics, so unless TimToady++ feels they have to chnage, then I'm not 
inclined to do much about the status quo.
[15:57:44] jnthn (Where by the current semantics I mean, what Moar 
does, and I'm about certain what we do on JVM. I don't actually know how things are on Parrot.)
[15:57:59] lizmateh, but the current semantics silently do the wrong 
thing, no ?
[15:59:11] jnthn lizmat: Depends how you define the semantics of 
state.
[15:59:44] jnthn lizmat: Note that if you go binding a temp or let 
var you are in equal trouble.
[16:00:03] moritzwouldn't mind compile-time disallowing rebinding 
temp/let/state vars
[16:00:05] jnthn 'cus those are certainly about value, not container
[16:00:14] lizmat   moritz +1
[16:00:18] jnthn I took state to be wanting the same semantics
[16:00:31] jnthn Yeah, I could go with a conservative approach of just 
disallow it
[16:00:53] lizmatI'll answer FC

To expand a little, all of state/temp/let are implemented under the 
assumption that you'll be doing assignment to the container you applied 
them to. That is, when I:


temp $x;

Then I'm really saying stash away a pair (the-cont = $x, current-value 
= the value in $x), and at block LEAVE time then do the-cont = 
old-value. It's the same container throughout, and if you re-bind $x 
then temp has no clue about it. For state, containers are created at 
first entry to a given closure clone, stashed away in the closure's code 
object, and those same containers are used in the frames (specifically, 
lexical storage) of future invocations of the same closure.


Generally in Perl 6, binding is a quite low-level operation. An operation:

$x := $y;

Might be JITted to just a couple of instructions (perhaps even if $x has 
a static type constraint that needs checking, since type specialization 
might prove the check isn't needed). Binding can be understood as 
directly replacing the contents of a slot (that is, just setting a 
pointer), and has no effect on any container that used to be there. 
Since state is implemented by keeping another reference to the container 
in the closure's code object, re-binding a state variable in a call 
frame will have no effect beyond the lifetime of that frame:


 sub foo() { state $x = 42; say $x++; $x := 99; say $x; }; foo() 
for ^5

42
99
43
99
44
99
45
99
46
99

It's also worth noting that:

state $x = 42;

And a later:

$x = 42;

Are parsed rather differently. The same goes for := and ::=. The former 
kind of construct is parsed as a declarator with an initializer; the 
latter is parsed as the familiar infix operators. Curiously, since we 
figure out what to do by declarator scope (so a different code-path for 
state than my), it turns out that := and ::= initializers on a state var 
are completely ignored at present.


I suspect instead of ignoring them, we'll go down to line of giving an 
error on:


state $x := something;

...because it's hard to imagine it being anything except programmer 
error. That is, unless Larry comes along and declares that state should 
have got save what's in the lexpad back to the per-closure storage at 
scope exit semantics, in which case it would do something arguably 
useful...and increase the cost of state vars, frustrate inlining (in a 
perhaps fixable way), and make something once immutable become 
mutable...you might imagine I'm hoping we don't go this way. :-)


But to answer the original question, if we *do* end up doing something 
that runs code in a state $x := ... rather than complain about it, 

[perl #122842] segfault with moar with specific PERL6LIB and running a specific test file

2014-10-02 Thread Christian Bartolomaeus via RT
This was fixed in MoarVM today (cmp. 
http://irclog.perlgeek.de/perl6/2014-10-02#i_9446636 and 
http://irclog.perlgeek.de/perl6/2014-10-02#i_9447562).