Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2017-05-09

Perl 6 | Reference Documentation | Rakudo

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:02 Actualeyes joined #perl6
00:07 john51 joined #perl6
00:09 mcmillhj joined #perl6
00:15 Cabanossi joined #perl6
00:16 kurahaupo joined #perl6
00:17 BenGoldberg joined #perl6
00:26 itsame joined #perl6
00:30 pierre_ joined #perl6
00:32 mcmillhj_ joined #perl6
00:33 kurahaupo joined #perl6
00:33 lookatme joined #perl6
00:44 mcmillhj_ joined #perl6
01:00 lookatme morning, morning ..
01:01 raschipi Look at the European
01:02 mcmillhj_ joined #perl6
01:05 lookatme Here is +8 zone
01:05 kurahaupo joined #perl6
01:07 raschipi Even more European than the people that live in Europe, than.
01:10 lookatme Em --?
01:10 pierre_ joined #perl6
01:15 cyphase joined #perl6
01:16 kurahaupo joined #perl6
01:17 xinming joined #perl6
01:18 mcmillhj_ joined #perl6
01:18 kurahaupo_ joined #perl6
01:19 imcsk8 joined #perl6
01:28 mcmillhj_ joined #perl6
01:35 haxmeister so zef is failing to install Selenium::WebDriver with the following error:  https://pastebin.com/77kKeCHe
01:36 itsame joined #perl6
01:36 haxmeister and it locks up there too... have to ^c to get out of it
01:47 Cabanossi joined #perl6
01:47 mcmillhj_ joined #perl6
01:53 itaipu joined #perl6
01:55 lookatme I think it's problem of Selenium::WebDriver.
01:55 lookatme The test failed.
01:55 haxmeister well I have chromium browser.. and it popped open like 15 windows due to the test
01:56 haxmeister I just installed chrome browser.. maybe it will succeed??..
01:57 lookatme Is the document of the module said something about test ?
01:57 lookatme Such as you have install something .. etc
01:58 haxmeister nope
01:58 haxmeister is chrome test
01:58 haxmeister of some sort
01:58 haxmeister launches chrome windows to nowhere
02:02 haxmeister look at screenshot http://imgur.com/fRRNZBr
02:04 lookatme I don't know..
02:04 haxmeister weird eh?
02:05 lookatme Em, maybe it's a bug...
02:05 lookatme Have you google it ?
02:06 mcmillhj joined #perl6
02:07 haxmeister no.. I'm digging
02:10 lookatme Em, I notice that have a ChromeDriver, have you installed it ?
02:11 choz joined #perl6
02:11 choz mornin all
02:12 choz im newb in perl, anyone knows what is '\$6' in this command do? `perl -e 'print crypt("password","\$6") . "\n"'`
02:13 haxmeister encryption level?
02:13 choz is that a variable?
02:14 choz coz when i try to run it, it'd return nothing..
02:15 raschipi choz: It's not, the "$" is being escaped.
02:15 raschipi But I have no idea what it means, though.
02:15 Cabanossi joined #perl6
02:15 colomon_ joined #perl6
02:15 choz i see
02:16 choz anyway, thx fyi raschipi n haxmeister
02:16 MasterDuke_ i think that's the salt. at maybe it's saying to run 6 rounds of crypt?
02:16 raschipi That's another language. There's two with the same name.
02:16 MasterDuke_ *and maybe
02:16 choz oh
02:16 raschipi We talk Perl6, but that's Perl5.
02:17 geekosaur on linux that means to use sha-512
02:17 geekosaur man 3 crypt
02:18 haxmeister $1 would be md5 crypt
02:18 lookatme It's a salt `char *crypt(const char *key, const char *salt);`
02:19 choz so \$6 is an ID of glibc salt
02:19 haxmeister $6 sha-512
02:19 choz ive got it not
02:19 choz now*
02:19 geekosaur lookatme, that interpretation is 7th edition unix
02:19 geekosaur it does more now
02:19 haxmeister have to escape the $ for bash to send it proper
02:19 choz i think ive got what i have to do next..
02:20 choz tq wizards..
02:20 geekosaur no, it's single quoted. but it's in a double quoted perl string inside the single quoted shell string, because you can't nest a single quoted string inside another in a shell
02:20 haxmeister ^this
02:20 geekosaur so it has to escape the $ against perl
02:20 haxmeister he's right^
02:20 geekosaur (alternately they could have used q/$6/ or something)
02:20 haxmeister selenium :(
02:22 mcmillhj joined #perl6
02:32 haxmeister interesting... it doesnt' like the chromedriver that comes with chromium and to install chromdriver independantly I have to uninstall chromium
02:32 haxmeister oh the life...
02:32 haxmeister we'll see if it works this time
02:36 olinkl joined #perl6
02:36 mcmillhj joined #perl6
02:37 haxmeister failed again
02:38 haxmeister https://pastebin.com/Bssi9TT0
02:41 haxmeister man I have no idea what to do with that information
02:42 MasterDuke_ looks like File::Temp failed a test, but the test has something to do with GC, so maybe it's just a timing error or something like that
02:43 haxmeister I don't even know what GC is referring too
02:43 MasterDuke_ could manually install File::Temp with --force and then try Selenium::WebDriver again
02:43 MasterDuke_ garbage collection
02:43 haxmeister ah ok
02:44 haxmeister I'll try again with no changes
02:45 MasterDuke_ yeah, it might be good to create an issue in the File::Temp repo if the test is failing for no good reason
02:45 haxmeister passed temp that time
02:45 Cabanossi joined #perl6
02:45 * haxmeister fingers crossed
02:46 cpage_ joined #perl6
02:46 choz just realized my crypt didnt work because i didnt close the last '$'.. finally got it working with `perl -e 'print crypt("Awe378437", "\$6\$"). "\n"'`.. tq for your guys help, really saved me lots of trouble
02:46 haxmeister passed the chrome.t test this time too
02:46 choz left #perl6
02:47 haxmeister success?!?!?
02:47 lookatme ...
02:47 lookatme I tried install File::Temp, no error
02:48 lookatme It's not stable. :)
02:51 mcmillhj joined #perl6
02:54 haxmeister the install succeded thsi time
02:55 haxmeister so I'll to a little test after a break
02:55 wamba joined #perl6
02:57 lookatme It's not easy install that module .. XD
03:05 mcmillhj joined #perl6
03:08 haxmeister simple test script worked
03:09 haxmeister well.. partially
03:14 Cabanossi joined #perl6
03:16 mcmillhj joined #perl6
03:30 samcv lookatme, os?
03:31 lookatme os ??
03:32 mcmillhj joined #perl6
03:34 lookatme samcv, what the mean? fedora 25 ?.
03:35 samcv that is an acceptable answer
03:35 lookatme :)
03:36 samcv you colud steal my implementation
03:36 samcv https://github.com/perl6/doc/blob/master/htmlify.p6#L962-L970
03:36 aborazmeh joined #perl6
03:36 aborazmeh joined #perl6
03:36 samcv the extra code is qust to code for that 1 in a million chance that you get the same one. but very important for langer running programs
03:37 lookatme What implementation ? Oh I just test that File::Temp installation
03:37 samcv oh so you aren't usig tnhe module directly
03:37 lookatme I don't need that module
03:37 samcv oh ok
03:37 lookatme Yeah..
03:38 samcv Your printf-style directives specify 1 argument, but 1000000 arguments were supplied
03:38 samcv hehehe
03:38 samcv 1 million arguments
03:41 lookatme OH, I see it.
03:42 lighttrr joined #perl6
03:44 lookatme The temp file will save on the disk ?
03:45 samcv idk what command are you using?
03:46 samcv the code i linked or something else
03:47 lookatme It's better create a FIFO file instead of that temp file on the disk.
03:47 samcv depends on what you're doing
03:48 mcmillhj joined #perl6
03:48 lookatme Yeah
03:50 lookatme Have lunch now, see you.
04:05 itsame joined #perl6
04:06 mcmillhj joined #perl6
04:07 itsame joined #perl6
04:16 CIAvash joined #perl6
04:23 mcmillhj joined #perl6
04:39 mcmillhj joined #perl6
04:42 curan joined #perl6
04:43 Cabanossi joined #perl6
04:51 itsame joined #perl6
05:09 geekosaur joined #perl6
05:13 xtreak joined #perl6
05:25 mcmillhj joined #perl6
05:29 Cabanossi joined #perl6
05:37 itsame joined #perl6
05:38 skaji joined #perl6
05:40 wamba joined #perl6
05:43 mcmillhj joined #perl6
05:44 TeamBlast joined #perl6
05:45 domidumont joined #perl6
05:46 domidumont joined #perl6
05:49 grondilu Hello, I was looking at http://rosettacode.org/wiki/Bernoulli_numbers#Perl_6, and I tried to shorten it a bit by making @a a state variable.
05:49 grondilu Turns out state @a = ... fails, but (state @a) = ... works.
05:50 grondilu I'm not sure the semantics is supposed to be different.
05:51 lookatme joined #perl6
05:51 itsame joined #perl6
05:52 m0ltar joined #perl6
05:53 domidumont joined #perl6
05:55 anton_p joined #perl6
06:00 pierre_ joined #perl6
06:02 mcmillhj joined #perl6
06:04 grondilu m: say gather for ^Inf { (state @a) = 1/($_+1), +@a*(@a.shift-*) ... {!@a}; take @a.tail if @a.tail }[^10]
06:04 camelia rakudo-moar 20cfd6: OUTPUT: «(1 0.5 0.166667 -0.033333 0.023810 -0.033333 0.075758 -0.253114 1.166667 -7.092157)␤»
06:04 grondilu m: say gather for ^Inf { state @a = 1/($_+1), +@a*(@a.shift-*) ... {!@a}; take @a.tail if @a.tail }[^10]
06:04 camelia rakudo-moar 20cfd6: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Cannot use variable @a in declaration to initialize itself␤at <tmp>:1␤------> 3ather for ^Inf { state @a = 1/($_+1), +@7⏏5a*(@a.shift-*) ... {!@a}; take @a.tail i␤    expecting any of:␤      …»
06:05 grondilu this makes sense, not sure why I had a different message earlier
06:10 itsame joined #perl6
06:14 mcmillhj joined #perl6
06:15 itsame joined #perl6
06:19 lowbro joined #perl6
06:20 lowbro joined #perl6
06:26 mcmillhj joined #perl6
06:28 wamba joined #perl6
06:29 Cabanossi joined #perl6
06:36 xtreak joined #perl6
06:40 mcmillhj joined #perl6
06:42 itsame joined #perl6
06:44 xtreak joined #perl6
06:52 darutoko joined #perl6
06:53 mcmillhj joined #perl6
06:55 astj_ joined #perl6
06:58 labster joined #perl6
07:05 ChoHag joined #perl6
07:05 espadrine joined #perl6
07:09 mcmillhj joined #perl6
07:09 parv joined #perl6
07:11 ufobat joined #perl6
07:11 itsame joined #perl6
07:14 Cabanossi joined #perl6
07:20 itsame joined #perl6
07:21 domidumont joined #perl6
07:23 zakharyas joined #perl6
07:23 abraxxa joined #perl6
07:27 mcmillhj joined #perl6
07:30 aindilis` joined #perl6
07:43 * lizmat_ clickbaits https://p6weekly.wordpress.com/2017/05/08/2017-19-albatross_i/
07:45 parv lizmat, like the name of the command "fix_windows10" ;->
07:46 mcmillhj joined #perl6
07:48 sena_kun joined #perl6
07:50 itsame joined #perl6
07:51 AlexDaniel joined #perl6
07:51 mithaldu_ joined #perl6
07:51 g4 joined #perl6
07:51 g4 joined #perl6
07:52 lizmat parv: can't take any credit for it  :-)
07:52 * lizmat is just the messenger on that one
07:54 parv lizmat, thing is i don't know who made that; so here is hoping the messenger would pass back my message.
07:55 lizmat El_Che: ^^^
07:55 parv Aye.
07:56 parv El_Che, interesting command name there, "fix_windows10".
07:56 lookatme :) fix_bug10
07:59 mcmillhj joined #perl6
08:04 jonas1 joined #perl6
08:05 itsame joined #perl6
08:11 mcmillhj joined #perl6
08:12 rindolf joined #perl6
08:14 Cabanossi joined #perl6
08:17 astj joined #perl6
08:21 parv joined #perl6
08:23 samcv .tell Zoffix docs still mention slurp-rest for Proc objects https://docs.perl6.org/type/Proc
08:23 yoleaux samcv: I'll pass your message to Zoffix.
08:27 mcmillhj joined #perl6
08:27 wigner joined #perl6
08:34 wamba joined #perl6
08:35 lookatme samcv, slurp-rest still working for Proc
08:35 samcv i know it still works
08:36 samcv that's not the issue. just zoffix is updating the docs to mention 'slurp' instead and that be the preferred one
08:36 samcv lookatme, see message here: https://docs.perl6.org/routine/slurp-rest
08:40 lookatme I see. But in 6.c we still have this method, right ?
08:43 ChoHag joined #perl6
08:43 mcmillhj joined #perl6
08:48 u-ou which operator should I use to compare two objects?
08:48 u-ou I know that eq is for strings and == is for numbers so what is for objects?
08:48 moritz u-ou: what semantics do you want out of the comparison?
08:49 moritz m: class A { has $.x }; say A.new(:x(5)) eqv A.new(:x(5)); say A.new(:x(5)) === A.new(:x(5));
08:49 camelia rakudo-moar 20cfd6: OUTPUT: «True␤False␤»
08:49 moritz http://stackoverflow.com/questions/176343/whats-the-deal-with-all-the-different-perl-6-equality-operators-eq
08:50 u-ou that they're the same object
08:50 moritz === then
08:51 u-ou thank you
08:54 lookatme u-ou, you can provides a overload of infix:<==> for your class
08:54 u-ou cool
08:55 lookatme m: class A { has $.x }; multi sub infix:<==>(A $a, A $b) { say "CALL ME"; True; };  say A.new(:x(5)) === A.new(:x(5));
08:55 camelia rakudo-moar 20cfd6: OUTPUT: «False␤»
08:55 lookatme m: class A { has $.x }; multi sub infix:<==>(A $a, A $b) { say "CALL ME"; True; };  say A.new(:x(5)) == A.new(:x(5));
08:55 camelia rakudo-moar 20cfd6: OUTPUT: «CALL ME␤True␤»
08:55 mcmillhj joined #perl6
08:55 xtreak joined #perl6
08:57 samcv lookatme, yes we still have it. but they do *mostly* the same thing
08:57 lookatme samcv, I wonder why they name that method **slurp-rest**.
08:58 moritz m: say 1.WHICH.^name
08:58 camelia rakudo-moar 20cfd6: OUTPUT: «ObjAt␤»
08:58 samcv well. we have slurp now. instead of having slurp and slurp-rest
08:58 samcv but slurp and slurp rest literally slurp to the end of the file. but that's basically implied
08:58 samcv no reason to say rest
08:58 moritz m: class A { has $.x; method WHICH() { ObjAt.new('A') } }; A.new(x=>5) === A.new(x => 6)
08:58 camelia rakudo-moar 20cfd6: OUTPUT: «WARNINGS for <tmp>:␤Useless use of "===" in expression ".new(x=>5) === A.new(x => 6)" in sink context (line 1)␤»
08:59 moritz m: class A { has $.x; method WHICH() { ObjAt.new('A') } }; say A.new(x=>5) === A.new(x => 6)
08:59 camelia rakudo-moar 20cfd6: OUTPUT: «True␤»
08:59 moritz a very egalitarian class
08:59 samcv otherwise would be like .slurp-from-beginning or something weird
08:59 moritz iirc the question was whether .slurp on a file handle would close the file handle or not
08:59 moritz and the reaction was to rename slurp on file handles to something different
09:00 moritz but why -rest, I don't know
09:04 xtreak joined #perl6
09:06 mcmillhj joined #perl6
09:18 pierre_ joined #perl6
09:25 El_Che lo
09:28 scovit joined #perl6
09:29 scovit hello, where could I find the documentation about the behaviour of Closures in Perl 6?
09:29 xtreak joined #perl6
09:29 Cabanossi joined #perl6
09:29 scovit found this https://en.wikibooks.org/wiki/Perl_6_Programming/Blocks_and_Closures
09:30 scovit is it possible to introspect the state of a Closure?
09:30 scovit like know which variables are in the scope, what is their value, change their value
09:31 lookatme https://docs.perl6.org/language/functions#Closures
09:31 lookatme scovit, check out this page
09:33 scovit lookatme, thank you. I would like to know if it is possible to manipulate their state?
09:33 lookatme I think you want this : https://docs.perl6.org/language/packages#Pseudo-packages
09:35 lookatme m: { my $x = 10; say MY::.keys; }
09:35 camelia rakudo-moar 20cfd6: OUTPUT: «($_ $*DISPATCHER $x)␤»
09:37 scovit good hints! thanks
09:38 lookatme Em, :)
09:54 geekosaur joined #perl6
09:54 z8 joined #perl6
09:55 pierre_ joined #perl6
10:00 scovit lookatme, I am trying to understand. For packages I understand it might be possible to achieve what I would like, and that is maybe what I should focus on. What about blocks?
10:00 scovit m: sub ciao(&code) { my $j = "due"; say &code::.keys; }; my $i = "perl"; ciao { say "here"; };
10:00 camelia rakudo-moar 20cfd6: OUTPUT: «(0)␤»
10:01 scovit also, could I create a Package on-the-fly as a closure?
10:04 jnthn Perl 6 is pretty strict about lexicals staying lexical
10:05 jnthn There's no way in general to introspect what a closure closes over
10:05 jnthn It is possible to obtain MY:: and pass *that* around
10:06 jnthn But the compiler is otherwise free to optimize lexical variables aggressively, including erasing information that would allow their introspection, short of seeing something that requires it in scope (like MY:: or EVAL)
10:11 zakharyas joined #perl6
10:18 wamba joined #perl6
10:19 astj joined #perl6
10:29 Cabanossi joined #perl6
10:31 astj joined #perl6
10:34 Geth ¦ doc: 164d5534bc | (Zoffix Znet)++ | doc/Type/Proc.pod6
10:34 Geth ¦ doc: Remove .slurp-rest from Proc examples; samcv++
10:34 Geth ¦ doc: review: https://github.com/perl6/doc/commit/164d5534bc
10:45 kurahaupo joined #perl6
10:51 xtreak joined #perl6
11:00 LeCamarade joined #perl6
11:06 eady joined #perl6
11:11 bioduds joined #perl6
11:12 bioduds Hello, is this support channel?
11:13 bioduds I'm getting this weird error
11:13 bioduds ===SORRY!=== QAST::Block with cuid 2 has not appeared
11:13 bioduds Someone knows what it is related to?
11:13 moritz what code did you run?
11:14 Cabanossi joined #perl6
11:14 bioduds Just trying to implement a test module
11:14 bioduds use v6;  # SOME DECLARATIVE CODE exemples subset Natural of Int where * >= 0; subset FirstName of Str where 0 < *.chars < 256;
11:16 moritz m: use v6; subset Natural of Int where * >= 0; subset FirstName of Str where 0 < *.chars < 256;
11:16 camelia rakudo-moar 20cfd6: OUTPUT: «===SORRY!===␤QAST::Block with cuid 2 has not appeared␤»
11:16 moritz looks like a bug to me
11:16 moritz m: use v6; subset Natural of Int where * >= 0; subset FirstName of Str where { 0 < .chars < 256} ;
11:16 camelia rakudo-moar 20cfd6: ( no output )
11:16 moritz bioduds: seems to work with a {} closure
11:17 moritz m: subset Foo of Int where 0 < * < 3
11:17 camelia rakudo-moar 20cfd6: ( no output )
11:17 moritz m: subset Foo of Int where 0 < *.sqrt < 3
11:17 camelia rakudo-moar 20cfd6: OUTPUT: «===SORRY!===␤QAST::Block with cuid 1 has not appeared␤»
11:17 moritz m: subset Foo of Int where 0 < *.sqrt
11:17 camelia rakudo-moar 20cfd6: ( no output )
11:17 moritz m: subset Foo of Int where 0 < *.sqrt < 3
11:17 camelia rakudo-moar 20cfd6: OUTPUT: «===SORRY!===␤QAST::Block with cuid 1 has not appeared␤»
11:18 moritz m: say (0 < *.sqrt < 3)(4)
11:18 camelia rakudo-moar 20cfd6: OUTPUT: «===SORRY!===␤QAST::Block with cuid 1 has not appeared␤»
11:18 bioduds moritz: do you understande the problem?
11:18 bioduds quite bugish right?
11:19 xtreak joined #perl6
11:19 moritz m: say (0 < * < 3)(2)
11:19 camelia rakudo-moar 20cfd6: OUTPUT: «True␤»
11:20 bioduds weird part is that it was working before
11:20 bioduds it started to complaint after I changed to .pl6
11:20 moritz bisectable: say (0 < *.sqrt < 3)(4)
11:20 bisectable6 moritz, Bisecting by output (old=2015.12 new=20cfd6b) because on both starting points the exit code is 1
11:20 bisectable6 moritz, bisect log: https://gist.github.com/9b0068a0ec1bd5396691f8c468ed2cf4
11:20 bisectable6 moritz, (2015-12-25) https://github.com/rakudo/rakudo/commit/07fecb52eb1fd07397659f19a5cf36dc61f84053
11:20 bisectable6 moritz, The result looks a bit unrealistic, doesn't it? Most probably the output is different on every commit (e.g. 「bisect: say rand」)
11:20 Zoffix joined #perl6
11:20 moritz bisectable: say so try (0 < *.sqrt < 3)(4)
11:20 itaipu joined #perl6
11:20 bisectable6 moritz, Bisecting by output (old=2015.12 new=20cfd6b) because on both starting points the exit code is 1
11:21 bisectable6 moritz, bisect log: https://gist.github.com/5cd30d93ce3cf0d0c4175f9ce208a9dc
11:21 bisectable6 moritz, (2015-12-25) https://github.com/rakudo/rakudo/commit/07fecb52eb1fd07397659f19a5cf36dc61f84053
11:21 bisectable6 moritz, The result looks a bit unrealistic, doesn't it? Most probably the output is different on every commit (e.g. 「bisect: say rand」)
11:21 Zoffix That's a known bug that existed for ages.
11:21 xtreak joined #perl6
11:21 Zoffix It's due to the curry not knowing about being chained
11:21 moritz m: say so try (0 < *.sqrt < 3)(4
11:21 camelia rakudo-moar 20cfd6: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in argument list; couldn't find final ')' ␤at <tmp>:1␤------> 3say so try (0 < *.sqrt < 3)(47⏏5<EOL>␤»
11:21 moritz m: say so try (0 < *.sqrt < 3)(4)
11:21 camelia rakudo-moar 20cfd6: OUTPUT: «===SORRY!===␤QAST::Block with cuid 1 has not appeared␤»
11:22 moritz Zoffix: ok, thanks
11:22 moritz Zoffix: there's an RT for that, right?
11:22 Zoffix Yeah, should be
11:22 * Zoffix looks
11:22 moritz if yes, won't bother submit it again
11:22 bioduds how come it worked before and suddenly, boom
11:22 Zoffix bioduds: you may be misremembering it working before
11:22 bioduds well, good to know it is a bug then
11:23 bioduds I may
11:23 bioduds anyhow, I don't quite need it, I was just confused. Thanks for pointing out
11:23 Zoffix moritz: https://rt.perl.org/Public/Bug/Display.html?id=128859#ticket-history
11:24 Zoffix and I recall talking about it in #perl6-dev and TT saying it's got to do with curry and chaining or something
11:25 Zoffix bioduds: in your case you can just remove the asterisk, as the `where` block thunks, so $_ will be the arg and your expression returns True/False
11:30 Zoffix bioduds: also we have UInt for Int >= 0. Though natural numbers generally don't include a 0 so your subset is off a bit
11:31 Zoffix And the Firstname subset doesn't need the lower bound since chas can't be negative; so just  .chars < 256
11:35 Zoffix left #perl6
11:40 bioduds tx Zoffix
11:41 bioduds done it
11:41 kurahaupo joined #perl6
11:44 Cabanossi joined #perl6
11:49 zacts joined #perl6
11:51 kurahaupo joined #perl6
11:52 kurahaupo joined #perl6
11:52 ChoHag joined #perl6
11:52 kurahaupo joined #perl6
11:59 kyan joined #perl6
12:32 skids joined #perl6
12:40 wamba joined #perl6
12:48 xtreak joined #perl6
12:53 wamba joined #perl6
12:54 mcmillhj joined #perl6
12:58 scovit m: use experimental :macros; macro ciao { quasi { say MY::.keys; } }; my $i = "hello"; say MY::.keys; ciao;
12:58 camelia rakudo-moar 20cfd6: OUTPUT: «($=pod EXPERIMENTAL-MACROS $_ $/ !UNIT_MARKER &ciao $=finish EXPORT $! $i ::?PACKAGE GLOBALish $¢ $?PACKAGE)␤()␤»
12:58 scovit m: use experimental :macros; macro ciao { quasi { say MY::.keys; } }; my $i = "hello"; ciao;
12:58 camelia rakudo-moar 20cfd6: OUTPUT: «()␤»
12:59 MasterDuke_ m: use experimental :macros; macro ciao { quasi {{{ say MY::.keys; }}} }; my $i = "hello"; ciao;
12:59 camelia rakudo-moar 20cfd6: OUTPUT: «($_ $*DISPATCHER)␤»
13:00 scovit is there some random behaviour or I do not understand
13:00 scovit ah MasterDuke_ sorry
13:00 scovit thougth that what was I wrote
13:01 scovit so the {{{ }}} defined scope cannot access $i
13:02 raschipi joined #perl6
13:02 curt_ joined #perl6
13:05 MasterDuke_ i have no idea, masak can probably answer though
13:05 robertle joined #perl6
13:06 curt_ Docs have Instant.Date (https://docs.perl6.org/type/Instant#method_Date) but not Instant.DateTime (though Rakudo has it implemented)
13:09 wamba joined #perl6
13:09 cdg joined #perl6
13:12 * [Coke] wonders how hard it would be to make a module that let you use [] for substr.
13:14 Cabanossi joined #perl6
13:19 zakharyas joined #perl6
13:22 Sound joined #perl6
13:22 Sound joined #perl6
13:24 Ulti is there a way to add your own encodings to stuff like Bug.decode do you just monkey in the candidate
13:24 Ulti *Buf.decode
13:24 sufrostico joined #perl6
13:26 Ulti thinking of adding 2bit format for compactly keeping DNA sequences in memory and it would be nice to have the decode to a character representation be kind of generic rather than something special I create in the library
13:32 Ulti something like this? https://gist.github.com/MattOates/363ce81f463f643709e5c69b4e641f38
13:32 jnthn Ulti: Not yet, though pluggable encodings is something on my todo list
13:36 Ulti ahh cant augment Blob
13:37 colomon joined #perl6
13:42 Ulti so why is Blob closed for augmentation but Int is not I thought one of the main reasons was perf?
13:43 buggable joined #perl6
13:44 jnthn Blob is a role
13:44 jnthn Int is a class
13:49 Ulti ok so Id end up making my own 2bit class by the looks of it anyway similar to the utf8 ones defined in Rakudo
13:52 [Coke] m: say 1-(1-9.95)**(1/3)
13:52 camelia rakudo-moar 20cfd6: OUTPUT: «NaN␤»
13:54 [Coke] m: say 1-(1-0.95)**(1/3) #oops
13:54 camelia rakudo-moar 20cfd6: OUTPUT: «0.631596850135961␤»
13:56 Ulti sorry why is the first one a problem
13:58 [Coke] m: say sqrt(-2)
13:58 camelia rakudo-moar 20cfd6: OUTPUT: «NaN␤»
13:58 [Coke] ^^
13:59 [Coke] I assume we don't like roots of negative numbers, even though it might work.
14:00 Ulti m: -2.sqrt.say
14:00 camelia rakudo-moar 20cfd6: OUTPUT: «WARNINGS for <tmp>:␤Useless use of "-" in expression "-2.sqrt.say" in sink context (line 1)␤1.4142135623731␤»
14:00 Ulti m: say(-2.sqrt)
14:00 camelia rakudo-moar 20cfd6: OUTPUT: «-1.4142135623731␤»
14:00 [Coke] m: say (-2).sqrt
14:00 camelia rakudo-moar 20cfd6: OUTPUT: «NaN␤»
14:00 [Coke] precedence.
14:00 Ulti yeah its - after the fact with 2.sqrt I guess
14:00 [Coke] but my original equation should be 3.076 or so. rakudobug?
14:01 Ulti it also doesnt matter if you get it away from Rat
14:01 [Coke] m: say 1-(1-9.95)**.333333333
14:01 camelia rakudo-moar 20cfd6: OUTPUT: «NaN␤»
14:02 Ulti well .3 is still a Rat right so thats identicalish
14:02 Ulti but yeah weird
14:02 Ulti surely someone would have noticed this before now so is it a regression?
14:03 Ulti people have played with 2D mechanics and graphics where you're likely to write almost exactly this code
14:03 raschipi bisectable: say 1-(1-9.95)**.333333333
14:03 bisectable6 raschipi, On both starting points (old=2015.12 new=20cfd6b) the exit code is 0 and the output is identical as well
14:03 bisectable6 raschipi, Output on both points: «NaN»
14:04 Ulti o___O
14:04 Ulti also whoa bisectable is fast
14:04 moritz why does anybody think this is a regression?
14:04 moritz if you want complex numbers, you need to start with a complex number
14:05 moritz m: say 1-(1-9.95+0i)**.333333333
14:05 camelia rakudo-moar 20cfd6: OUTPUT: «-0.0381123313882117-1.79806329757973i␤»
14:06 moritz and it's always[tm] been this way, since we don't want to burden the not-so-mathematically-inclined programmer with complex numbers if they just made the mistaken of taking an sqrt (or comparable) of a negative number
14:06 Ulti yeah I guess that's fair
14:07 Ulti plus with the precedence just pointed out it might be super confusing
14:07 raschipi What's happening is automatic promotion from Rat to Num, because Rat has limited precision.
14:08 raschipi FatRat doesn't promote to Num.
14:08 raschipi Rat is limited to 64 bits in the denominator.
14:11 khw joined #perl6
14:14 Cabanossi joined #perl6
14:16 [Coke] moritz: it's not complex though. you can cube root a negative real and get a negative real. Is it just complex because we don't have literal cube root and are approximating?
14:16 [Coke] m: say 64**(1/3)
14:16 camelia rakudo-moar 20cfd6: OUTPUT: «4␤»
14:16 [Coke] m: say (-64)**(1/3)
14:16 camelia rakudo-moar 20cfd6: OUTPUT: «NaN␤»
14:17 [Coke] m: say (-64+0i)**(1/3)
14:17 camelia rakudo-moar 20cfd6: OUTPUT: «2+3.46410161513775i␤»
14:17 moritz [Coke]: right, but we disallow fractional powers of any negative number, which is a common practise in numerical implementations
14:17 [Coke] hokay.
14:17 [Coke] it was the wrong equation for my particular problem anyway, so I'm all set. :)
14:21 Geth ¦ doc: b4e10b6fbe | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Type/Instant.pod6
14:21 Geth ¦ doc: Document Instant.DateTime; curt_++
14:21 Geth ¦ doc:
14:21 Geth ¦ doc: coverage report shows it as covered; so it's likely in roast
14:21 Geth ¦ doc: review: https://github.com/perl6/doc/commit/b4e10b6fbe
14:22 gregf_ joined #perl6
14:22 Geth ¦ doc: 75abdd5b79 | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Type/Instant.pod6
14:22 Geth ¦ doc: Reword
14:22 Geth ¦ doc:
14:22 Geth ¦ doc: - Shorten description
14:22 Geth ¦ doc: - Remove confusing comment, as it implies the method is not portable, but it is
14:22 Geth ¦ doc: review: https://github.com/perl6/doc/commit/75abdd5b79
14:31 eliasr joined #perl6
14:59 Cabanossi joined #perl6
15:02 silug joined #perl6
15:05 zakharyas joined #perl6
15:23 zakharyas joined #perl6
15:45 st_elmo joined #perl6
15:56 vytas joined #perl6
16:13 sufrostico joined #perl6
16:18 dj_goku joined #perl6
16:18 dj_goku joined #perl6
16:23 itaipu joined #perl6
16:24 Zoffix joined #perl6
16:24 Zoffix left #perl6
16:29 mscha joined #perl6
16:31 mscha m: say 243.log(3); .say for 0 .. 243.log(3); # I hate invisible rounding problems.  ????
16:31 camelia rakudo-moar 6bb1b5: OUTPUT: «5␤0␤1␤2␤3␤4␤»
16:31 timotimo m: say 243.log(3) - 5
16:31 camelia rakudo-moar 6bb1b5: OUTPUT: «-8.88178419700125e-16␤»
16:31 timotimo yeah, that's far behind the comma
16:32 itaipu joined #perl6
16:32 mscha Problem is, you can't really add a delta, no matter how small, because then you might get a value that's too high.
16:33 mscha Oh well, I'll do it without .log().
16:33 TimToady m: say 243.log(3); .say for 0 ... * ≅ 243.log(3);
16:33 camelia rakudo-moar 6bb1b5: OUTPUT: «5␤0␤1␤2␤3␤4␤5␤»
16:34 mscha m: .say for 1, 3, 3² ... 243; # this is prettier anyway
16:34 camelia rakudo-moar 6bb1b5: OUTPUT: «1␤3␤9␤27␤81␤243␤»
16:34 timotimo 'tis
16:34 TimToady :D
16:35 TimToady m: .say for 3⁰, 3¹, 3² ... 243;
16:35 camelia rakudo-moar 6bb1b5: OUTPUT: «1␤3␤9␤27␤81␤243␤»
16:36 curt_ m: my $i = -0x8000000000000000; say ($i div 2**12) == ($i +> 12) ?? 'good' !! 'bad';
16:36 camelia rakudo-moar 6bb1b5: OUTPUT: «good␤»
16:36 curt_ m: my $i = -0x8000000000000000; say ($i div 2**37) == ($i +> 37) ?? 'good' !! 'bad';
16:36 camelia rakudo-moar 6bb1b5: OUTPUT: «bad␤»
16:39 TreyHarris m: say 9**(-1/2)
16:39 camelia rakudo-moar 6bb1b5: OUTPUT: «0.333333333333333␤»
16:39 curt_ m: my $i = -0x8000000000000000; say ($i div 2**23) == ($i +> 23) ?? 'good' !! 'bad';
16:39 camelia rakudo-moar 6bb1b5: OUTPUT: «good␤»
16:40 curt_ m: my $i = -0x8000000000000000; say ($i div 2**42) == ($i +> 42) ?? 'good' !! 'bad';
16:40 camelia rakudo-moar 6bb1b5: OUTPUT: «bad␤»
16:41 TimToady loks like a bug
16:41 TimToady *oo
16:41 TimToady at the 32-bit boundary
16:41 TimToady m: my $i = -0x8000000000000000; say ($i +> 31)
16:41 camelia rakudo-moar 6bb1b5: OUTPUT: «-4294967296␤»
16:41 TimToady m: my $i = -0x8000000000000000; say ($i +> 32)
16:41 camelia rakudo-moar 6bb1b5: OUTPUT: «-1␤»
16:44 TimToady please report bug
16:45 * TimToady heads to Fry's yet again for more capacitors...
16:45 timotimo did you fry your capacitors?
16:46 TimToady ancient Tivo power supply, have replaced most of the caps already, but of course it's the one I forgot to buy that is the busted one, seemingly
16:46 TimToady anyway, the 12v line is only making about 6v
16:46 TimToady can actually hear the cap arcing, a little snick-snick noise
16:47 TimToady I wouldn't put so much work into this, except it's the Tivo with the lifetime subscription :)
16:49 TimToady also put a new capacitor into my air conditioner condenser last week, but that single cap easily outweighed all the boards in my Tivo :)
16:49 TreyHarris TimToady: heh, hope you've stuck ethernet and a bigger hard drive on it if it's old enough for that
16:50 TimToady it's the early HD model, so already has ethernet
16:51 TreyHarris Ah... the ones before that had ethernet--as headers on the board. So you could connect it but you had to run a cable through the chassis. Turned out the fan was smaller than the outlet by _just_ enough to get a thin cable out.
16:51 TimToady had an external 500G, but plan to replace internal with 2T and forget the external
16:52 TimToady I don't think I'd futz with a low-def tivo, since I'm a bit of a video snob :)
16:53 TreyHarris TimToady: I've got two from my cable company now--RCN just uses honest-to-god TiVos as their cable boxes, bless them
16:53 curt_ Bugged: bit shift broken at 32 bits: https://rt.perl.org/Public/Bug/Display.html?id=131278
16:53 TimToady curt_++
16:53 TimToady that took less time than me not going to Fry's :)
16:53 TimToady afk &
16:53 ggoebel joined #perl6
16:55 Actualeyes joined #perl6
16:59 curt_ -1 looks like the intended output for big shifts: https://rt.perl.org/Public/Bug/Display.html?id=126942
17:03 dogbert17 joined #perl6
17:04 darutoko- joined #perl6
17:04 curt_ Work around for big bit shifts, just do two of them less than 32
17:04 curt_ m: my $i = -0x8000000000000000; say ($i div 2**37) == ($i +> 31 +> 6) ?? 'good' !! 'bad';
17:04 camelia rakudo-moar 6bb1b5: OUTPUT: «good␤»
17:12 wamba joined #perl6
17:17 alphah Hello, what would be a good way to call a method by a variable has it's name, something like $var="methodname"; self.$var
17:17 alphah m: class C { has $!var = "foo"; method foo() { "hello" }; method bar() { say self.$!var } }; C.new.bar
17:17 camelia rakudo-moar 6bb1b5: OUTPUT: «No such method 'CALL-ME' for invocant of type 'Str'␤  in method bar at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
17:17 jnthn self."$var"()
17:17 mcmillhj joined #perl6
17:17 jnthn Or self."$!var"() in that case
17:18 alphah jnthn: worked, thank you
17:22 setty1 joined #perl6
17:36 domidumont joined #perl6
17:36 alphah That works for methods, does it also works for attributes?
17:36 alphah class A { method hello() { say "hello" } }; class B { has A $.a; method foo($attr = "a") { say self.$attr.hello } }
17:36 alphah m: class A { method hello() { say "hello" } }; class B { has A $.a; method foo($attr = "a") { say self.$attr.hello } }
17:36 camelia rakudo-moar 6bb1b5: ( no output )
17:37 alphah m: class A { method hello() { say "hello" } }; class B { has A $.a; method foo($attr = "a") { say self.$attr } }
17:37 camelia rakudo-moar 6bb1b5: ( no output )
17:40 rindolf joined #perl6
17:40 alphah class A { method hello() { say "hello" } }; class B { has A $.a; method foo($attr = "a") { say self.$attr.hello0o } } # why no error!
17:41 alphah m: class A { method hello() { say "hello" } }; class B { has A $.a; method foo($attr = "a") { say self.$attr.hello0o } } # why no error!
17:41 camelia rakudo-moar 6bb1b5: ( no output )
17:41 grondilu_ joined #perl6
17:45 timotimo alphah: public attributes are always accessed via accessor methods, so yes, it should work
17:47 ufobat joined #perl6
17:48 alphah timotimo: in this example should not it call .hello ?:
17:48 ufobat should perl6 build on a raspi in the meanwhile?
17:48 alphah m: class A { method hello() { say "hello" } }; class B { has A $.a; method foo($attr = "a") { self.$attr.hello() } }
17:48 camelia rakudo-moar 6bb1b5: ( no output )
17:48 timotimo i have cat on me
17:49 espadrine joined #perl6
17:49 zakharyas joined #perl6
17:49 timotimo self.$attr calls $attr as a code object and passes self as invocant
17:50 timotimo cant properly type with cat on me
17:51 timotimo you don't get an error because you're not calling any of the code
17:51 alphah hmm
17:52 alphah tried slef.$attr.new.hello
17:52 timotimo well, as long as it's inside method foo of class B and you're not doin something like B.new.foo
17:52 timotimo nothing's gonna happen
17:52 timotimo you won't get a compile error because the $attr that gets passed could be a code object
17:53 timotimo even though the default case would almost guaranteed give you an exception, we don't do analysis like that
17:55 timotimo okay, cat left
17:55 alphah okay, so what I'm trying to do is: I have a class which has 3 attributes , each one is an instance of different class,,, I want to create a method takes "string" arg, and use the instance that matches this string
17:55 timotimo m: class A { method hello() { say "hello" } }; class B { has A $.a; method foo($attr = "a") { self.$attr.hello() } }; B.new.foo
17:55 camelia rakudo-moar 6bb1b5: OUTPUT: «No such method 'CALL-ME' for invocant of type 'Str'␤  in method foo at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
17:55 timotimo ^- there's the error you were expecting
17:56 itaipu joined #perl6
17:56 timotimo in what way does the instance match the given string?
17:56 timotimo m: class A { method hello() { say "hello" } }; class B { has A $.a; method foo($attr = "a") { self."$attr".hello() } }; B.new.foo
17:56 camelia rakudo-moar 6bb1b5: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Quoted method name requires parenthesized arguments. If you meant to concatenate two strings, use '~'.␤at <tmp>:1␤------> 3; method foo($attr = "a") { self."$attr"7⏏5.hello() } }; B.new.foo␤»
17:56 alphah just the name
17:56 timotimo m: class A { method hello() { say "hello" } }; class B { has A $.a; method foo($attr = "a") { self."$attr"().hello() } }; B.new.foo
17:56 camelia rakudo-moar 6bb1b5: OUTPUT: «hello␤»
17:56 timotimo m: class A { method hello() { say "hello" } }; class B { has A $.a; method foo($attr = "a") { self."$attr"().hello() } }; B.new.foo("bleh")
17:56 camelia rakudo-moar 6bb1b5: OUTPUT: «No such method 'bleh' for invocant of type 'B'␤  in method foo at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
17:56 ggoebel joined #perl6
17:58 timotimo does that solve your problem?
17:58 alphah let me try that
18:00 alphah yes worked :)
18:01 alphah what confused me is I did not think I will need the "()" for the attributes... now understand
18:02 timotimo yeah accessors are just methods
18:02 timotimo that was the number one confusing thing for me near the beginning
18:02 alphah noted
18:02 timotimo i was like "but the attribute is called $.foo, why don't i write self.$foo or something?
18:02 timotimo or maybe $self.foo?"
18:02 timotimo etc etc
18:03 alphah yes exactly, that was my thought just 1 minute ago
18:03 timotimo but self.$foo is really like $foo(self)
18:05 skids m: my $b; (loop ($b = 4; $b; $b--) { next if $b == 1; $_ }).note
18:05 camelia rakudo-moar 6bb1b5: OUTPUT: «((Any) (Any) (Any) (Mu) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (A…»
18:05 skids That only happens if you next out of the last iteration.
18:06 timotimo oh, fascinating
18:08 * skids files an RT
18:13 skids m: my $b; (loop ($b = 4; $b > 0; $b--) { next if $b == 1; $b }).note # version without escaping the termination condition
18:13 camelia rakudo-moar 6bb1b5: OUTPUT: «(4 3 2 (Mu))␤»
18:13 skids still have that Mu.
18:17 skids RT #131281
18:17 synopsebot6 Link:  https://rt.perl.org/rt3/Public/Bug/Display.html?id=131281
18:19 skids Ooh.  also affect while.
18:19 skids m: my $b =4; (while ($b--) { next if $b == 0; $b }).note
18:19 camelia rakudo-moar 6bb1b5: OUTPUT: «(3 2 1 (Mu) -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -6…»
18:30 sunnylarry joined #perl6
18:37 Geth ¦ ecosystem: 9ecab7fd65 | (Zoffix Znet)++ (committed using GitHub Web editor) | META.list
18:37 Geth ¦ ecosystem: Add Pythonic::Str to ecosystem
18:37 Geth ¦ ecosystem:
18:37 Geth ¦ ecosystem: Index into strings like Pythonists do!
18:37 Geth ¦ ecosystem: See: https://github.com/zoffixznet/perl6-Pythonic-Str
18:37 Geth ¦ ecosystem: review: https://github.com/perl6/ecosystem/commit/9ecab7fd65
18:44 tadzik ha! This is cool
18:46 timotimo yo tadzik
18:46 timotimo what is?
18:47 sufrostico joined #perl6
18:49 tadzik Pythonic::Str
18:49 tadzik I have 4 python students this week, and when I told them that I work with Perl some of them looked... jealous
18:50 timotimo huh
18:50 timotimo that's new
18:50 tadzik an ex-Perlist I suppose, not happy about the transition
18:50 timotimo hmm
18:51 timotimo http://imgur.com/R7T4Gzn - tadzik i wanted you to see this
18:51 * tadzik looks
18:51 tadzik oh dayum
18:51 tadzik it's beautiful
18:51 tadzik I can't unsee die katze
18:52 timotimo <3
18:52 timotimo die katze also sees you
18:53 tadzik have you githab it?
18:53 tadzik ah, I see it
18:53 timotimo yup
18:53 timotimo it also comes with a tool that creates a nice graphviz'd render of the whole callgraph
18:53 tadzik how's it faring with very big profiles?
18:53 tadzik mmm
18:54 timotimo it fares perfectly because it uses sqlite
18:54 tadzik right, but does it render the things in reasonable time, compared to angular?
18:54 timotimo it does a pretty different thing
18:54 timotimo why's the irclog down? :(
18:55 tadzik what I mean is, I wonder if it's viable to port p6profiler-qt to Perl 6
18:55 tadzik (and Gtk)
18:55 timotimo yeah, it probably is
18:55 tadzik hmm :)
18:55 timotimo as long as you go with sqlite instead of json :)f
18:55 tadzik yup
18:56 timotimo http://hack.p6c.org/~timo/forestfire_callgraph_3.svg - check it
18:56 tadzik right, it was mostly rendering that brought the web profiler down
18:56 tadzik ayy, neat!
18:56 timotimo ayyyyyyyyyyy
19:09 raschipi lmao
19:14 AlexDaniel joined #perl6
19:15 AlexDaniel Ulti: re “whoa bisectable is fast”, it only had to try 2 revisions, so that's not so impressive :)
19:15 AlexDaniel in fact, it is a bit slow because both revisions were compressed (even though it could have kept HEAD and 2015.12 uncompressed to speed things up)
19:16 AlexDaniel so that's like 0.1s overhead per revision or something like that
19:18 yqt joined #perl6
19:22 Ven joined #perl6
19:26 revere joined #perl6
19:27 Ven_ joined #perl6
19:29 Cabanossi joined #perl6
19:35 robertle joined #perl6
19:36 Ven_ joined #perl6
19:38 revere joined #perl6
19:39 revere joined #perl6
19:39 ribasushi joined #perl6
19:42 labster joined #perl6
19:43 timotimo http://sasheldon.com/blog/2017/05/07/how-i-broke-cargo-for-windows/ - heh.
19:46 raschipi heh
19:52 lichtkind joined #perl6
20:12 cdg joined #perl6
20:13 zakharyas joined #perl6
20:14 Ven_ joined #perl6
20:18 [Coke] win 3
20:18 buggable [Coke], Thank you for entering Accidental /win Lottery! The next draw will happen in 4 weeks, 2 days, 3 hours, 41 minutes, and 50 seconds
20:21 raschipi win 9223372036854775807
20:21 buggable raschipi, Thank you for entering Accidental /win Lottery! The next draw will happen in 4 weeks, 2 days, 3 hours, 38 minutes, and 42 seconds
20:22 raschipi m: say "win 12"
20:22 camelia rakudo-moar 6bb1b5: OUTPUT: «win 12␤»
20:29 Cabanossi joined #perl6
20:36 Ven joined #perl6
20:40 TEttinger joined #perl6
20:49 gdonald joined #perl6
20:51 haxmeister win 5
20:51 buggable haxmeister, Thank you for entering Accidental /win Lottery! The next draw will happen in 4 weeks, 2 days, 3 hours, 8 minutes, and 8 seconds
20:52 haxmeister what's that all about?
20:53 * haxmeister just installed moritz JSON module
20:53 raschipi Zoffix owns it.
20:54 haxmeister the module?
20:54 raschipi No, the bot
20:54 dct joined #perl6
20:54 raschipi The bot function, should I say
20:54 haxmeister got me excited for a minute there
20:54 samcv how do i traverse the grammar entries
20:54 samcv in an actions class. in order that is
20:55 samcv from how they are displayed when i dump $/ i need to access that inside TOP
20:55 samcv hmm actually i think if i add another heirarchy i can do this
20:57 jnthn samcv: Positional captures in .list, named in .hash, and iirc .caps give you all of them in the order they happened
20:57 samcv what do i call .list on?
20:57 samcv $/?
20:57 jnthn Ues
20:57 jnthn *Yes
20:57 samcv cool
20:58 alphah win 7
20:58 buggable alphah, Thank you for entering Accidental /win Lottery! The next draw will happen in 4 weeks, 2 days, 3 hours, 1 minute, and 52 seconds
20:59 Cabanossi joined #perl6
20:59 samcv jnthn, that does not work. $/.list inside of TOP
20:59 samcv in the actions class that is
21:00 samcv oh i can set an @array though. and i gues use that
21:01 jnthn m: grammar G { token TOP { (.)(.) } }; class A { method TOP($/) { say $/.list } }; G.parse('xy', :actions(A))
21:01 camelia rakudo-moar 6bb1b5: OUTPUT: «(「x」 「y」)␤»
21:01 jnthn m: grammar G { token TOP { <alpha> <digit> } }; class A { method TOP($/) { say $/.hash } }; G.parse('x2', :actions(A))
21:01 camelia rakudo-moar 6bb1b5: OUTPUT: «Map.new((:alpha(Match.new(list => (), made => Any, pos => 1, hash => Map.new(()), orig => "x2", from => 0)),:digit(Match.new(list => (), made => Any, pos => 2, hash => Map.new(()), orig => "x2", from => 1))))␤»
21:02 jnthn m: grammar G { token TOP { (.) <digit> } }; class A { method TOP($/) { say $/.caps } }; G.parse('x2', :actions(A))
21:02 camelia rakudo-moar 6bb1b5: OUTPUT: «(0 => 「x」 digit => 「2」)␤»
21:02 Ven_ joined #perl6
21:02 jnthn If one of those isn't what you want I need a little more explaining. :-)
21:02 samcv jnthn, https://gist.github.com/9c08cbff64bb8b21d18cbbf9e37536f7
21:02 samcv i get nothing but an empty list printing out like this
21:02 samcv but printing out $/ itself works fine. gisting that is
21:03 samcv caps does work though
21:03 jnthn Ah, yes, because <hex> and friends are named captures
21:04 jnthn That's what I meant by "Positional captures in .list"
21:04 samcv ah kk
21:04 jnthn It'll only give those captured like (xxx)
21:04 samcv ok i got it. using caps now :)
21:06 jnthn Hm, I'm sure I wrote something to parse that file at some point... :)
21:07 samcv yeah we have something to parse the file right now. i'm making it better though :) but yes you have :)
21:07 samcv going to check individual graphemes instead of just the length of the total graphemes now
21:07 jnthn yeah, just ofund it
21:07 jnthn *found it
21:07 jnthn https://github.com/perl6/roast/blob/master/S15-nfg/GraphemeBreakTest-gen.p6
21:07 jnthn :)
21:07 samcv to make it fully test what the test is testing
21:08 samcv i wrote that one you wrote the one before that :)
21:08 haxmeister json module seems to work
21:08 samcv in git history somewhere
21:08 jnthn And yeah, I was like "wait, how did I get away with such simple parsing code...oh" :D
21:08 samcv yeah neither of us did it very complex
21:08 samcv tested it 90% which is mostly good enough
21:08 samcv unless you have two incorrect in the wrong direction break/nobreaks
21:09 samcv unlikely but.
21:09 samcv important to test for
21:09 sufrostico joined #perl6
21:09 jnthn Yeah, it's nice to have to make sure we're really getting it right :)
21:10 jnthn Especially with Unicode 9
21:10 jnthn The world was simpler in Unicode ...
21:10 jnthn *9
21:10 jnthn gah, 8 :)
21:10 samcv heh
21:10 samcv the good ol days
21:11 jnthn Yeah, the emoji stuff broke the "just examine two codepoints" assumption :/
21:16 kyan joined #perl6
21:20 Ven joined #perl6
21:21 samcv and prepend
21:22 samcv broke the directional ensurement for state
21:22 samcv maybe didn't use the bset words there
21:22 samcv *best
21:22 samcv but you get what i mean
21:23 samcv i've almost got this :) going to look nice this test
21:24 jnthn samcv++
21:24 samcv gonna be my best looking one yet
21:46 samcv \o/ success
21:47 mcmillhj joined #perl6
21:48 samcv jnthn, might include the test file in roast maybe? it doesn't take very long to process it using a grammar
21:50 jnthn samcv: As in the Unicode test data file itself?
21:50 samcv yeah
21:51 jnthn Guess we can...are there any license condiderations?
21:51 jnthn *considerations
21:51 samcv i will check into that.
21:51 jnthn But otherwise, if it's quick enough just to parse and test each case as it comes then may as well do that
21:52 samcv yeah
21:52 samcv just have to make sure to not delete their license information
21:53 samcv "this copyright and permission notice appear in associated Documentation."
21:53 samcv so that's fairly simple.
21:57 mcmillhj joined #perl6
22:01 raiph joined #perl6
22:01 samcv ok so we have 11 lines that result in failures up from 4
22:02 samcv so yay
22:02 samcv yay failure!
22:05 mcmillhj joined #perl6
22:10 cyphase joined #perl6
22:14 z448 joined #perl6
22:42 mcmillhj joined #perl6
22:47 BenGoldberg joined #perl6
22:58 mcmillhj joined #perl6
22:59 Cabanossi joined #perl6
23:29 Cabanossi joined #perl6
23:42 giraffe joined #perl6
23:49 Cabanossi joined #perl6

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

Perl 6 | Reference Documentation | Rakudo