»ö« 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.
clsn__ Why were we even expecting 「」 to work without Q or q or something? 00:03
lue clsn__: 「」 is the quoting form of Q(), like '' is for q() and "" is for qq() 00:22
clsn__ Oh... I didn't see that when I tried it. What is Q()'s nature, as opposed to q()? That is, what does it quote or not quote? I understand q and qq are just Q with adverbs. 00:23
lue Q is the base quoting language, without any special interpretations, such as backslashes.
clsn__ Does q() do any specials? 00:25
Ah, I see q[\] doesn't work but has to be q[\\] whereas Q[\] works. 00:26
lue r: say Q[Hello!\n\]; say q[Hello!\n\]];
camelia rakudo-parrot 90b3d6, rakudo-jvm 90b3d6, rakudo-moar 90b3d6: OUTPUT«Hello!\n\␤Hello!\n]␤»
clsn__ So in q[], the only(?) special interpretation is that \ can quote the close-quote character(s), or another \?
lue :q :single Interpolate \\, \q and \' (or whatever) 00:27
perlcabal.org/syn/S02.html#Q_forms has more information on the matter :) 00:28
clsn__ Heh... Kind of funny interactions... q<<\>>>> works, q<<>>> doesn't (and shouldn't), but <<\>>> also throws an error. Probably rightly, but it just seems odd.
lue clsn__: yeah, that's one of those areas where I wish << >> wasn't interpreted as «». It reads better as q«\»», q«»>, and q«\»> 00:30
(which is my guess on how P6 reads those)
clsn__ What good does quoting \q[] inside another \q[] accomplish?
lue I don't know what that \q part is about. 00:31
raydiak dunno, but \qq inside q is quite useful
clsn__ I don't know that it's a <</« thing. I think it's more that multiple openers are allowed. The same would probably happen with q<<<\>>>>>> and q<<<\>>>>>
lue r: say q<<<alive?>>> 00:32
camelia rakudo-parrot 90b3d6, rakudo-jvm 90b3d6, rakudo-moar 90b3d6: OUTPUT«alive?␤»
clsn__ raydiak: I see! So used to thinking "q doesn't interpolate!" that I didn't consider that you could locally override it.
lue r: say q<<<\>>>>>>; say q<<<\>>>>>
camelia rakudo-parrot 90b3d6, rakudo-jvm 90b3d6, rakudo-moar 90b3d6: OUTPUT«===SORRY!=== Error while compiling /tmp/tmpfile␤Couldn't find terminator >>>␤at /tmp/tmpfile:1␤------> say q<<<\>>>>>>; say q<<<\>>>>>⏏<EOL>␤ expecting any of:␤ …»
clsn__ 「」 doesn't work for me as a quoting form of Q[]; is that NYI? 00:34
BenGoldberg r: say q<<<\>>>>>>; say q<<<\>>>>>> 00:35
camelia rakudo-parrot 90b3d6, rakudo-jvm 90b3d6, rakudo-moar 90b3d6: OUTPUT«>>>␤>>>␤»
lue clsn__: NYI 00:36
clsn__ 'k,
lue is seeing if he can fix that right now, actually
clsn__ yay. 00:37
lue Won't actually be able to push such a change until I get a commit bit or set up a fork though. 00:38
clsn__ Mm. And I see that <1/2> for Rat literals is also NYI. Parses as Str. Which is why Rat.perl doesn't round-trip in Rakudo.
Wait, maybe not... It's supposed to make a something that is both a Rat and a Str, so maybe it's right that WHAT shows it as a str. 00:39
Nah. <1/2>.^methods only shows Str stuff. 00:40
lue clsn__: <1/2> → Rat, < 1/2 > → RatStr, «1/2» → RatStr, « 1/2 » → RatStr , IIRC 00:43
clsn__ S02: Literals specified in angle brackets are always subject to val() processing, so <1/2> produces a value that is both a Rat and a Str.
grondilu r: say .WHAT for <1/2>, < 1/2 >, «1/2», « 1/2 » 00:44
camelia rakudo-parrot 90b3d6, rakudo-jvm 90b3d6, rakudo-moar 90b3d6: OUTPUT«(Str)␤(Str)␤(Str)␤(Str)␤»
lue n: say .WHAT for <1/2>, < 1/2 >, «1/2», « 1/2 »
camelia niecza v24-109-g48a8de3: OUTPUT«(Rat)␤(RatStr)␤(RatStr)␤(RatStr)␤»
lue niecza++
lue & for a minute
grondilu IIRC, this used to work on rakudo
:/
lue does not remember that, but could be wrong 00:49
BenGoldberg r: say <1/2>.RatStr 00:50
camelia rakudo-parrot 90b3d6, rakudo-jvm 90b3d6, rakudo-moar 90b3d6: OUTPUT«No such method 'RatStr' for invocant of type 'Str'␤ in block at /tmp/tmpfile:1␤␤»
BenGoldberg r: say RatStr.new(<1/2>)
camelia rakudo-parrot 90b3d6, rakudo-jvm 90b3d6, rakudo-moar 90b3d6: OUTPUT«===SORRY!=== Error while compiling /tmp/tmpfile␤Undeclared name:␤ RatStr used at line 1␤␤»
lue clsn__: here's a counter to the part of S02 you cited :) perlcabal.org/syn/S02.html#Rational_literals 00:51
Also, under Allomorphic Value Semantics: "Any such literal, when written without spaces, produces a pure numeric value without a stringy allomorphism." 00:52
clsn__ I know; in fact, the part I quoted is the last paragraph of that section.
At any rate, <1/2>.WHAT === Str is Not Right. 00:53
lue agreed. As you can guess though, implementing allomorphic types will take a bit of work :)
clsn__ You bet. 00:54
[Coke] moritz: github.com/blog/1772-diffable-more...zable-maps 01:49
LingeringSouls wow anagrams solution at rosetta code. Perl 5 implementation runs very quick less than 10 secs. Perl 6 implementation on rakudo took 4 hours. 02:01
[Coke] LingeringSouls: which rakudo? 02:02
LingeringSouls 2013.12
maybe i didn't compile it correctly? 02:03
[Coke] rosettacode.org/wiki/Anagrams#Perl_6 ?
LingeringSouls yeah
[Coke] LingeringSouls: also, which backend?
LingeringSouls parrot
[Coke] parrot/jvm/moar?
k.
clsn__ Interesting... 02:06
r: subset Prime of Int where *.is-prime; sub pid(Int $p-->Prime) { $p; }; {CATCH {default {say $_.perl}}; say pid(18) }
camelia rakudo-parrot 90b3d6, rakudo-jvm 90b3d6, rakudo-moar 90b3d6: OUTPUT«X::TypeCheck::Return.new(operation => "returning", got => 18, expected => Prime)␤»
clsn__ That worked; the exception was caught.
r: subset Prime of Int where *.is-prime; sub pid(Int $p-->Prime) {CATCH {default {say $_.perl}}; $p}; say pid(18)
camelia rakudo-parrot 90b3d6, rakudo-jvm 90b3d6: OUTPUT«Type check failed for return value; expected 'Prime' but got 'Int'␤ in sub pid at /tmp/tmpfile:1␤ in block at /tmp/tmpfile:1␤␤»
..rakudo-moar 90b3d6: OUTPUT«Type check failed for return value; expected 'Prime' but got 'Int'␤ in any return_error at src/vm/moar/Perl6/Ops.nqp:596␤ in sub pid at /tmp/tmpfile:1␤ in block at /tmp/tmpfile:1␤␤»
clsn__ This time it wasn't. So the exception is thrown *after* the return, not while it's still inside the routine. 02:07
So your routine can't trap itself about to return something illegal.
[Coke] you're trying to use the last value of the catch as a return? 02:09
that seems dubious. 02:10
clsn__ No, I was trying to catch the return of an illegal return value. 02:13
I guess it makes sense. After all, even after catching it, I never did return something legal. What are you going to do then? Go into an infinite loop of catching? 02:14
Just interesting is all.
I suppose you can check it inside the sub by smartmatching against &?ROUTINE.returns (though it seems a little dumb since you presumably know the return type if you wrote it.) 02:22
In much the same way you can do ub nextprime(Prime $p is copy) { $p.=succ; $p.=succ until $p ~~ &?ROUTINE.signature.params[0].constraints; $p } 02:27
Which is sort of what I was playing with the other day. Again, sort of long-winded, since you know the constraints yourself since you put them there. 02:28
(note, though, that the constrained parameter comes through as a normal type with constraints, not as the subset.)
[Coke] going through the anagram example, it's the first .join where things seem to start slowing down 02:31
"he said, eyeballing it." 02:34
[Coke] (hurm. I take that back, and head to bed.) 02:45
skids r: my %f; %f{1} = { a => 1 }; %f{2} =%f{1}; %f{1}{"a"} = 2; %f.say 03:38
camelia rakudo-parrot 90b3d6, rakudo-moar 90b3d6: OUTPUT«("1" => {"a" => 2}, "2" => {"a" => 2}).hash␤»
..rakudo-jvm 90b3d6: OUTPUT«("2" => {"a" => 2}, "1" => {"a" => 2}).hash␤»
grondilu r: my %f; %f{1} = { a => 1 }; %f{2} := %f{1}; %f{1}{"a"} = 2; %f.say 03:59
camelia rakudo-parrot 90b3d6, rakudo-moar 90b3d6: OUTPUT«("1" => {"a" => 2}, "2" => {"a" => 2}).hash␤»
..rakudo-jvm 90b3d6: OUTPUT«("2" => {"a" => 2}, "1" => {"a" => 2}).hash␤»
grondilu r: my %f; %f{1} = { a => 1 }; %f{2} = Hash.new: %f{1}; %f{1}{"a"} = 2; %f.say 04:01
camelia rakudo-jvm 90b3d6: OUTPUT«("2" => {"a" => 1}, "1" => {"a" => 2}).hash␤»
..rakudo-parrot 90b3d6, rakudo-moar 90b3d6: OUTPUT«("1" => {"a" => 2}, "2" => {"a" => 1}).hash␤»
BenGoldberg m: say (1e-14).fmt('%.19f') 05:20
camelia rakudo-moar 90b3d6: OUTPUT«0..92233720368548e+19␤»
moritz good morning. 06:38
raydiak is it appropriate to open a rakudo pull request for a trivial typo fix in docs/? 08:06
grondilu sure, why not? 08:11
raydiak forcing someone whose time is valuable to mark an e-mail as read and go accept the request just to change 1 character in a doc seemed inconsiderate, somehow 08:15
grondilu I've done it once, jnthn merged it and did not complain. 08:16
I think it's just a matter of one click to the "merge button", isn't it?
raydiak more or less...idk, people act in funny ways that I don't understand sometimes...like you'd think tipping someone with coins instead of no tip at all would be a good thing, but people don't react to that well either, I've discovered 08:19
anyway, I'm sure you're right
grondilu just make it clear the pull request is just a typo fix 08:20
raydiak will do; thanks grondilu++ 08:21
moritz raydiak: merging trivial pull requests is nearly no effort 08:24
raydiak: so, go ahead
merging non-trivial pull requests that require review is much more effort
raydiak funny...if it was non-trivial (a substantial contribution), I wouldn't hesitate :) 08:26
moritz: this is all your fault anyway...came across the typo while I was trying to figure out how to try to figure out why .Array::[] works, as you suggested 08:30
or .[], for that matter 08:31
moritz feels almost guilty 08:38
dalek kudo/nom: 2ce599a | raydiak++ | docs/architecture.html:
Fix typo
kudo/nom: e4e8625 | moritz++ | docs/architecture.html:
Merge pull request #251 from raydiak/nom

