Moritz Lenz | 10 Feb 06:49
Picon
Favicon

[perl #110350] ranges of Num objects produce Ints in Rakudo

# New Ticket Created by  Moritz Lenz 
# Please include the string:  [perl #110350]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=110350 >

06:47 < moritz> nom: for 1e0 .. 1e0 { say .WHAT }
06:47 <+p6eval> nom 828e4d: OUTPUT«Int()␤»

Should be Num of course

Carl Mäsak | 7 Feb 22:20
Picon
Favicon

[perl #110096] [BUG] Internal Parrot error when declaring an attribute inside a sub inside a class in Rakudo

# New Ticket Created by  "Carl Mäsak" 
# Please include the string:  [perl #110096]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=110096 >

<moritz> nom: class A { sub f { has $.x } }
<p6eval> nom a0a467: OUTPUT«use of uninitialized value of type Mu in
string context␤use of uninitialized value of type Mu in string
context␤===SORRY!===␤error:imcc:syntax error, unexpected '\n'␤
in file '(file unknown)' line 488␤␤»
<moritz> wow :-)
<benabik> imcc syntax error?
<[Coke]> moritz++ #well played, sir.
* masak submits rakudobug

Carl Mäsak | 7 Feb 14:52
Picon
Favicon

[perl #110064] [BUG] Can't assign the returned list of values from .^methods to an array in Rakudo

# New Ticket Created by  "Carl Mäsak" 
# Please include the string:  [perl #110064]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=110064 >

<timotimo> nom: my @methods = { say "hello" }.^methods
<p6eval> nom 8c84b8: OUTPUT«Cannot assign a non-Perl 6 value to a Perl
6 container [...]
<masak> hm, that's a bug, I think.
<jnthn> Needs fixing in the BOOTS TRAP. Need to ponder exactly how...
<timotimo> it's interesting to me that there is a thing as a "non-Perl
6 value" in perl6 :)
* masak submits rakudobug

Carl Mäsak | 7 Feb 11:57
Picon
Favicon

[perl #110038] [BUG] ().pick returns empty list and ().roll returns Nil in Rakudo -- one of them is wrong

# New Ticket Created by  "Carl Mäsak" 
# Please include the string:  [perl #110038]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=110038 >

<moritz> nom: say ().pick.defined
<p6eval> nom 33fb02: OUTPUT«True␤»
<moritz> nom: say ().pick.perl
<p6eval> nom 33fb02: OUTPUT«().list␤»
<moritz> uhm
<moritz> shouldn't that return something like Nil?
<moritz> niecza: say ().pick.perl
<p6eval> niecza v14-20-g18249a6: OUTPUT«Any␤»
<moritz> or that
<masak> I think I can make a stronger case for Nil than for Any.
<masak> but it depends on how much a special case .pick() is compared
to .pick($n).
<moritz> perl6: say (1, 2).pick(3).perl
<p6eval> rakudo 33fb02, niecza v14-20-g18249a6: OUTPUT«(2, 1).list␤»
<p6eval> ..pugs b927740: OUTPUT«(1, 2)␤»
<moritz> perl6: say ().roll.perl
<p6eval> niecza v14-20-g18249a6: OUTPUT«Any␤»
<p6eval> ..rakudo 33fb02: OUTPUT«Nil␤»
<masak> nom: say ().pick.defined; say ().roll.defined
<p6eval> nom 33fb02: OUTPUT«True␤False␤»
<masak> yeah. not kosher.
* masak submits rakuodbug

Clearly, something is underspecified/incorrect in all this. .pick and
.roll should behave the same on empty lists, and there should be a
(Continue reading)

Carl Mäsak | 5 Feb 21:49
Picon
Favicon

[perl #109880] [BUG] Something is wrong with instantiation of generic roles and typed attributes in Rakudo

# New Ticket Created by  "Carl Mäsak" 
# Please include the string:  [perl #109880]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=109880 >

<masak> nom: role Foo[::T] { has T @.a = [T] }; class Bar {}; say
Foo[Bar].new.a[0]
<p6eval> nom a17736: OUTPUT«Cannot type check against type variable T [...]
<masak> jnthn: what's up with this?
<jnthn> hm
<jnthn> nom: my $r = role Foo[::T] { has T @.a }; $r.HOW.attributes($r).perl.say
<p6eval> nom 5a2c7d: OUTPUT«Method 'mro' not found for invocant of
class 'Perl6::Metamodel::ParametricRoleHOW' [...]
<jnthn> ...interesting.
<jnthn> nom: my $r = role Foo[::T] { has T @.a };
$r.HOW.attributes($r, :local).[0].type.HOW.archetypes.generic.say
<p6eval> nom 5a2c7d: OUTPUT«1␤»
<jnthn> Hm, that much is right then.
<jnthn> masak: Not sure without going for a deeper dig...some kind of
generic instantiation failure.
* masak submits rakudobug

Stephane Payrard | 5 Feb 18:50
Picon
Favicon

[perl #109874] BUG: should match: grammar A { rule TOP { ^ } }; say A.parse(' ')

# New Ticket Created by  Stephane Payrard 
# Please include the string:  [perl #109874]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=109874 >

> grammar A { rule TOP { ^  } }; say A.parse(' ')
#<failed match>
>

The relevant spec is probably S05:355

When you write

    rule TOP { ^ <stuff> $ }

this is the same as

    token TOP { ^ <.ws> <stuff> <.ws> $ <.ws> }

discussed with jonathan at http://irclog.perlgeek.de/perl6/2012-02-05#i_5106223

A test should probably added spec/S05-grammar/ws.t :

grammar A { rule TOP { ^  } };
ok ?A.parse(' '), 'no <.ws> shoved before ^';

--

-- 
cognominal stef

(Continue reading)

Carl Mäsak | 4 Feb 13:52
Picon
Favicon

[perl #109800] [BUG] Can't declare infix operators using 'my &infix:<sth>' syntax in Rakudo

# New Ticket Created by  "Carl Mäsak" 
# Please include the string:  [perl #109800]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=109800 >

<spine> perl6: my &infix:<c> = {$^a+$^b}; say 1 c 2;
<p6eval> niecza v14-11-gde9cc16: OUTPUT«3␤»
<p6eval> ..rakudo a47a56: OUTPUT«===SORRY!===␤Confused␤at /tmp/o_PnO5M2fr:1␤»
<spine> reading moritz' comments on my solution to t1 for the p6cc
just made me remember how sad i was about this not working in rakudo
<spine> made me do unnecessary double function calls :)
<jnthn> Hm, should that work...
<jnthn> std: my &infix:<c> = {$^a+$^b}; say 1 c 2;
<p6eval> std 48335fc: OUTPUT«ok 00:01 116m␤»
<jnthn> Hm, appears so.
<spine> well, I don't know the spec, but it would enable you to use
curryed functions as infix ops
<masak> it should definitely work.
* masak submits rakudobug
<masak> nom: sub infix:<c> { $^a + $^b }; say 1 c 2
<p6eval> nom a47a56: OUTPUT«3␤»

Carl Mäsak via RT | 3 Feb 15:24
Picon
Favicon

[perl #109740] [BUG] Four extra bits after +& operation in Rakudo

Francis (>):
> what is unary +^ I can only find binary +^ bitwise xor

See S03:677. It's numeric bitwise addition.

Carl Mäsak | 3 Feb 14:54
Picon
Favicon

[perl #109740] [BUG] Four extra bits after +& operation in Rakudo

# New Ticket Created by  "Carl Mäsak" 
# Please include the string:  [perl #109740]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=109740 >

<grondilu> nom: my ($x, $y) = (2**30, 1); printf "%32b\n", +^$x +& $y;
<p6eval> nom acbec8:
OUTPUT«1111000000000000000000000000000000000000000000000000000000000001␤»
<grondilu> where do those four bits come from??
<grondilu> niecza: my ($x, $y) = (2**30, 1); printf "%32b", +^$x +& $y;
<p6eval> niecza v13-389-g852f0ff: OUTPUT«                               1»
<moritz> grondilu: I just realized, libtommath (which we use for
storing bigints) uses 28bit "digits"
<moritz> grondilu: so there might indeed a bug in there somewhere
<grondilu> oh, this explains a lot
<moritz> grondilu: feel free to submit as rakudobug (or even fix if you want :-)
<grondilu> I don't know how to.  Someone please do it.
* masak submits rakudobug
<moritz> libtommath stores sign separately from the rest of the bits,
which is why we need to emulate 2's complement math
<moritz> and that part might be buggy

Carl Mäsak | 3 Feb 14:07
Picon
Favicon

[perl #109734] [BUG] Strange MOP type check cache error message when doing <at_pos(1)> in a regex in Rakudo

# New Ticket Created by  "Carl Mäsak" 
# Please include the string:  [perl #109734]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=109734 >

<masak> how would you split a string into the first character and the
rest of the string in Perl 6?
<moritz> .split(/<at_pos(1)>/)
<jnthn> ooh
<moritz> nom: say 'foobar'.split(/<at_pos(1)>/).perl
<p6eval> nom acbec8: OUTPUT«No type check cache and no type_check
method in meta-object␤  in method reify [...]
<jnthn> How in the hell...
<moritz> jnthn: indeed.
<moritz> I get the same output locally
* masak submits rakudobug
<jnthn> OK, what is at_pos doing... :)
<jnthn> Wild guess: using nqp::getattr somewhere it should be using
nqp::getattr_i :)
<moritz> erm, is it even spelled at_pos?
<moritz> I might as well be misremembering something
<masak> at the very least, it's an LTA error message.
<p6eval> nom acbec8: OUTPUT«=> <>␤ at => <>␤␤»
<moritz> star: say 'foobar'.split(/<at(1)>/).perl
<p6eval> star 2012.01: OUTPUT«("f", "oobar").list␤»
<masak> \o/
<moritz> ok, it helps to spell it correctly :-)
<jnthn> \o/
<masak> so, error is in using something that doesn't exist :)
<masak> typical "programmer never tried this path" thinko :)
(Continue reading)

Picon
Gravatar

Here docs in Perl6

I'm testing Perl6 using rakudo for now I'm wondering does any 
implementation have heredocs yet ???
http://www.perlfoundation.org/perl6/index.cgi?perl_6_basics_tablet#heredocs   
the link points to a site that says that
Q :to 'END';

stuff
stuff
END

should work but rakudo barfs at that

--

-- 

   .~.     In my life God comes first....
   /V\         but Linux is pretty high after that :-D
  /( )\    Francis (Grizzly) Smit
  ^^-^^    http://www.smit.id.au/


Gmane