»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg camelia perl6: ... | irclog: irc.perl6.org | UTF-8 is our friend!
Set by sorear on 25 June 2013.
TimToady rosettacode.org/wiki/Rosetta_Code/F...ags#Perl_6 02:42
BenGoldberg j: srand(42); print ('hs n elrteaAroP,cH krJeut'.comb).pick(*)
camelia rakudo-jvm 57a89f: OUTPUT«Just Another Perl Hacker,»
TimToady :) 02:43
don't need the first parens
j: srand(42); print 'hs n elrteaAroP,cH krJeut'.comb.pick(*) 02:44
camelia rakudo-jvm 57a89f: OUTPUT«Just Another Perl Hacker,»
BenGoldberg p: srand(42); print ('a'..'z').pick(*) 02:47
camelia rakudo-parrot 57a89f: OUTPUT«ujcdltafvwqynizmeshxokpgbr»
rakudo-parrot 57a89f: OUTPUT«mpjvcoqwzrabxsegthuynkfild»
BenGoldberg Parrot doesn't implement srand properly
n: srand(42); print ('a'..'z').pick(*) 02:49
camelia niecza v24-108-g17d73e4: OUTPUT«rfbjcqksolmutapzgnwxdvheiy»
BenGoldberg niecza does, though, so I could make an srand japh for it :)
n: srand(42); print 'Ps c,uret neet AJohrkHalr'.comb.pick(*) 02:51
camelia niecza v24-108-g17d73e4: OUTPUT«Just Another Perl Hacker,»
moritz \o 07:13
preflex moritz: you have 1 new message. '/msg preflex messages' to read it.
moritz home again, with a vomiting child 07:24
nwc10 oh /o\ 08:30
moritz she's sleeping now, and seems to have gotten a bit better 08:31
woolfy moritz: sleeping child is good most of the time, hope the kiddo wakes up energeting and wanting to jump on your bed 08:54
FROGGS p: my $q = "+"; say "aaa" ~~ /a<$q>/ # does somebody know if this shall be allowed? 09:07
camelia rakudo-parrot 57a89f: OUTPUT«Failed allocation of 2923167744 bytes␤Parrot VM: PANIC: Out of mem!␤C file src/gc/gc_gms.c, line 1974␤Parrot file (not available), line (not available)␤␤We highly suggest you notify the Parrot team if you have not been working on␤Parrot. Use…»
FROGGS I think we need to parse that regex at runtime when it contains a variable in an assertion 09:24
FROGGS S05 does not tell :o( 09:36
lizmat TimToady: maybe a blog post on your work on rosettacode? 09:38
nwc10 j: my $q = "+"; say "aaa" ~~ /a<$q>/ 09:48
camelia rakudo-jvm 57a89f: OUTPUT«(timeout)»
FROGGS this can't work atm... the question is: should it work at all? 09:49
r: my $q = "a+"; say "aaa" ~~ /a<$q>/
camelia rakudo-parrot 57a89f, rakudo-jvm 57a89f: OUTPUT«「aaa」␤␤»
FROGGS if you feed it a proper subrule it works 09:50
moritz woolfy: hah, the child woke up, wanted to eat cookies, and was very angry when I didn't allow it :-)
FROGGS moritz: you are soo mean!
FROGGS cries too
FROGGS runs away
moritz: btw, I'd propose that we merge moar-support into nom 09:51
moritz FROGGS: I have no objections, but IMHO it's jnthn++'s decision 09:54
FROGGS hmmm, k
tadzik hmmm, do we have a MutableSet of some kind?
ah, SetHash 09:56
(fwiw, I'd expect Set.values to give me what Set.keys does, not "True True True") 10:03
FROGGS p: multi postcircumfix:<[ ]>(Int $a, Int $b) { say 42 }; 42[1] 10:53
camelia rakudo-parrot 57a89f: OUTPUT«42␤»
FROGGS p: multi postcircumfix:<“ ”>(Int $a, Int $b) { say 42 }; 42“1” 10:54
camelia rakudo-parrot 57a89f: OUTPUT«===SORRY!=== Error while compiling /tmp/QAFmtVVhEr␤Cannot add tokens of category 'postcircumfix'␤at /tmp/QAFmtVVhEr:1␤------> multi postcircumfix:<“ ”>⏏(Int $a, Int $b) { say 42 }; 42“1”␤ expectin…»
lizmat tadzik: afaik, Set is described as a immutable Hash of Bool 11:49
why would .values give enything but True's then ?
tadzik because it's not useful for anything, imho 11:52
tadzik and values just sounds good, like "Values in a Set" 11:52
lizmat if you have something that you don't know is a Set or a Bag or a Mix, don't you expect .values to give something that's not the key? 11:54
tadzik oh, in that case, yes
I agree now
woolfy moritz: now I am a bit disappointed that I did not buy any cookies today at the bakery... 12:03
jnthn afternoon, #perl6 12:23
jnthn made it safely to family :)
timotimo jnthn: \o/ 12:24
FROGGS jnthn: hehe, and now you are sitting somewhere in the corner at your laptop? :P
timotimo jnthn: what's your take on "the error message is better, except if you cause the error in the repl, in which case you either get a null pmc access or infinitely many null pointer exceptions"?
jnthn FROGGS: No, actually sitting drinking nice coffee while family are away taking care of a couple of errands :) 12:26
I'll only be around for an hour or so :)
timotimo jnthn: the error in question is what you get when you write "my int foobar" instead of \foobar or $foobar. 12:27
jnthn timotimo: Is that happening portably or just on NQP on JVM?
I know certain errors at the REPL cause it to be very unhappy...
timotimo didn't get to test it on moar yet
jnthn And just repeat the error over and over
Well, there's Parrot too. The infinite repeating of errors only happend on JVM.
timotimo well, on jvm i get infinitely many NPE's, on parrot i get a single null pmc access
jnthn I didn't get chance to look into it.
Right
timotimo it's on rakudo, fwiw 12:28
FROGGS jnthn: shall we merge moar-support into nom now? release is done... (moritz++)
jnthn So, two bugs. One is the null thingy.
FROGGS: I'd rather not do so yet.
FROGGS jnthn: roger that
jnthn FROGGS: I'd prefer we do it once it reliably builds for most people.
FROGGS k
timotimo okay. before i merge the More Than Less Than Awesome Error Message i'll look more into where the error comes from
afk for now
jnthn timotimo: Yeah, I think there are other cases where this happens.
It'd be great to solve them. OTOH, it does mean it's not a specific issue with your improved error, so I'd not block merging that. 12:29
But yeah, hunting down and fixing the issues with some REPL errors would certainly improve hte REPL experience. 12:30
FROGGS: From glancing backlog occasionally, I got the impression that lingering GC-invariant-breaking bugs are still haunting the builds of many... 12:31
FROGGS jnthn: I could reactivate some virtual machines and hope it breaks on one of them... otherwise I don't know where to start 12:32
jnthn FROGGS: Well, if you can get hold of the nwc10++ script (I know he already sent the patches to the mailing list) then you can go hunting that way 12:33
FROGGS yeah, I wanted to ask him what I need to do to get results...
jnthn That's been the most efficient way to hunt/fix GC issues so far. 12:34
FROGGS btw, I remember there was a $sym.split(' ') to get the sarter/stopper of (post)circumfixes... where lives that code?
Rotwang hi
jnthn It doesn't always get the one that's immediately blocking things, but it does always give things that are broken.
FROGGS hi Rotwang
Rotwang "I swear the only reason we don’t have factorial as a standard operator in the language, is so that we can impress people by defining it." lol, I was thinking the same thing [;
jnthn Umm...HLL::Actions iirc 12:35
FROGGS k, thanks!
jnthn But see the Q grammar, or maybe role STDish
Which needs to find the delimeters
jnthn FROGGS: ah, yeah. grep for peek_delimiters. 12:37
oh, wait...no, that's not what you asked.
FROGGS: I think you are looking for add_categorical 12:38
FROGGS duh, my journey began there >.< 12:39
jnthn++ # thank you
jnthn np 12:42
What're you working on, ooc?
FROGGS custom postcircumfixes 12:44
jnthn oh, cool :) 12:45
FROGGS :o)
jnthn We already have custom circumfixes; I suspect you can tkae some inspiration from that code 12:46
FROGGS yeah, I took it as a pattern
jnthn Looking forward ot seeing a snowman/comet postcircumfix, anyway... :D
FROGGS ahh, good example
dalek kudo/nom: 265417d | (Timo Paulssen)++ | src/Perl6/Grammar.nqp:
better error when forgetting a sigil in definition
13:05
ast: b364ac7 | (Timo Paulssen)++ | S02-names-vars/varnames.t:
test suggesting sigilless var names for my int a; etc.
timotimo well, at least now i know why the jvm infiniloops and parrot just aborts 13:19
at least i think i do.
jnthn Cool 13:21
timotimo i think it has to do with the way NPA and NPE are at different levels to jvm and parrot 13:23
similar to how 6model is more fundamental to moarvm than to parrot
afk for a bit again
smls Just read the "Promises and Channels" advent article by jnthn 14:09
Not very excited about « loop { winner $channel { more $channel { ... } done $channel { last } } »
Is this really supposed to be the standard Perl 6 idiom for processing items from a channel/queue?
timotimo don't we have a $channel.list? 14:10
smls Three levels of block nesting, just seems excessive.
It seems much simpler in Perl 5: « while (defined($_ = $queue->dequeue())) { ... } »
timotimo actually, pretty much the same thing will work in perl6, too 14:11
let me quickly verify my assumptions
you can receive as often as you like and catch the X::Channel::ReceivedOnClosed exception 14:12
ReceiveOnClosed*
if you're guaranteed to be the only receiver on the channel, you can also poll and receive; but if you have more than one thread receiving on the channel, that gives you a race condition 14:13
smls How about merging « loop { winner * { ... } } » into a single loop construct: « whenever { ... } » 14:14
(The 'whenever' name was suggested by someone in the advent article's comment section.)
timotimo doesn't sound bad, aye
smls Speaking of simplifying nested structures, have you thought about adding syntactic sugar for routines that do nothing but call start {...}? 14:17
« sub foo() { start { ... } } » could become « sub foo() is promise { ... } »
« @foo.map: -> $x { start { ... } } » could become « @foo.map: -> $x { ... } :promise » 14:18
timotimo my &foo = -> { start { ... } } :P 14:19
hm. 14:20
timotimo i don't understand why the payload of the exception is sometimes null when it reaches interactive_exception and sometimes it's not 14:21
Soemgyu r: enum Players (:X(True) :O(False); Players.enums; 14:33
camelia rakudo-jvm 265417: OUTPUT«===SORRY!=== Error while compiling /tmp/wemch_6oJP␤Unable to parse expression in parenthesized expression; couldn't find final ')' ␤at /tmp/wemch_6oJP:1␤------> yers (:X(True) :O(False); Players.enums;⏏<EOL>␤ …»
..rakudo-parrot 265417: OUTPUT«===SORRY!=== Error while compiling /tmp/BvaL8g1qeW␤Unable to parse expression in parenthesized expression; couldn't find final ')' ␤at /tmp/BvaL8g1qeW:1␤------> yers (:X(True) :O(False); Players.enums;⏏<EOL>…»
Soemgyu r: enum Players (:X(True) :O(False)); Players.enums; 14:34
camelia ( no output )
Soemgyu r: enum Players (:X(True) :O(False)); say Players.enums;
camelia rakudo-parrot 265417, rakudo-jvm 265417: OUTPUT«("X" => Bool::True).hash␤»
Soemgyu Is that right?
As in, the False key disappears.
Similarly for slurpy hashes as sub parameters.
timotimo yes and no :)
FROGGS r: enum Players (:X(True), :O(False)); say Players.enums;
camelia rakudo-parrot 265417: OUTPUT«("X" => Bool::True, "O" => Bool::False).hash␤»
..rakudo-jvm 265417: OUTPUT«("O" => Bool::False, "X" => Bool::True).hash␤»
timotimo rakudo doesn't implement it without the comma yet
Soemgyu Ohh, I see. 14:35
So something missing on my end, thanks.
FROGGS without the comma the :O is an adverb to the thing before it
timotimo isn't it supposed to work, though? by spec?
FROGGS dunno
timotimo AFK 14:36
moritz think it is 14:57
dalek : fe4aa86 | moritz++ | misc/perl6advent-2013/schedule:
[advent] claim day 23 with "unary sort"
16:09
timotimo d'oh, our moarvm stage0 doesn't have eqat 16:22
huh, the jvm stage0 doesn't have eqat either? 16:23
didn't we just recently update that?
FROGGS yes, I think so
timotimo oh wait. is it actually called eqat_s?
FROGGS that sounds familiar
timotimo nqp: say(nqp::eqat_s("foobar", "foo", 0));
camelia nqp-moarvm: OUTPUT«Error while compiling op eqat_s (source text: "nqp::eqat_s(\"foobar\", \"foo\", 0)"): No registered operation handler for 'eqat_s'␤frame_name_1109␤»
..nqp-jvm: OUTPUT«Method 'type' not found for invocant of class 'NQPMu'␤ in coerce (gen/jvm/stage2/QAST.nqp:4205)␤ in as_jast (gen/jvm/stage2/QAST.nqp:2988)␤ in (gen/jvm/stage2/QAST.nqp:3785)␤ in compile_all_the_stmts (gen/jvm/stage2/QAST.nqp:3773)␤ in as_jast (gen/jvm…»
..nqp-parrot: OUTPUT«Error while compiling op eqat_s (source text: "nqp::eqat_s(\"foobar\", \"foo\", 0)"): No registered operation handler for 'eqat_s'␤current instr.: '' pc 57054 (gen/parrot/stage2/QAST.pir:21045) (gen/parrot/stage2/QAST.nqp:3631)␤»
timotimo nqp: say(nqp::eqat("foobar", "foo", 0));
camelia nqp-jvm, nqp-parrot: OUTPUT«1␤»
..nqp-moarvm: OUTPUT«Error while compiling op eqat (source text: "nqp::eqat(\"foobar\", \"foo\", 0)"): No registered operation handler for 'eqat'␤frame_name_1109␤»
timotimo moar has no eqat at all? o_O 16:24
ah well >_>
FROGGS nqp-m: nqp::eqat
camelia nqp-moarvm: OUTPUT«Error while compiling op eqat (source text: "nqp::eqat"): No registered operation handler for 'eqat'␤frame_name_1109␤»
FROGGS nqp/src/vm/moar/QAST/QASTOperationsMAST.nqp:1900:QAST::MASTOperations.add_core_moarop_mapping('eqat', 'eqat_s'); 16:25
FROGGS scratches his head
moritz outdated stage0? 16:26
or outedated evalbot?
FROGGS ahh, the latter might be it
FROGGS nqp-m -e 'nqp::eqat' 16:27
Error while compiling op eqat (source text: "nqp::eqat"): Arg count 0 doesn't equal required operand count 4 for op 'eqat_s'
there we go
timotimo: it is called nqp::eqat on all three backends
dunno how early it is there though 16:28
dalek kudo/nom: d727971 | (Tobias Leich)++ | / (3 files):
fix current regression about variable interpolation in assertions
16:31
moritz FROGGS: does that fix the perl5 regex tests? 16:32
FROGGS yes
moritz and you also re-enabled the tests. great.
FROGGS++ 16:33
FROGGS :o)
FROGGS hmmm, t/spec/S02-names-vars/varnames.rakudo.parrot fails 17:04
timotimo that was me 17:10
did you get a recent nom?
FROGGS yeah
I pulled before I pushed 17:11
brb
timotimo huh. let me check.
lizmat moritz++ 17:23
moritz gist.github.com/moritz/387fbb263ffb3cb0f9c7 preview of the advent calendar post. Suggestion for a conclusion/finish would be very welcome, as well as other kinds of feedback 17:29
timotimo how do i tell fudgeandrun to use a specific perl6 binary? (-p in this case) 17:32
Rotwang moritz: below this example: my @sorted = sort * <=> *, @values; 17:33
there are some stray characters: my @sorted = sort &infix:«<=>», @values;
LATIN CAPITAL LETTER A WITH CIRCUMFLEX (U+00C2) 17:34
or it should be there?
lizmat moritz: in perl5 example you use .lc, whereas in Perl6 example you use .uc
lizmat say sort { $^a.lc cmp $^b.lc }, @words; 17:35
say sort { .uc }, @words;
timotimo FROGGS: apparently the only wrong thing about it is the number of tests planned 17:36
ah, i counted the number of tests wrong for throws_like 17:37
here we go. 17:38
dalek ast: 5734989 | (Timo Paulssen)++ | S02-names-vars/varnames.t:
throws_like with 1 matcher gives 3 tests, not 2.
BenGoldberg rn: my $a = all(map { srand(42); (0..9).pick(*).join('') }, 1..9); say so $a eq $a 17:47
camelia rakudo-jvm d72797, niecza v24-108-g17d73e4: OUTPUT«True␤»
..rakudo-parrot d72797: OUTPUT«False␤»
FROGGS timotimo++ 17:59
moritz Rotwang: just and encoding artifact, will fix 18:08
lizmat: thanks, fixing 18:11
Juerd Please note: I'm no longer using feather for irc myself. I won't notice stuff like high loads as quickly as before, so please notify me in case of trouble :) 18:28
moritz gist.github.com/moritz/387fbb263ffb3cb0f9c7 updated with conlusion, encoding fixes, and by fixing s/uc/lc/. lizmat++, Rotwang++ 18:29
moritz feedback welcome. 18:49
moritz advent post scheduled for publication. 19:14
smls While reading S06, I came across the following statement under "Advanced subroutine features": 19:23
"The want function is gone. If you want context specific behavior, return an object instead that responds accordingly to the various contextual methods."
However, that defeats the purpose of what would probably be the most common use-case of a want function (if experience with Perl 5's wantarray is anything to go by): 19:24
As a performance optimization.
I.e. one might factor out any calculations that are *only* needed to generate the sub's return value, and skip those calculations entirely if the sub is called in void context.
moritz smls: not at all
smls Or perform a potentially simpler set of calculations, if we're "only" in scalar context rather then in list context.
moritz smls: you can put that calculation into the method of an object you return
the expensive calculation, that is 19:25
it just requires you to approach the problem at bit differently
moritz also IMHO a very common use case of wantarray is wantarray ? @$aref : $aref; 19:29
or wantarray ? @a : @a[0] 19:30
smls moritz: ok, but constructing such a context-aware object sounds difficult 19:37
not something one would do in a simple every-day function
FROGGS[mobile]2 it just needs to provide .list/.item methods, no? 19:39
and the caller would then do: @( foo() ) 19:41
or foo().Str
or whatever
smls but would you want to declare and instantiate a custom Class just to return something from a function? 19:42
FROGGS[mobile]2 when I want to return something with a behaviour, I'd return an object, yes 19:43
moritz smls: depends on the function 19:44
smls My point is that it makes something more difficult than it was in Perl 5
moritz yes, that's a valid point 19:45
but wantarray/want and multi dispatch simply don't mix
moritz and multi dispatch is at least an order of magnitude more useful, so want had to die. 19:45
moritz multi a(Str $x) { 'Str }; multi a(*@x) { 'List' }; a(b()); # which context is b() called in? 19:46
smls compare you custom-object solution to a simple « if (defined wantarray) { ... } », or the examples moritz listed above 19:47
ok, makes sense 19:48
moritz anyway, in actual Perl 6 applications and modules that doesn't seem to be much of a problem 20:05
also note that creating classes is much more convenient in Perl 6
lizmat moritz: maybe expand to include sort ~* and sort -~* for lexicographic and reverse lexicographic sort 20:17
r: say sort ~*, 2,10,300 20:18
camelia rakudo-parrot d72797, rakudo-jvm d72797: OUTPUT«10 2 300␤»
lizmat r: say sort -~*, 2,10,300
camelia rakudo-parrot d72797, rakudo-jvm d72797: OUTPUT«300 10 2␤»
lizmat hmm.. that last one doesn't quite do what I expected 20:21
I guess the - numifies the string after all
FROGGS r: say sort -~*, 2,10,"300a" 20:22
camelia rakudo-jvm d72797: OUTPUT«Cannot convert string to number: trailing characters after number in '300⏏a' (indicated by ⏏)␤ in whatevercode at /tmp/63JqpSEwvB:1␤ in block at gen/jvm/CORE.setting:7303␤ in block at gen/jvm/CORE.setting:7167␤ in method gimme at gen/jvm/…»
..rakudo-parrot d72797: OUTPUT«Cannot convert string to number: trailing characters after number in '300⏏a' (indicated by ⏏)␤ in method Numeric at gen/parrot/CORE.setting:12063␤ in sub prefix:<-> at gen/parrot/CORE.setting:3822␤ in sub prefix:<-> at gen/parrot/CORE.settin…»
FROGGS yes 20:23
moritz lizmat: ..except that -~* doesn't work
lizmat indeed, I just realized that and why
FROGGS: fwiw, there are 4 todo tests passing in the spectest now 20:24
all in s05-modifier/*.t
FROGGS yes, I was going to unfudge them
lizmat moritz: you could consider the -* as quite a cheat :-) 20:25
lizmat afk 30 mins 20:25
dalek ast: 8e7c9fc | (Tobias Leich)++ | S05-m (4 files):
unfudge now passing tests (var interpolation)
20:29
FROGGS lizmat: thanks for the reminder
p: sub a(*@a) { say @a }; sub b(*@a) { goto &a }; sub goto(Callable $r) { say CALLER::DYNAMIC::<&?ROUTINE>; $r() }; b(42) 20:39
camelia rakudo-parrot d72797: OUTPUT«sub b(*@a) { ... }␤␤»
FROGGS is there a way to inspect how a sub was called?
moritz what do you mean by "how"? 20:43
FROGGS getting the args
to pass them to another sub with an identical signature
moritz sub a(\a) { b(|a) }
FROGGS moritz: I want to implement `goto &name` in v5 20:44
moritz also in rakudo iirc there's an (unspecced) lexicall that contains the original args
FROGGS ohh
moritz r: sub f($x) { say ::MY.keys }; f(42) 20:44
camelia rakudo-parrot d72797, rakudo-jvm d72797: OUTPUT«␤»
FROGGS QAST::Var(local __args__ :decl(param)) 20:45
moritz r: sub f($x) { say callframe(0).my.keys.perl }; f(42)
camelia rakudo-parrot d72797: OUTPUT«("\$x", "\$_", "\$/", "\$!", "\$*DISPATCHER", "\&?ROUTINE", "RETURN").list␤»
..rakudo-jvm d72797: OUTPUT«("\$x", "\$!", "\$*DISPATCHER", "\$_", "\$/", "RETURN", "\&?ROUTINE").list␤»
FROGGS r: sub f($x) { say callframe(0).my<$x> }; f(42) 20:53
camelia rakudo-parrot d72797, rakudo-jvm d72797: OUTPUT«42␤»
FROGGS r: sub f(*@x) { say callframe(0).my<*@x> }; f(42)
camelia rakudo-parrot d72797, rakudo-jvm d72797: OUTPUT«(Any)␤»
FROGGS r: sub f(*@x) { say callframe(0).my<@x> }; f(42)
camelia rakudo-parrot d72797, rakudo-jvm d72797: OUTPUT«42␤»
BenGoldberg rn: sub f($x) { callframe(0).my.keys.sort.perl.say }; f(42) 20:53
camelia niecza v24-108-g17d73e4: OUTPUT«Potential difficulties:␤ $x is declared but not used at /tmp/Gu6tFEhHbO line 1:␤------> sub f(⏏$x) { callframe(0).my.keys.sort.perl.say␤␤Unhandled exception: Unable to resolve method my in type CallFrame␤ at /tmp/Gu6tF…»
..rakudo-parrot d72797, rakudo-jvm d72797: OUTPUT«("\$!", "\$*DISPATCHER", "\$/", "\$_", "\$x", "\&?ROUTINE", "RETURN")␤»
BenGoldberg rn: sub f($x) { $x = $x; callframe(0).my.keys.sort.perl.say }; f(42) 20:54
camelia rakudo-jvm d72797: OUTPUT«Cannot assign to a readonly variable or a value␤ in sub f at /tmp/mGuLulzLJ8:1␤␤»
..rakudo-parrot d72797: OUTPUT«Cannot assign to a readonly variable or a value␤ in sub f at /tmp/KapOQDvQai:1␤ in block at /tmp/KapOQDvQai:1␤␤»
..niecza v24-108-g17d73e4: OUTPUT«Unhandled exception: Writing to readonly scalar␤ at /tmp/XWPWSFgnAv line 1 (f @ 3) ␤ at /tmp/XWPWSFgnAv line 1 (mainline @ 4) ␤ at /home/p6eval/niecza/lib/CORE.setting line 4595 (ANON @ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting line 459…»
BenGoldberg rn: sub f($x) { say $x; callframe(0).my.keys.sort.perl.say }; f(42)
camelia niecza v24-108-g17d73e4: OUTPUT«42␤Unhandled exception: Unable to resolve method my in type CallFrame␤ at /tmp/XWi5PnZnPP line 1 (f @ 7) ␤ at /tmp/XWi5PnZnPP line 1 (mainline @ 4) ␤ at /home/p6eval/niecza/lib/CORE.setting line 4595 (ANON @ 3) ␤ at /home/p6eval/niecza/l…»
..rakudo-parrot d72797, rakudo-jvm d72797: OUTPUT«42␤("\$!", "\$*DISPATCHER", "\$/", "\$_", "\$x", "\&?ROUTINE", "RETURN")␤»
BenGoldberg How is it done on niecza?
Rotwang r: sub MAIN(Str :$foo) { my @bar = $foo;say "{@bar}"; } 20:55
camelia rakudo-parrot d72797: OUTPUT«Cannot unbox a type object as a native str␤ in method join at gen/parrot/CORE.setting:1593␤ in method Str at gen/parrot/CORE.setting:7515␤ in method Str at gen/parrot/CORE.setting:996␤ in method Stringy at gen/parrot/CORE.setting:1006␤ in …»
..rakudo-jvm d72797: OUTPUT«Cannot unbox a type object␤ in method join at gen/jvm/CORE.setting:1580␤ in sub MAIN at /tmp/3uLbFX_Jbx:1␤␤»
Rotwang is this a bug or not a bug? [;
BenGoldberg n: sub MAIN(Str :$foo) { my @bar = $foo;say "{@bar}"; } 20:56
camelia niecza v24-108-g17d73e4: OUTPUT«␤»
BenGoldberg n: sub MAIN(Str :$foo) { my @bar = $foo;say "x{@bar}y"; }
camelia niecza v24-108-g17d73e4: OUTPUT«xy␤»
Rotwang yeah, so it seems to be a bug
FROGGS r: sub MAIN(Str :$foo = "") { my @bar = $foo;say "{@bar}"; } 20:57
camelia rakudo-parrot d72797, rakudo-jvm d72797: OUTPUT«␤»
BenGoldberg r: sub f($x) { callframe(0).my.perl.say }; f(42)
camelia rakudo-jvm d72797: OUTPUT«No such method 'perl' for invocant of type 'Lexotic'␤ in method perl at gen/jvm/CORE.setting:8691␤␤»
..rakudo-parrot d72797: OUTPUT«No such method 'perl' for invocant of type 'Continuation'␤ in method perl at gen/parrot/CORE.setting:8716␤ in method perl at gen/parrot/CORE.setting:1018␤ in sub f at /tmp/8jTHYA8ojf:1␤ in block at /tmp/8jTHYA8ojf:1␤␤»
FROGGS IMO it should say the same as this in your example:
p: "{Str}"
camelia rakudo-parrot d72797: OUTPUT«use of uninitialized value of type Str in string context in block at /tmp/SN5OvTtksL:1␤␤»
BenGoldberg r: sub f($x) { callframe(0).my.kv.perl.say }; f(42) 20:58
camelia rakudo-jvm d72797: OUTPUT«("\$x", Mu, "\$!", Mu, "\$*DISPATCHER", Mu, "\$_", Mu, "\$/", Mu, "RETURN", Mu, "\&?ROUTINE", Mu).list␤»
..rakudo-parrot d72797: OUTPUT«("\$x", 3, "\$_", 7, "\$/", 11, "\$!", 15, "\$*DISPATCHER", 19, "\&?ROUTINE", 23, "RETURN", 27).list␤»
BenGoldberg r: sub f($x) { callframe(0).my.kv.sort.perl.say }; f(42)
camelia rakudo-jvm d72797: OUTPUT«Nominal type check failed for parameter 'null'␤ in block at gen/jvm/CORE.setting:7808␤ in method sort at gen/jvm/CORE.setting:7802␤␤»
..rakudo-parrot d72797: OUTPUT«("\$!", "\$*DISPATCHER", "\$/", "\$_", "\$x", "\&?ROUTINE", 3, 7, 11, 15, 19, 23, 27, "RETURN")␤»
BenGoldberg Type check failed?
r: sub f($x) { callframe(0).my.pairs.sort.perl.say }; f(42) 21:00
camelia rakudo-parrot d72797: OUTPUT«("\$!" => 15, "\$*DISPATCHER" => 19, "\$/" => 11, "\$_" => 7, "\$x" => 3, "\&?ROUTINE" => 23, "RETURN" => 27)␤»
..rakudo-jvm d72797: OUTPUT«("\$!" => Mu, "\$*DISPATCHER" => Mu, "\$/" => Mu, "\$_" => Mu, "\$x" => Mu, "\&?ROUTINE" => Mu, "RETURN" => Mu)␤»
BenGoldberg Shouldn't my.pairs have '$x' => 42? 21:01
r: sub f($x) { callframe(0).my<RETURN>.say }; f(42) 21:02
camelia rakudo-parrot d72797: OUTPUT«No such method 'say' for invocant of type 'Continuation'␤ in sub f at /tmp/6cW3MdZ0lx:1␤ in block at /tmp/6cW3MdZ0lx:1␤␤» 21:03
..rakudo-jvm d72797: OUTPUT«No such method 'say' for invocant of type 'Lexotic'␤␤»
BenGoldberg Why is one a Continuation, and the other a Lexotic?
moritz internal leaking out, I think 21:07
Rotwang crap, I've just sent an email to rakudobug without a topic 21:09
I guess server will reject this message? 21:10
moritz has no idea
never tried that before :-)
Rotwang no, it was accepted, but it looks ridiculous
nwc10 what should the subject be? 21:12
Rotwang nwc10: thats the problem, I have no idea [;
nwc10 oh OK, I can't fix that then :-)
Rotwang r: my Str $foo; my @bar = $foo;say ~@bar
camelia rakudo-parrot d72797: OUTPUT«Cannot unbox a type object as a native str␤ in method join at gen/parrot/CORE.setting:1593␤ in method Str at gen/parrot/CORE.setting:7515␤ in method Str at gen/parrot/CORE.setting:996␤ in method Stringy at gen/parrot/CORE.setting:1006␤ in …»
..rakudo-jvm d72797: OUTPUT«Cannot unbox a type object␤ in method join at gen/jvm/CORE.setting:1580␤␤»
nwc10 when you know the answer, get someone to go to rt.perl.org/Ticket/Modify.html?id=120846 21:13
r: my Str $foo; my @bar = $foo;say ~@bar;
camelia rakudo-parrot d72797: OUTPUT«Cannot unbox a type object as a native str␤ in method join at gen/parrot/CORE.setting:1593␤ in method Str at gen/parrot/CORE.setting:7515␤ in method Str at gen/parrot/CORE.setting:996␤ in method Stringy at gen/parrot/CORE.setting:1006␤ in …»
..rakudo-jvm d72797: OUTPUT«Cannot unbox a type object␤ in method join at gen/jvm/CORE.setting:1580␤␤»
nwc10 well, at least they agree 21:14
:r my Str $foo = ""; my @bar = $foo;say ~@bar;
r: my Str $foo = ""; my @bar = $foo;say ~@bar;
camelia rakudo-parrot d72797, rakudo-jvm d72797: OUTPUT«␤» 21:15
Rotwang "Cannot unbox a type object as a native str if object is not defined" is that a good subject?
nwc10 r: my Str $foo = undef; my @bar = $foo;say ~@bar;
camelia rakudo-jvm d72797: OUTPUT«===SORRY!=== Error while compiling /tmp/_5SzF97OsW␤Unsupported use of undef as a value; in Perl 6 please use something more specific:␤ Any (the "whatever" type object),␤ an undefined type object such as Int,␤ :!defined as a matcher…»
..rakudo-parrot d72797: OUTPUT«===SORRY!=== Error while compiling /tmp/460_CNAFia␤Unsupported use of undef as a value; in Perl 6 please use something more specific:␤ Any (the "whatever" type object),␤ an undefined type object such as Int,␤ :!defined as a matc…»
nwc10 see, I don' tknow Perl 6 :-)
r: my Str $foo = $a; my @bar = $foo;say ~@bar;
camelia rakudo-parrot d72797: OUTPUT«===SORRY!=== Error while compiling /tmp/KHEfiXj9Wk␤Variable '$a' is not declared␤at /tmp/KHEfiXj9Wk:1␤------> my Str $foo = $a⏏; my @bar = $foo;say ~@bar;␤ expecting any of:␤ postfix␤»
..rakudo-jvm d72797: OUTPUT«===SORRY!=== Error while compiling /tmp/TybFqhMnnS␤Variable '$a' is not declared␤at /tmp/TybFqhMnnS:1␤------> my Str $foo = $a⏏; my @bar = $foo;say ~@bar;␤ expecting any of:␤ postfix␤»
nwc10 r: my $a; my Str $foo = $a; my @bar = $foo;say ~@bar; 21:16
camelia rakudo-parrot d72797: OUTPUT«Type check failed in assignment to '$foo'; expected 'Str' but got 'Any'␤ in block at /tmp/48LjEmKlzq:1␤␤»
..rakudo-jvm d72797: OUTPUT«Type check failed in assignment to '$foo'; expected 'Str' but got 'Any'␤␤»
Rotwang nwc10: so lets call it: "Cannot unbox a type object as a native str if object is not defined" 21:19
nwc10 updated it.
Rotwang thank you 21:20
nwc10 no problem. Sorry that I don't actually know enough Perl 6 to be able to comment further on it. 21:21
FROGGS r: sub a(*@a) { say "a: @a" }; sub b(*@a) { goto &a }; sub goto(Callable $r) { $r( |callframe(1).my{ CALLER::DYNAMIC::<&?ROUTINE>.signature.params.map(*.name) } ) }; b(42)
camelia rakudo-parrot d72797, rakudo-jvm d72797: OUTPUT«a: @a␤»
FROGGS moritz++
thanks for the pointer :o)
Rotwang and what about nqp bugs? 22:01
should it be reported to rakudobug?
FROGGS better as github issues for the nqp repo 22:03
Rotwang ok, thanks
btw. what does give icu support in parrot? 22:04
FROGGS libicu
Rotwang so without it rakudo won't support utf-8? 22:06
FROGGS I can't describe what will fail exactly 22:08
Rotwang I'm trying to asses if libicu should be provided by default for rakudo
dalek kudo-star-daily: 34584f5 | coke++ | log/ (5 files):
today (automated commit)
22:29
rl6-roast-data: 6eeba88 | coke++ | / (5 files):
today (automated commit)
FROGGS p: macro a { return }; sub b { a; say "ohh?" }; b() 22:30
camelia rakudo-parrot d72797: OUTPUT«ohh?␤»
FROGGS I was under the impression that the return will land in the sub b before the say statement
[Coke] returns from a stereotypical day at the mall. 22:36
BenGoldberg Is there a spectest for srand? Something like: 22:40
rn: my $a = all(map { srand(42); (0..9).pick(*).join('') }, 1..9); say so $a eq $a
camelia rakudo-jvm d72797, niecza v24-108-g17d73e4: OUTPUT«True␤»
..rakudo-parrot d72797: OUTPUT«False␤»
FROGGS BenGoldberg: these are the tests for rand: github.com/perl6/roast/blob/master...num/rand.t 22:43
colomon masak++ # blog post on HN 22:44
BenGoldberg Does .pick use the same random seed and state as rand?
colomon BenGoldberg: yes 22:48
BenGoldberg: and yes to the spectest question as well 22:49
BenGoldberg rn: srand(42); my $a = [~] ('a'..'z').pick(*);srand(42); my $b = [~] ('a'..'z').pick(*); say $a; say $b; 22:50
camelia rakudo-parrot d72797: OUTPUT«edpxafwihynvqmurkjcltzbsog␤fblaydtxzurknjcqhpsigwovem␤»
..niecza v24-108-g17d73e4: OUTPUT«rfbjcqksolmutapzgnwxdvheiy␤rfbjcqksolmutapzgnwxdvheiy␤»
..rakudo-jvm d72797: OUTPUT«vxbieldnwaptyfogcmkzhsjurq␤vxbieldnwaptyfogcmkzhsjurq␤»
BenGoldberg Why does rakduo-parrot produce two different strings for $a and $b? 22:51
colomon bug? 23:01
colomon rn: srand(42); say 10.rand; srand(42); say 10.rand 23:04
camelia rakudo-parrot d72797: OUTPUT«7.44525000061007␤7.44525000061007␤»
..rakudo-jvm d72797: OUTPUT«7.275636800328681␤7.275636800328681␤»
..niecza v24-108-g17d73e4: OUTPUT«6.6887221376824755␤6.6887221376824755␤»
Ben_Goldberg Clearly srand affects rand properly
Ben_Goldberg rn: for (^3) { srand(42); ^10.pick(*).say } 23:05
camelia rakudo-parrot d72797, rakudo-jvm d72797, niecza v24-108-g17d73e4: OUTPUT«10␤10␤10␤»
colomon should be (^10).
Ben_Goldberg rn: for (^3) { srand(42); (^10).pick(*).say }
camelia niecza v24-108-g17d73e4: OUTPUT«6 1 0 2 7 3 9 4 8 5␤6 1 0 2 7 3 9 4 8 5␤6 1 0 2 7 3 9 4 8 5␤»
..rakudo-parrot d72797: OUTPUT«4 9 3 7 8 6 2 1 0 5␤2 0 7 5 9 4 6 1 3 8␤5 4 9 1 3 7 8 0 6 2␤»
..rakudo-jvm d72797: OUTPUT«5 7 1 0 4 3 9 8 2 6␤5 7 1 0 4 3 9 8 2 6␤5 7 1 0 4 3 9 8 2 6␤»
Ben_Goldberg On parakudo, srand is not affecting .pick 23:06
I notice that the pick tests, at github.com/perl6/roast/blob/master...ist/pick.t , do not include a test involving srand 23:07
Ben_Goldberg rn: for (^3) { srand(42); (^1000).pick(1).say } 23:08
camelia niecza v24-108-g17d73e4: OUTPUT«427␤427␤427␤»
..rakudo-jvm d72797: OUTPUT«413␤413␤413␤»
..rakudo-parrot d72797: OUTPUT«618␤989␤566␤»
FROGGS the parrot version uses mp_rand 23:10
Ben_Goldberg Is there an mp_srand? And if so, could parrot's srand call it? 23:11
Not that I comprehend why a multi precision rand is needed for .pick ....
FROGGS can't find a mp_srand 23:17
Mouq r: say sort *.trans(([~] 1..9) => ([~] 9...1)), 2,10,300 23:42
camelia rakudo-parrot d72797, rakudo-jvm d72797: OUTPUT«300 2 10␤»
Ben_Goldberg Ya know, you could always just use reverse :P
Mouq yeah, I was revisiting 23:43
r: say sort -~*, 2,10,300
camelia rakudo-parrot d72797, rakudo-jvm d72797: OUTPUT«300 10 2␤»
Mouq that
Mouq The code could be simpler, but there seems to be a rakudobug with .trans and closures 23:54
Mouq r: 300.trans: /\d/=>{say $/} 23:54
camelia rakudo-parrot d72797, rakudo-jvm d72797: OUTPUT«Nil␤Nil␤Nil␤Nil␤»
Mouq r: 300.trans: /\d/=>{say $_}
camelia rakudo-parrot d72797, rakudo-jvm d72797: OUTPUT«Nil␤Nil␤Nil␤Nil␤» 23:55
Mouq Quoth S05: “If the right side of the arrow is a closure, it is evaluated to determine the replacement value. If the left side was matched by a regex, the resulting match object is available within the closure.”
BenGoldberg r: say sort ~*, (3, 20, 100).pick(*) 23:59
camelia rakudo-parrot d72797, rakudo-jvm d72797: OUTPUT«100 20 3␤»
BenGoldberg r: say sort {$b leg $a}, (3, 20, 100).pick(*) 23:59
camelia rakudo-parrot d72797: OUTPUT«===SORRY!=== Error while compiling /tmp/FBYib76uF_␤Variable '$b' is not declared␤at /tmp/FBYib76uF_:1␤------> say sort {$b⏏ leg $a}, (3, 20, 100).pick(*)␤ expecting any of:␤ postfix␤»
..rakudo-jvm d72797: OUTPUT«===SORRY!=== Error while compiling /tmp/hlwmg6uXde␤Variable '$b' is not declared␤at /tmp/hlwmg6uXde:1␤------> say sort {$b⏏ leg $a}, (3, 20, 100).pick(*)␤ expecting any of:␤ postfix␤»