Just a trivial typo fix
moritz raydiak: thanks
raydiak moritz: you're welcome; thanks for keeping me on my toes, I genuinely appreciate it 08:41
moritz somehow the layout of github.com/rakudo/rakudo/pull/251 is rather broken in my firefox 08:43
... and looks fin in firefox on my other machine. Weird. 08:46
*fine
raydiak heh
zoom not at 100%, perhaps?
moritz moritz.faui2k3.org/tmp/ff-pull-request.png 08:50
zoom doesn't seem to make a difference
gfldex moritz: did you force a reload with ctrl-LMB on the reload button? 08:51
raydiak huh...you have textual names instead of the gravatars 08:51
moritz gfldex: I did a ctrl+shift+r which seems to do the same thing 08:52
raydiak does this load?: 2.gravatar.com/avatar/a38ecf4c33b9...dac33a2a4b 08:55
lizmat does for me 08:58
raydiak I mean in moritz's apparently broken corner of the internet :)
moritz it does 08:59
raydiak odd
short of busting out dev tools to inspect the http headers or checking the browser console for errors, nothing jumps to mind 09:03
moritz firebug doesn't show any errors in the network tab 09:06
though the console says "Content Security Policy: The page's settings blocked the loading of a resource: An attempt to execute inline scripts has been blocked"
raydiak ah...haven't heard that one before...inline js is a security threat too, now? 09:07
moritz well, there's a Content-Security-Policy header that can forbid such things 09:09
which can be a nice protection against XSS
raydiak ah, that's what it meant by "The page's settings" 09:10
I don't see any scripts on that page related to those images, or any inline js at all 09:11
any browser extentions that might do it? an overzealous adblocker or something? 09:13
moritz maybe 09:14
raydiak g'night all 09:32
masak antenoon, #perl6 10:17
moritz \o masak 10:21
FROGGS o/ 10:25
timotimo constant $GROWTH_RATE of Num where 0..* = 1.6; 13:02
does this make sense? o_O
masak um. no. 13:05
std: constant $GROWTH_RATE of Num where 0..* = 1.6;
camelia std 09dda5b: OUTPUT«===SORRY!===␤Missing initializer on constant declaration at /tmp/S9Jmb4OdrW line 1:␤------> constant $GROWTH_RATE of Num ⏏where 0..* = 1.6;␤Two terms in a row at /tmp/S9Jmb4OdrW line 1:␤------> constant $GROWTH_…»
timotimo thank you
masak short story: 'where' does not go there.
timotimo it would have to have a subset defined for it, aye?
masak bigger problem: why do you even need to restrict a constant in the first place? :P
timotimo hah
for clarity 13:06
masak yeah, you need a level of indirection with a subset here.
then you can do 'constant MySubset $GROWTH_RATE = 1.6;'
dalek ecs: ff5dbb6 | (Timo Paulssen)++ | S26-documentation.pod:
fix strange perl6 code in alias example
13:08
masak oh, that code was TheDamian++'s, applied by me. heh. 13:29
timotimo++
timotimo :P 14:38
Ulti just built Rakudo-moar on my macbook \o/ but the REPL doesn't let you press up to get the previous line anymore :< 14:55
masak Ulti: I think that needs to have readline installed. 14:56
it's something of a FAQ, but I don't know that we have the answer written down somewhere. 14:57
btyler Ulti: linenoise was acting goofy on OSX and linux (starting a repl led to an infinite sprew of '>'), so jnthn++ hacked in a simple placeholder so that the Moar release could go out 15:04
Ulti ahh ok 15:04
masak btyler++ # knows stuff 15:09
Ulti just noticed something sort of weird 15:16
r: say [**] ^8
camelia rakudo-parrot e4e862, rakudo-jvm e4e862, rakudo-moar e4e862: OUTPUT«0␤»
Ulti r: say [**] ^10
camelia rakudo-parrot e4e862, rakudo-jvm e4e862, rakudo-moar e4e862: OUTPUT«(timeout)» 15:17
Ulti maybe thats really not doing what I though it was
moritz m: say [**] ^20
camelia rakudo-moar e4e862: OUTPUT«0␤»
Ulti but the time it takes to calculate grows in a scary way
moritz Ulti: ** is right-associative 15:18
Ulti: so it calculates 0 ** (1 ** (2 ** ( 3 ** ... ) ) )
Ulti: which means it has to calculate the full inner expression, before returning 0
Ulti oh
that would explain it a bit more
masak .oO( but a *sufficiently clever* compiler... ) :P 15:19
Ulti apart from my moar build is still doing ^10 but the one here did ^20 fairly snappy
Ulti looks like moar is the answer though >:3 15:21
moritz Ulti: I wonder why camelia was so quick to answer
Ulti maybe it just pm's a magician behind the curtain who answers 15:22
moritz it does ^8 in < 0.3s for me
and still works on ^9 15:23
1m8.395s for ^9
Ulti ^8 isnt coming back to me on my laptop
at least in a time I want to really wait for
^6 is 0.437s 15:24
Ulti also its eating 20% of my RAM whilst it thinks about that 15:25
moritz 1m39s for ^10 here
moritz seems to have a little bit faster cores than Ulti 15:26
Ulti its impressive how its using a gigabyte of RAM to do something relatively numerical and its fluctuating wildly too 15:27
jnthn I suspect it'll be spending all of its time in the big integer library 15:28
Ulti 1.3GB then down to 0.9 really rapidly
so I guess its building big numbers then tearing them down constantly
heh a fun blunder on my part :) big ints are big 15:32
PerlJam What's the magic incantation to get the rakudo debugger to work? 16:10
FROGGS make m-install
that m- is for "magic" here :o)
PerlJam :-) clearly. 16:11
jnthn I normal make install, if you've got Moar, should install it for that.
PerlJam If I've done "perl Configure.pl --backends=jvm,moar" would not "make install" also install the debugger?
timotimo it should 16:12
(though it may forget to +x it)
PerlJam I guess the short of it is ... I must've done something wrong because I don't have a debugger :)
timotimo did you run configure.pl very recently?
PerlJam yesterdayish? 16:13
jnthn PerlJam: It'll install (in theory) as perl6-debug-m
PerlJam maybe day before 16:13
timotimo that should be good enough
just to be safe, try again?
jnthn PerlJam: Note taht it does not install a UI of any kind
PerlJam timotimo: aye, trying now :)
jnthn That needs doing separately; at the moment, by hand since Panda doesn't work on Moar yet
pmurias perl6: my $foo = gather take 123;
camelia niecza v24-109-g48a8de3: OUTPUT«Potential difficulties:␤ $foo is declared but not used at /tmp/tmpfile line 1:␤------> my ⏏$foo = gather take 123;␤␤» 16:14
..rakudo-jvm e4e862: OUTPUT«(timeout)»
( no output )
timotimo jnthn: i liked the way you slipped a "oh by the way, i've been on this brand new backend all the time!" into your presentation 16:22
jnthn ;) 16:24
masak jnthn++
jnthn Yes, it ran all the demos.
Except the JVM one.
timotimo of course :) 16:25
timotimo did you make sure nobody noticed until you showed that slide? :) 16:25
masak .oO( * jnthn .oO( have to make sure nobody knows about my VM! ) ) 16:26
masak wonders if that's the first time in IRC history someone has done a nested thought bubble. 16:27
jnthn timotimo: That I was using perl6-m was a giveaway for those in the know.
PerlJam masak: first I've seen
jnthn
.oO( * masak .oO( I must be really special doing this! ) )
masak haha
what have I unleash'd 16:28
PerlJam
.oO( * jnthn .oO( * mask .oO( I wonder if this is the first 3-way nested thought bubble ) ) )
:-P
masak the horror
next up: aleph-null-nested thought bubbles.
PerlJam masak: with unicode! :) 16:28
masak that'd be right before we tackle the higher cardinalities.
jnthn Even nested thought bubbles are not a regular language... :P 16:29
masak .oO( TO􏿽xCD􏿽x85􏿽xCD􏿽x87􏿽xCC􏿽xB9􏿽xCC􏿽xBA􏿽xC6􏿽x9D̴ȳ̳ TH̘E􏿽xCD􏿽x84􏿽xCC􏿽x89􏿽xCD􏿽x96 ͠P̯͍̭O̚​N̐Y̡ H􏿽xCD􏿽xA8􏿽xCD􏿽x8A􏿽xCC􏿽xBD􏿽xCC􏿽x85􏿽xCC􏿽xBE􏿽xCC􏿽x8E􏿽xCC􏿽xA1􏿽xCC􏿽xB8􏿽xCC􏿽xAA􏿽xCC􏿽xAFE􏿽xCC􏿽xBE􏿽xCD􏿽x9B􏿽xCD􏿽xAA􏿽xCD􏿽x84􏿽xCC􏿽x80􏿽xCC􏿽x81􏿽xCC􏿽xA7􏿽xCD􏿽x98􏿽xCC􏿽xAC􏿽xCC􏿽xA9 􏿽xCD􏿽xA7􏿽xCC􏿽xBE􏿽xCD􏿽xAC􏿽xCC􏿽xA7􏿽xCC􏿽xB6􏿽xCC􏿽xA8􏿽xCC􏿽xB1􏿽xCC􏿽xB9􏿽xCC􏿽xAD􏿽xCC􏿽xAFC􏿽xCD􏿽xAD􏿽xCC􏿽x8F􏿽xCD􏿽xA5􏿽xCD􏿽xAE􏿽xCD􏿽x9F􏿽xCC􏿽xB7􏿽xCC􏿽x99􏿽xCC􏿽xB2􏿽xCC􏿽x9D􏿽xCD􏿽x96Oͮ͏̮̪̝͍M􏿽xCD􏿽x8A􏿽xCC􏿽x92􏿽xCC􏿽x9A􏿽xCD􏿽xAA􏿽xCD􏿽xA9􏿽xCD􏿽xAC􏿽xCC􏿽x9A􏿽xCD􏿽x9C􏿽xCC􏿽xB2􏿽xCC􏿽x96E􏿽xCC􏿽x91􏿽xCD􏿽xA9􏿽xCD􏿽x8C􏿽xCD􏿽x9D􏿽xCC􏿽xB4􏿽xCC􏿽x9F􏿽xCC􏿽x9F􏿽xCD􏿽x99􏿽xCC􏿽x9ES􏿽xCD􏿽xAF􏿽xCC􏿽xBF􏿽xCC􏿽x94􏿽xCC􏿽xA8􏿽xCD􏿽x80􏿽xCC􏿽xA5􏿽xCD􏿽x85􏿽xCC􏿽xAB􏿽xCD􏿽x8E􏿽xCC􏿽xAD ) 16:33
ah, in-jokes.
skids
.oO( Functional thought bubbles ).oO( * masak )
16:55
PerlJam ) thinking outside of the bubble .oO( 16:59
raydiak good morning 17:11
timotimo hello raydiak :) 17:14
dalek kudo-star-daily: 5db0fac | coke++ | log/ (5 files):
today (automated commit)
17:33
vendethiel is there executable class bodies (like in ruby etc) ? 18:09
or proxies (?) are the recommended wya ?
FROGGS hello from a couch 18:33
raydiak \o from a chair
nwc10 dear camelia, please rebuild Moar 18:34
raydiak r: say $*PERL<compiler><build-date> 18:41
camelia rakudo-jvm e4e862: OUTPUT«Can't call method "syswrite" on an undefined value at /home/p6eval/jvm-rakudo/eval-client.pl line 32.␤»
..rakudo-moar e4e862: OUTPUT«2014-02-06T10:18:10Z␤»
..rakudo-parrot e4e862: OUTPUT«2014-02-06T10:24:25Z␤»
raydiak r: say $*PERL.perl 18:45
camelia rakudo-moar e4e862: OUTPUT«{"name" => "rakudo", "compiler" => {"name" => "rakudo", "ver" => "2014.01-65-ge4e8625", "release-number" => "", "build-date" => "2014-02-06T10:18:10Z", "codename" => ""}}␤»
..rakudo-jvm e4e862: OUTPUT«Can't call method "syswrite" on an undefined value at /home/p6eval/jvm-rakudo/eval-client.pl line 32.␤»
..rakudo-parrot e4e862: OUTPUT«{"name" => "rakudo", "compiler" => {"name" => "rakudo", "ver" => "2014.01-65-ge4e8625", "release-number" => "", "build-date" => "2014-02-06T10:24:25Z", "codename" => ""}}␤»
raydiak r: say "foo"
camelia rakudo-jvm e4e862: OUTPUT«Can't call method "syswrite" on an undefined value at /home/p6eval/jvm-rakudo/eval-client.pl line 32.␤»
..rakudo-parrot e4e862, rakudo-moar e4e862: OUTPUT«foo␤»
raydiak o_O 18:46
did IO::Socket break under jvm or something? 18:47
r: say 1 19:01
camelia rakudo-parrot e4e862, rakudo-moar e4e862: OUTPUT«1␤»
..rakudo-jvm e4e862: OUTPUT«Can't call method "syswrite" on an undefined value at /home/p6eval/jvm-rakudo/eval-client.pl line 32.␤»
raydiak (or perhaps the jvm evalserver crashed?) 19:02
FROGGS evalbot control restart 19:03
FROGGS r: say 1 # this will take a while 19:04
camelia rakudo-parrot e4e862, rakudo-moar e4e862: OUTPUT«1␤» 19:05
..rakudo-jvm e4e862: OUTPUT«Can't call method "syswrite" on an undefined value at /home/p6eval/jvm-rakudo/eval-client.pl line 32.␤»
FROGGS :/
vendethiel DAMMIT I forgot to report the bug 19:30
well admittedly I only got on the comp for an hour or so during the day :/
itz is "ufo" obsolete? 19:36
colomon itz: I know I haven't used it (directly, anyway) in at least a year 19:37
might still work, I dunno
itz I was finding a ufo-m modified version useful 19:38
timotimo i've sometimes used ufo 19:39
it doesn't do custom Build.pm, though
FROGGS itz: there is a fork on github for ufo-m 19:42
timotimo ooooh 19:43
a fork or a branch?
FROGGS a fork 19:44
github.com/iProcess/mufow64 19:45
ohh, it is not a fork actually
timotimo i have never heard of this person or this ... thing 19:47
FROGGS timotimo: his nick is V_C_S 19:48
itz thats identical to my fork :)
FROGGS err, V_S_C probably
timotimo ah, yes!
FROGGS I'd prefer a ufo version that does the right thing depending on the currently used backed 19:49
itz I was wondering about that...
timotimo yes
FROGGS because in the end it is just about three or four different lines of code
itz it might be useful as a stopgap before panda works 19:50
itz perl6: say $?VM 20:00
camelia niecza v24-109-g48a8de3: OUTPUT«Unhandled exception: System.NullReferenceException: Object reference not set to an instance of an object␤ at Niecza.StashCursor.Core (System.String key, Boolean final, Niecza.StashCursor& sc, Niecza.Variable& v, Niecza.Variable bind_to) [0x00000] i…» 20:01
..rakudo-jvm e4e862: OUTPUT«Can't call method "syswrite" on an undefined value at /home/p6eval/jvm-rakudo/eval-client.pl line 32.␤»
..rakudo-parrot e4e862, rakudo-moar e4e862: OUTPUT«===SORRY!=== Error while compiling /tmp/tmpfile␤Variable '$?VM' is not declared␤at /tmp/tmpfile:1␤------> say $?VM⏏<EOL>␤ expecting any of:␤ postfix␤»
Augustus Hi guys, I have a (hopefully) quick question. Can anyone explain the conditions where a grammar *does NOT* do longest token matching, and how do you force it to do LTM? 20:06
FROGGS Augustus: /[ a || b ]/ does sequential matching, while /[ a | b ]/ does LTM 20:08
Augustus yes, but not under all conditions
moritz m: say (1, 2, 18).max 20:09
camelia rakudo-moar e4e862: OUTPUT«18␤»
moritz m: say (1, 2, 18).minmax
camelia rakudo-moar e4e862: OUTPUT«1..18␤»
Augustus I need to know how to force [a | b] to do LTM when it doesn't
FROGGS p: say "aabbabbbbbbbbbbbbb" ~~ / b+ /
camelia rakudo-parrot e4e862: OUTPUT«「bb」␤␤»
moritz you can't force LTM; you can only avoid things that are LTM stoppers 20:10
FROGGS Augustus: do you mean that?
moritz Augustus: perlcabal.org/syn/S05.html#Longest-...n_matching has the gory details
Augustus moritz: what are LTM stoppers?
moritz: I read through S05 and it was a little dense
FROGGS code blocks for example
Augustus as far as I can tell I'm not doing any of those things
moritz Augustus: then show your code 20:11
FROGGS what moritz said
Augustus <var> '=' [<expr> | <term>]
simple example, but it's not doing LTM
moritz well, LTM descends into subrules
moritz so it only LTMs if <expr> and <term> both do LTM 20:12
FROGGS now we'd need to know how expr and term looks like
Augustus they consist of literals and alternations only, or subrules that are literals or alternations
moritz then you have found a bug. 20:13
FROGGS can you create a self containing example? a simple script that you can put in a gist?
Augustus the grammar i have is only 30 lines long with a few rules in the first place. what do you mean by put in a gist? 20:15
skids gist.github.com 20:16
FROGGS Augustus: well, put that grammar in a gist (github's nopaste), including a test string and the invocation of the grammar
that that we just need to download an run it, to see something
(every nopaste service is fine) 20:17
moritz r: say (1..5).from 20:18
camelia rakudo-jvm e4e862: OUTPUT«Can't call method "syswrite" on an undefined value at /home/p6eval/jvm-rakudo/eval-client.pl line 32.␤»
..rakudo-parrot e4e862, rakudo-moar e4e862: OUTPUT«No such method 'from' for invocant of type 'Range'␤ in block at /tmp/tmpfile:1␤␤»
moritz r: say (1..5).min
camelia rakudo-parrot e4e862, rakudo-moar e4e862: OUTPUT«1␤»
..rakudo-jvm e4e862: OUTPUT«Can't call method "syswrite" on an undefined value at /home/p6eval/jvm-rakudo/eval-client.pl line 32.␤»
Augustus moritz, FROGGS: Here is just the grammar, see if it's obvious. I can also upload the whole script too. gist.github.com/anonymous/8851771 20:19
moritz Augustus: which string exhibits non-LTM behavior?
itz r: say $*VM<name> 20:20
Augustus moritz, FROGGS: in particular, the assignment rule always matches a term instead of taking a longer expression, so "x = 2 + 3" will match "x = 2" and leave the "+ 3"
camelia rakudo-moar e4e862: OUTPUT«moar␤»
..rakudo-jvm e4e862: OUTPUT«Can't call method "syswrite" on an undefined value at /home/p6eval/jvm-rakudo/eval-client.pl line 32.␤»
..rakudo-parrot e4e862: OUTPUT«parrot␤»
moritz Augustus: oh; rules imply <.ws>, and <.ws> stops LTM
mystery solved.
Augustus hmm, ok, how do I stop that?
moritz don't use rule, or try writing your own ws that doesn't stop LTM 20:21
FROGGS make it a token and replace possible whitespace by \s* ?
Augustus ahh, ok
tokens will still match subrules/subtokens?
FROGGS yes 20:22
Augustus ok, i'll give that a try and let you know. thanks!
FROGGS cool :o)
Augustus awesome, thanks, that worked. Is there a good place to see a summary of the differences between rules and tokens? 20:24
moritz S05 :-) 20:28
skids This section in particular: perlcabal.org/syn/S05.html#Regexes_...ng_strings 20:30
Augustus moritz: ok, I'll keep going through S05 ;) One more quick question. How would you recommend doing optional parenthesis around an expression? Make another rule that says ['('<expr>')'] | <expr> or is there a way to do it with ? like so: '('? <expr> ')'? except the second one isn't optional if the first one is found?
moritz Augustus: ['('<expr>')'] | <expr> 20:31
Augustus moritz: Ok. it is possible, though, with backreferences or something, to do it the other way, right? It's just more complicated? 20:32
skids: Thanks, that is helpful
moritz well, you can do things with capturing the optional '(' and then using an assertion when matching the the closing ')' 20:33
Augustus moritz: Ok. I'm curious to try doing that just to learn how all the stuff works. I'll look at the assertions section. 20:34
moritz masak: github.com/moritz/world-map run perl6-m map.pl > test.svg; firefox test.svg; 20:43
psch hi #perl6 20:49
i'm doing things wrong again \o/ 20:50
i've been trying to factor out the typed exception code from World and Optimizer into a role
jnthn psch: UR DOING IT RONG
FROGGS RONG /o\
psch but in the role i get a 'Cannot invoke null object' when trying to call subst() 20:50
jnthn So am I, though. Just lost 30 mins debugging 'cus I confused bits with bytes...
psch: Yeah, known NQP limitation :( 20:51
Not your fault.
psch jnthn: so nqp core functions can't be invoked from roles?
jnthn psch: Yeah. There's a bug in that area. Rakudo has a bunch of code that deals with the issue.
psch: For now I can only really suggest copying subst, and filing an NQP ticket saying "arghh fix this" 20:52
psch well, that's slightly reassuring at least, in so far as it's not actively my fault :) 20:53
i'll go with copying subst i guess; where should the ticket go? 20:54
masak wow, moritz++! 20:55
masak tries it
psch oh, also i've just now built my patch for parrot, and it doesn't die there, in contrast to moar..? 20:56
timotimo moritz: now make one that's able to distort the sizes of countries based on some number data :D 20:57
jnthn psch: Add it as an NQP ticket (GitHub issues, perl6/nqp) 21:00
psch: Moar has stricter closure rules.
psch: JVM will end up following the same rules as Moar, when I get time to do the rather painful refactors.
psch jnthn: alright, will do, thanks
jnthn psch: The JVM approach suffers a few threading-related bugs. 21:01
timotimo the stricter rules are wanted then?
jnthn timotimo: Yes, they make us fix bugs in code-gen, etc.
timotimo that's good
psch gist.github.com/peschwa/8852488 # can i have a bit of advice or an explanation for this as well? 21:09
i'm not sure i should change the signature or the callers, seeing as it's all over World and Actions 21:10
updated to make it obvious that there's not a random string but the exception name in the broken case 21:11
timotimo it would seem like getting an iterator of a string, you'll get individual characters
nqp: say(nqp::islist("FooBar"));
camelia nqp-moarvm, nqp-jvm, nqp-parrot: OUTPUT«0␤» 21:12
timotimo er.
actually you have a list with strings in it
psch timotimo: exactly, but i still get letters
or characters rather
timotimo oh
you shouldn't put a new my in an inner block
psch oh, right 21:13
timotimo also, if you are in the last line where you join(...), you may have $ex_type be just a string
you should use @ex_name instead
psch that does explain how the error message comes i guess 21:15
timotimo yes :) 21:17
psch .oO( stupid crashing vm *grumble* ) 21:23
skids
.oO(why doesn't nqp-jvm also have the syswrite error)
21:33
japhb_ What's the right syntax for destructuring a pair? I want to do: for @pairs -> ... syntax here for extracting $k and $v ... { # Now I can just directly talk about the k/v of each pair 21:59
japhb_ I guess I can do: for @pairs>>.kv -> $k, $v { # but that feels repetitive 22:01
psch m: my %a = { a => 1, b => 2 }; for %a -> $k, $v { say "$k: $v" } # this? 22:03
camelia rakudo-moar e4e862: OUTPUT«a 1: b 2␤»
psch huh
no, probably not
masak m: my $p = "foo" => 42; for $p xx 4 -> (:$key, :$value) { say "$key maps to $value" }
camelia rakudo-moar e4e862: OUTPUT«foo maps to 42␤foo maps to 42␤foo maps to 42␤foo maps to 42␤»
psch i don't even understand what it actually does
masak japhb_: ^^ 22:04
japhb_ psch, I've specifically got an array of pairs, not a hash.
masak++
Thanks!
masak bows
psch japhb_: right, i don't read thoroughly enough, you mentioned the array, sorry
japhb_ psch, No worries. :-) 22:05
japhb_ r: my @a = foo => 1, bar => 2; @a.perl.say; for @a.list -> (:$k, :$v) { .say for $k.perl, $v.perl } 22:06
camelia rakudo-parrot e4e862: OUTPUT«Array.new("foo" => 1, "bar" => 2)␤2 unexpected named parameters passed (key, value) in sub-signature␤ in block at /tmp/tmpfile:1␤␤»
..rakudo-jvm e4e862: OUTPUT«Can't call method "syswrite" on an undefined value at /home/p6eval/jvm-rakudo/eval-client.pl line 32.␤»
..rakudo-moar e4e862: OUTPUT«Array.new("foo" => 1, "bar" => 2)␤␤ in block at /tmp/tmpfile:1␤␤»
japhb_ r: my @a = foo => 1, bar => 2; @a.perl.say; for @a -> (:$k, :$v) { .say for $k.perl, $v.perl }
camelia rakudo-parrot e4e862: OUTPUT«Array.new("foo" => 1, "bar" => 2)␤2 unexpected named parameters passed (key, value) in sub-signature␤ in block at /tmp/tmpfile:1␤␤»
..rakudo-jvm e4e862: OUTPUT«Can't call method "syswrite" on an undefined value at /home/p6eval/jvm-rakudo/eval-client.pl line 32.␤»
..rakudo-moar e4e862: OUTPUT«Array.new("foo" => 1, "bar" => 2)␤␤ in block at /tmp/tmpfile:1␤␤»
japhb_ OK, what's wrong there? 22:07
skids doesn't even know how masak's example worked.
psch i think :key and :value are magic there
masak no, not really.
a Pair is an object.
japhb_ r: my @a = foo => 1, bar => 2; @a.perl.say; for @a -> (:$key, :$value) { .say for $key.perl, $value.perl }
camelia rakudo-parrot e4e862, rakudo-moar e4e862: OUTPUT«Array.new("foo" => 1, "bar" => 2)␤"foo"␤1␤"bar"␤2␤»
..rakudo-jvm e4e862: OUTPUT«Can't call method "syswrite" on an undefined value at /home/p6eval/jvm-rakudo/eval-client.pl line 32.␤»
masak m: say Pair.^attributes
camelia rakudo-moar e4e862: OUTPUT«Mu $!key Mu $!value␤» 22:08
japhb_ >.<
raydiak r: my @a = foo => 1, bar => 2; @a.perl.say; for @a -> (:key($k), :value($v)) { .say for $k.perl, $v.perl }
japhb_ OK, I understand.
camelia rakudo-parrot e4e862, rakudo-moar e4e862: OUTPUT«Array.new("foo" => 1, "bar" => 2)␤"foo"␤1␤"bar"␤2␤»
..rakudo-jvm e4e862: OUTPUT«Can't call method "syswrite" on an undefined value at /home/p6eval/jvm-rakudo/eval-client.pl line 32.␤»
masak rakudo-jvm seems busted.
psch huh
japhb_ Yeah, quite.
raydiak I was complaining about that hours ago
psch ooh the -> ( ) takes a Pair? 22:08
masak don't need complaining. need moritz++ or equivalent.
psch: no, the -> ( ) takes an object.
psch oh, now i get it 22:09
japhb_ psch, masak's point was that Pair is not special. It's just an object. So it can be destructured as one using standard subsignature methods.
psch the array has pairs
of course
that was the whole point amirite
masak see S06:1791 22:10
synopsebot Link: perlcabal.org/syn/S06.html#line_1791
japhb_ Yeah, I was stuck thinking of finding a syntax that was similarly special to destructuring of arrays.
But I didn't need that.
masak nope.
there's one syntax for arrays, and one for objects.
confusingly, the array one is [], but the objects one is ()
it has to be that way because {} is taken for the block itself :)
japhb_ Mind you, 'for @a -> (:$key, :$value)' is not much better than 'for @a>>.kv -> $k, $v' for concision. 22:11
raydiak *shrug* didn't know who to talk to, so I though a general public mention might get someone's attention eventually...FROGGS++ tried restarting it with no change
jnthn masak: Note that you can use (...) for arrays too 22:12
PerlJam japhb_: the latter would have been clearer IMHO 22:13
jnthn masak: [...] forces a Positional type constraint also, iirc
japhb_ r: my @a = foo => 1, bar => 2; @a.perl.say; for @a>>.kv -> { .say for $^k.perl, $^v.perl }
camelia rakudo-parrot e4e862, rakudo-moar e4e862: OUTPUT«===SORRY!=== Error while compiling /tmp/tmpfile␤Placeholder variable '$^k' cannot override existing signature␤at /tmp/tmpfile:1␤------> >>.kv -> { .say for $^k.perl, $^v.perl }⏏<EOL>␤ …»
..rakudo-jvm e4e862: OUTPUT«Can't call method "syswrite" on an undefined value at /home/p6eval/jvm-rakudo/eval-client.pl line 32.␤»
japhb_ r: my @a = foo => 1, bar => 2; @a.perl.say; for @a>>.kv { .say for $^k.perl, $^v.perl }
camelia rakudo-parrot e4e862, rakudo-moar e4e862: OUTPUT«Array.new("foo" => 1, "bar" => 2)␤"foo"␤1␤"bar"␤2␤»
..rakudo-jvm e4e862: OUTPUT«Can't call method "syswrite" on an undefined value at /home/p6eval/jvm-rakudo/eval-client.pl line 32.␤»
masak jnthn: oh, that makes sense. 22:14
japhb_ Hmmm, that may be even better for very simple loops.
masak r: my @a = foo => 1, bar => 2; for @a { say .key.perl; say .value.perl } 22:20
camelia rakudo-jvm e4e862: OUTPUT«Can't call method "syswrite" on an undefined value at /home/p6eval/jvm-rakudo/eval-client.pl line 32.␤»
..rakudo-parrot e4e862, rakudo-moar e4e862: OUTPUT«"foo"␤1␤"bar"␤2␤»
masak I'd do it that way, I think. 22:20
skids never knew attributes could explode into subsignatures. Thought just things that looked more like named args. 22:21
skids Funny distinction of attribute vs accessor method there. 22:32
r-parrot: sub foo((:$a,:$b)) { $a.perl.say; $b.perl.say }; class c { has $.a; method b () { $!a }}; my c $c .= new(:a<a>); $c.b.say; foo($c) # virtual attribs need not apply 22:34
r-p: sub foo((:$a,:$b)) { $a.perl.say; $b.perl.say }; class c { has $.a; method b () { $!a }}; my c $c .= new(:a<a>); $c.b.say; foo($c) # virtual attribs need not apply 22:35
camelia rakudo-parrot e4e862: OUTPUT«a␤"a"␤Any␤»
timotimo it differentiates into attributes and methods? :o
skids Yeah that's what threw me.
It is what the spec says. 22:36
timotimo well, a method kind of smells like impure, global-state-mutating, ...
psch hrm 22:38
i'm really not quick today
subst references match
and declaring subst as sub or method in my role doesn't work
so each of the two calls to subst need to be fully unrolled calls to subst, with nested calls to match
that definitely makes me sad 22:39
masak :/
timotimo i have a headache and don't understand what happened
skids commute 22:40
jnthn psch: Well, other solution is adding before your role a "my class Hacks { method subst(*@x) { subst(|@x) } }" and then Hacks.subst(...)
psch jnthn: that sounds a bit more brain-friendly right now 22:41
masak 'night, #perl6 22:50
jnthn 'night, masak 22:52
timotimo good night masak
psch jnthn++, timotimo++ # refactoring help 23:08
i'm down to 18 failing tests that should pass, which is something like 400% improvement \o/ 23:09
timotimo that sounds great good work
psch timotimo: well, most of it was subst not getting resolved 23:10
the ones that fail now probably are because of things i don't quite get yet
but i don't think i have the brains to keep going now
e.g. "not ok 696 - right exception type (X::Method::NotFound)\n# Got: (X::Redeclaration)\n# Expected: (X::Method::NotFound)" 23:11
what's most confusing to me right now is that some cases of X::Syntax::Confused also don't pass anymore
but yeah, i'll look into that tomorrow or over the weekend
there's also still a few bits of code i still have to pull into the role i think 23:12
psch actually i think no case for X::Syntax::Confused passes anymore, with "Error while compiling type" 23:13
anyway, i'll be back tomorrow or over the weekend o/ 23:14