»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_log/perl6 | UTF-8 is our friend! 🦋
Set by Zoffix on 25 July 2018.
00:06 Sgeo_ joined 00:10 Sgeo__ left 00:33 Manifest0 left 00:35 Sgeo__ joined 00:38 adu joined 00:39 Sgeo_ left, Manifest0 joined 00:50 Manifest0 left 00:51 aborazmeh joined, aborazmeh left, aborazmeh joined, cpan-p6 left 00:52 cpan-p6 joined, cpan-p6 left, cpan-p6 joined 00:55 Manifest0 joined, kurahaupo_ joined 00:56 kurahaupo left, kurahaupo_ left, kurahaupo joined 00:58 kurahaupo_ joined 01:01 kurahaupo left 01:06 AlexDaniel left 01:10 lgandras joined 01:17 Manifest0 left 01:21 Manifest0 joined 01:29 kurahaupo_ left 01:30 kurahaupo joined 01:31 Sgeo__ left 01:32 Sgeo__ joined 01:40 Manifest0 left, molaf left 01:45 Manifest0 joined 01:53 molaf joined 02:01 Manifest0 left 02:09 Manifest0 joined 02:12 hythm joined
cpan-p6 New module released to CPAN! Smack (0.4.0) by 03HANENKAMP 02:15
02:18 lgandras left 02:28 Manifest0 left 02:34 Manifest0 joined 02:39 Manifest0 left, discord6 left 02:42 discord6 joined, discord6 left, discord6 joined 02:44 Manifest0 joined 02:48 discord63 joined, discord63 left 02:49 synopsebot_ joined, cpan-p6 left, synopsebot left, Geth_ joined 02:50 tyil left 02:55 discord6 left, Manifest0 left 02:56 SqrtNegInf joined 02:58 discord6 joined 02:59 discord6 left 03:00 squashable6 left, Manifest0 joined 03:05 squashable6 joined 03:10 tyilanmenyn joined, Cabanossi left 03:12 Cabanossi joined 03:13 Sgeo__ left, Sgeo__ joined 03:23 discord6 joined, Manifest0 left 03:24 Voldenet left 03:26 tyilanmenyn left 03:28 discord6 left, Manifest0 joined 03:29 Voldenet joined, Voldenet left, Voldenet joined 03:34 kaare_ left, kaare_ joined 03:39 Manifest0 left 03:45 Manifest0 joined 03:49 Geth left, synopsebot_ left 03:50 Geth_ left 03:54 synopsebot joined, Geth joined 03:56 Manifest0 left, Summertime2 is now known as Summertime 03:58 Geth left, synopsebot left 04:01 Manifest0 joined 04:07 Manifest0 left 04:08 Geth joined 04:12 Manifest0 joined 04:14 synopsebot joined 04:16 hythm left 04:17 kurahaupo_ joined 04:18 kurahaupo left 04:26 Manifest0 left 04:27 kurahaupo_ left, kurahaupo joined
Xliff m: say |($random-size ?? 50..100.rand.Int !! 50) xx 2; 04:31
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$random-size' is not declared
at <tmp>:1
------> 3say |(7⏏5$random-size ?? 50..100.rand.Int !! 50)
Xliff m: say |Bool.pick ?? 50..100.rand.Int !! 50) xx 2;
camelia 5===SORRY!5=== Error while compiling <tmp>
Unexpected closing bracket
at <tmp>:1
------> 3say |Bool.pick ?? 50..100.rand.Int !! 507⏏5) xx 2;
Xliff m: say |(Bool.pick ?? 50..100.rand.Int !! 50) xx 2;
camelia (50)
Xliff m: say |(Bool.pick ?? 50..100.rand.Int !! 50) xx 2;
camelia (50 51 52 53 54 55 56 57)
Xliff m: say (Bool.pick ?? 50..100.rand.Int !! 50) xx 2;
camelia (50..53 50)
Xliff m: say (Bool.pick ?? 50..100.rand.Int !! 50) xx 2;
camelia (50..84 50)
Xliff m: say (Bool.pick ?? (50..100).rand.Int !! 50) xx 2; 04:32
camelia (50 95)
Xliff m: say (Bool.pick ?? (50..100).rand.Int !! 50) xx 2;
camelia (50 65)
Xliff m: say (Bool.pick ?? (50..100).rand.Int !! 50) xx 2;
camelia (79 82)
Xliff m: say (Bool.pick ?? (50..100).rand.Int !! 50) xx 2;
camelia (50 69)
Xliff m: say (Bool.pick ?? (50..100).rand.Int !! 50) xx 2;
camelia (77 50)
Xliff m: my $a = Bool.pick; say ($a ?? (50..100).rand.Int !! 50) xx 2;
camelia (94 51)
Xliff m: my $a = Bool.pick; say ($a ?? (50..100).rand.Int !! 50) xx 2;
camelia (50 50)
Xliff m: my $a = Bool.pick; say ($a ?? (50..100).rand.Int !! 50) xx 2;
camelia (50 50)
Xliff m: my $a = Bool.pick; say ($a ?? (50..100).rand.Int !! 50) xx 2;
camelia (50 50)
Xliff m: my $a = Bool.pick; say ($a ?? (50..100).rand.Int !! 50) xx 2;
camelia (71 53)
Xliff m: my $a = Bool.pick; say |(($a ?? (50..100).rand.Int !! 50) xx 2);
camelia 5050
04:33 kurahaupo1 joined 04:34 Geth left, synopsebot left 04:36 Manifest0 joined
Xliff m: my $a = Bool.pick; say |(($a ?? (50..100).eager.rand.Int !! 50) xx 2); 04:36
camelia 5050
Xliff m: my $a = Bool.pick; say |(($a ?? (50..100).eager.rand.Int !! 50) xx 2);
camelia 836
Xliff m: my $a = Bool.pick; say |(($a ?? (50..100).eager.rand.Int !! 50) xx 2);
camelia 4338
04:36 cpan-p6 joined, cpan-p6 left, cpan-p6 joined
Xliff m: my $a = Bool.pick; say |(($a ?? (50...100).rand.Int !! 50) xx 2); 04:36
camelia 2230
04:36 cpan-p6 left
Xliff m: my $a = Bool.pick; say |(($a ?? (50...100).pick.Int !! 50) xx 2); 04:36
camelia 5475
Xliff m: my $a = Bool.pick; say |(($a ?? (50...100).pick.Int !! 50) xx 2);
camelia 7396
Xliff m: my $a = Bool.pick; say |(($a ?? (50...100).pick.Int !! 50) xx 2);
camelia 5050
Xliff m: my $a = Bool.pick; say |(($a ?? (50...100).pick.Int !! 50) xx 2);
camelia 5671
Xliff m: my $a = Bool.pick; say |(($a ?? ((50...100).pick.Int) !! 50) xx 2); 04:37
camelia 5050
Xliff m: my $a = Bool.pick; say |(($a ?? ((50...100).pick.Int) !! 50) xx 2);
camelia 5050
Xliff m: my $a = Bool.pick; say |(($a ?? ((50...100).pick.Int) !! 50) xx 2);
camelia 5050
Xliff m: my $a = Bool.pick; say |(($a ?? ((50...100).pick.Int) !! 50) xx 2);
camelia 7065
Xliff m: my $a = Bool.pick; say |(($a ?? ((50...100).pick.Int) !! 50) xx 2);
camelia 9069
Xliff m: my $a = Bool.pick; my $r = (50...100).pick.Int; say |(($a ?? $r !! 50) xx 2);
camelia 9191
Xliff m: my $a = Bool.pick; my $r = (50...100).pick.Int; say |(($a ?? $r !! 50) xx 2);
camelia 6969
04:39 Geth joined, synopsebot joined
Xliff m: my $a = Bool.pick; my $r = (50...100).pick.Int; say |($a ?? $r !! 50 xx 2); 04:44
camelia 95
Xliff m: my $a = Bool.pick; my $r = (50...100).pick.Int; say |($a ?? $r !! 50) xx 2);
camelia 5===SORRY!5=== Error while compiling <tmp>
Unexpected closing bracket
at <tmp>:1
------> 0300).pick.Int; say |($a ?? $r !! 50) xx 27⏏5);
Xliff m: my $a = Bool.pick; my $r = (50...100).pick.Int; say |($a ?? $r !! 50) xx 2;
camelia (50 50)
Xliff m: my $a = Bool.pick; my $r = (50...100).pick.Int; say |($a ?? $r !! 50) xx 2;
camelia (76 76)
04:44 curan joined
Xliff m: my $a = Bool.pick; my $r = (50...100).pick.Int; say |($a ?? $r !! 50) xx 2; 04:44
camelia (50 50)
Xliff m: my $a = Bool.pick; say |($a ?? (50...100).pick.Int !! 50) xx 2; 04:45
camelia (70 53)
Xliff m: my $a = Bool.pick; say |($a ?? (50...100).pick.Int !! 50) xx 2;
camelia (50 50)
Xliff m: my $a = Bool.pick; say |($a ?? (50...100).pick.Int !! 50) xx 2;
camelia (68 98)
Xliff m: my $a = Bool.pick; say |($a ?? (50...100).pick.Int !! 50) xx 2;
camelia (50 50)
Xliff m: my $a = Bool.pick; say |($a ?? (50...100).pick.Int !! 50) xx 2;
camelia (50 50)
Xliff m: my $a = Bool.pick; say |($a ?? (50...100).pick.Int !! 50) xx 2;
camelia (50 50)
Xliff m: my $a = Bool.pick; say |($a ?? (50...100).pick.Int !! 50) xx 2;
camelia (93 69)
04:46 Geth left 04:47 Geth joined 04:54 reach_satori left 04:55 reach_satori joined 04:57 robertle left 04:59 Maylay left 05:04 Manifest0 left 05:05 synopsebot left 05:10 Manifest0 joined 05:12 Geth left 05:14 synopsebot joined 05:15 Manifest0 left 05:18 synopsebot left 05:19 Manifest0 joined 05:21 synopsebot joined, Geth joined 05:24 cpan-p6 joined, cpan-p6 left, cpan-p6 joined, powerbit left, giraffe left 05:25 giraffe_ joined 05:26 molaf left 05:30 Sgeo__ left, cpan-p6 left 05:32 Geth left, Sgeo joined, synopsebot left 05:36 nadim_ left, sauvin joined 05:39 patrickb joined 05:41 Geth joined, synopsebot joined 05:43 aborazmeh left 05:46 lgandras joined, gfldex left 05:49 nadim_ joined, synopsebot left 05:50 Geth left 05:51 farcas82 left 05:52 cpan-p6 joined, cpan-p6 left, cpan-p6 joined, synopsebot joined, tyilanmenyn joined, rindolf joined 05:53 discord6 joined 05:54 Geth joined 05:56 nadim joined 05:57 discord6 left 05:58 discord6 joined, nadim left, nadim_ left 05:59 discord6 left 06:00 nadim joined, tyilanmenyn left 06:02 discord6 joined 06:04 discord6 left, Geth_ joined, discord6 joined, discord6 left, discord6 joined 06:05 Geth left 06:06 tyilanmenyn joined, discord6 left, discord6 joined, discord6 left, discord6 joined 06:07 discord6 left 06:08 synopsebot_ joined, synopsebot left 06:09 aborazmeh joined, aborazmeh left, aborazmeh joined 06:12 discord6 joined, discord6 left, discord6 joined 06:16 cpan-p6 left 06:17 cpan-p6 joined, cpan-p6 left, cpan-p6 joined 06:19 domidumont joined 06:27 Manifest0 left 06:28 nadim left
Xliff m: class A does Positional { method AT-POS(\c) { say c }; }; A.new[0] 06:28
camelia 0
Xliff m: class A does Positional { method AT-POS(\c) { say c }; }; A.new[2]
camelia 2
Xliff m: class A does Positional { has $.p1; has $.p2; has $.p3; method AT-POS(\c) { self."p{c - 1}"() }; }; A.new[2] 06:29
camelia ( no output )
Xliff m: class A does Positional { has $.p1; has $.p2; has $.p3; method AT-POS(\c) { self."p{c}"() }; }; A.new(p2 => 43)[2] 06:30
camelia ( no output )
Xliff m: class A does Positional { has $.p1; has $.p2; has $.p3; method AT-POS(\c) { self."p{c}"() }; }; A.new(p2 => 43)[2].say
camelia 43
06:31 lgandras left, Manifest0 joined 06:34 choiboi left 06:35 choiboi joined 06:42 gfldex joined, lgandras joined 06:44 netrino joined, adu left, Manifest0 left 06:45 netrino__ left 06:48 gfldex left 06:49 gfldex joined 06:50 netrino left, Manifest0 joined 06:51 dakkar joined 07:00 ravenousmoose left 07:02 noisegul joined 07:03 Manifest0 left 07:05 nadim joined 07:07 Manifest0 joined 07:11 Xliff left, TimToady left 07:12 Manifest0 left 07:18 Manifest0 joined 07:19 TimToady joined 07:24 netrino joined, aborazmeh left 07:35 ravenousmoose joined, Manifest0 left 07:40 nadim left 07:42 Manifest0 joined, Elronnd joined, ravenousmoose left
Elronnd trying to grok grammars 07:42
I made this one sprunge.us/tllL70 for a simple language with function calls, but when I run it with print("hello world"), it hangs indefinitely 07:43
what'd I do wrong?
ahh, I figured out one problem; number and function-call need to have +, not * 07:45
that fixes parsing for 5 and print(5), but strings still don't work
moritz Elronnd: endless hangs are always nested quantifiers that don't consume any characters 07:46
so the equivalent of (a*)*
Elronnd yah
I got rid of the endless hangs
now I just get nil parses
moritz token string { '"' .* '"' }
at least use .*? instead of .* 07:47
otherwise it will parse "a", "b" as one big string
better use '"' <-["]>* '"'
Elronnd ahhh ok
actually how do I parse string escapes properly? 07:48
like "abc\"def"
moritz [ <-["\\]>+ | \\ . ]*
Elronnd I'll take your word for it :P
moritz its something "normal" on the LHS (so neither a " nor a \) 07:49
or any escaped character on the RHS
07:49 dolmen joined
moritz elaborated more in www.apress.com/us/book/9781484232279 :D 07:49
Elronnd that's expensive tho 07:51
hmmm, I seem to have a parse problem if I have two types of expressions hugging each other. Like print(5, "a", 5) 07:52
is there a good way to debug nil parses? Some way I can ask it to tell me where it tripped up?
fixed that problem 07:55
07:57 netrino left 08:03 netrino joined 08:08 Manifest0 left 08:11 ravenousmoose joined 08:12 dolmen left, Manifest0 joined 08:14 dolmen joined
lizmat clckbaits p6weekly.wordpress.com/2019/06/03/...e-a-given/ 08:15
08:17 rindolf left 08:22 lgandras left, lgandras joined 08:24 Manifest0 left 08:29 Manifest0 joined 08:32 nadim joined 08:33 Manifest0 left 08:36 netrino left 08:39 Manifest0 joined, powerbit joined
daxim news.ycombinator.com/item?id=20076781 I understand reini better than before, this post made me realise a recurring pattern, that the fundamental problem perhaps is that in the pursuit of the perfect programming language he's setting up a yardstick that's no one can satisfy, not even himself. if it's not perfect, then it's bad. evidence: presented about pony-lang less than two years ago, but 08:39
meanwhile already abandoned.
08:42 netrino joined 08:48 Manifest0 left 08:49 ravenousmoose left 08:50 tyilanmenyn is now known as tyil
lizmat afk for a bit& 08:51
08:51 lizmat left 08:53 Manifest0 joined 08:55 woolfy left 09:01 ravenousmoose joined 09:11 lizmat joined 09:12 ravenousmoose left, Manifest0 left 09:15 netrino left 09:18 Manifest0 joined 09:21 netrino joined
patrickb moritz: Are these perlgeek.de/static/p6/rakudo/ the full set of rakudo releases? 09:24
09:25 rindolf joined 09:26 Manifest0 left
moritz patrickb: everything that was on the old www server 09:29
09:30 Manifest0 joined 09:34 zakharyas joined 09:45 Manifest0 left 09:48 ravenousmoose joined 09:49 Manifest0 joined 09:54 netrino left 09:57 ravenousmoose left 10:00 netrino joined 10:06 ravenousmoose joined 10:08 domidumont left 10:09 lgandras left 10:12 ravenousmoose left 10:19 Manifest0 left 10:24 Manifest0 joined 10:30 lizmat left 10:31 veesh_ joined, veesh left, veesh_ is now known as veesh 10:33 netrino left 10:39 netrino joined 10:46 breinbaa1 left 10:47 breinbaas joined 10:52 dolmen left 10:55 pmurias_ joined, pmurias_ left 10:56 pmurias joined
pmurias daxim: I would guess he is looking for a super solid implementation of a less perfect language rather then a less satisfactory one of a perfect one 10:57
10:58 Xliff joined
Xliff \o 10:58
pmurias o/
Xliff camelia doesn't have DateTime::Parse installed?
11:01 andrewalker_ left, zakharyas left, AlexDaniel joined 11:04 andrewalker joined 11:05 pmurias left 11:07 ravenousmoose joined 11:12 netrino left 11:14 veesh left 11:16 aborazmeh joined, aborazmeh left, aborazmeh joined 11:18 netrino joined 11:20 ravenousmoose left, ravenousmoose joined, veesh joined
Xliff Does anyone know where the specs for META6.json are? 11:26
Also... wanted to note that perl6 performance on VMs has degraded between April and now. 11:27
11:28 Manifest0 left 11:29 dolmen joined 11:34 Manifest0 joined 11:38 Manifest0 left 11:39 stux|RC-- left, stux|RC joined 11:46 Manifest0 joined 11:50 Manifest0 left 11:51 netrino left 11:52 veesh left 11:57 veesh joined, netrino joined 11:58 Manifest0 joined 12:01 titsuki_ left 12:08 zakharyas joined 12:10 Manifest0 left, nadim left 12:16 zakharyas left 12:17 Manifest0 joined 12:21 Ven`` joined, zakharyas joined 12:22 domidumont joined 12:23 ravenousmoose left 12:28 Manifest0 left 12:30 netrino left 12:33 Manifest0 joined 12:36 netrino joined, pmurias joined 12:37 Manifest0 left 12:42 Ven`` left, Manifest0 joined 12:44 nadim joined 12:46 veesh left, kurahaupo1 left 12:51 Manifest0 left, abraxxa left 12:52 veesh joined 12:56 Manifest0 joined 12:57 abraxxa joined 13:00 aborazmeh left 13:01 aborazmeh joined, aborazmeh left, aborazmeh joined, abraxxa left 13:04 abraxxa joined, nadim left 13:09 netrino left, Sgeo_ joined 13:12 Sgeo left 13:14 Manifest0 left 13:15 netrino joined 13:18 Manifest0 joined 13:23 Manifest0 left 13:27 aborazmeh left 13:29 dolmen left, Manifest0 joined 13:32 lgandras joined, dolmen joined 13:34 skids joined
tyil Xliff: docs.perl6.org has the "spec" of what zef says is valid for a META6.json 13:37
Xliff: docs.perl6.org/language/modules#in...META6.json 13:38
Xliff tyil: Thanks! 13:45
13:47 Manifest0 left 13:48 netrino left 13:49 pmurias_ joined, pmurias left, pmurias_ is now known as pmurias
pmurias Is something like this clear enough: github.com/pmurias/rakudo-tutorial (I'll expand the tutorial to show how to do more stuff later on) 13:50
13:51 msiism joined 13:52 Manifest0 joined 13:53 zakharyas left
msiism just started reading the perl 6 docs (new to perl). the introduction says that rakudo is "a compiler for Perl 6". why is it called a compiler? i would have thought of it as an interpreter because you don't compile a binary from a perl script before you run it. 13:54
13:54 netrino joined
pmurias msiism: because it compiler Perl 6 to an intermediate form before running it 13:55
msiism: rakudo can compile Perl 6 to moarvm bytecode or *experimentally* to jvm bytecode or JavaScript 13:56
13:58 antoniogamiz joined
msiism ok, i don't really understand that. bytecode means that rakudo transfroms the perl code into something the computer can really work with before it's run, doesn't it? 13:58
jnthn It transforms it into a form that a runtime (virtual machine) can run; it just also happens to be able to do all of that in-memory rather than having to write bytecdoe to disk for the VM to load afterwards. 14:00
msiism btw, the link to the rakudo website in the linux install section results in a 404 (perl6intro.com/#_installing_perl_6).
jnthn: ok, i see. 14:01
but would it be wrong to call it an interpreter?
jnthn Well, the whole compiler/interpreter distinction is pretty blurred these days anyway. For example, MoarVM starts off by interpreting bytecode, then JIT-compiles hot things into machine code, but if the code hits a rarely taken path it falls back to the interpreter to handle that bit, etc. 14:03
Same for most modern runtimes, I guess :)
Rakudo itself doesn't contain anything to actually execute code, though; it really is turning Perl 6 into something else that can then be either interpreted or JIT-compiled.
msiism ok, i need to read up on that again. i had read things about that in the wikipedia article a while back but was pretty confused by all that. 14:04
14:05 alexghacker joined 14:06 curan left 14:11 Manifest0 left
alexghacker I'm working on a class with private attributes (e.g. "has @!cells") and am having trouble getting it to .clone properly. The same code works fine if the attribute is public (i.e. "has @.cells"), so this is confusing and I'm not sure what I'm doing wrong. 14:15
perlpunks.de/paste/show/5cf67c7a.250d.308
this is a distilled example 14:16
timotimo clone doesn't do private attributes at all
alexghacker ah
that would be my problem.
14:16 Manifest0 joined
alexghacker so how does one make a class with private attributes cloneable? or is that something that's just not possible? 14:17
pmurias timotimo: why doesn't it?
alexghacker My example does verify that .clone is making a shallow copy of the private attributes 14:18
timotimo oh, it does clone private attributes?
i think clone's tweaks hash doesn't go into private attributes 14:19
alexghacker which makes sense 14:20
timotimo you may have to `my $thecopy = callsame; $thecopy!cells = @!cells.deepmap... }
alexghacker Yes, that should work. 14:21
or not 14:25
No such private method '!cells' for invocant of type 'FooPrivate' 14:26
------> od clone { my $clone = samewith; $clone!⏏cells = @!cells.deepmap(-> $c is copy {
timotimo oops
i think the thing with clone and the tweaks hash is that private attributes are meant to be private, while putting the name of some private attribute into clone as an argument is the opposite of private
alexghacker yes, I understand that philosophical problem 14:27
14:27 netrino left
timotimo can put a private method in there that updates @!cells from a given array 14:27
14:33 netrino joined 14:46 woolfy joined 14:47 lizmat joined 14:53 lgandras left 15:06 netrino left, Sgeo__ joined 15:09 Sgeo_ left 15:10 pmurias left, uzl joined
uzl weekly: uzluisf.gitlab.io/posts/2019/raku-attributes/ 15:11
notable6 uzl, Noted!
15:12 netrino joined
cpan-p6 New module released to CPAN! Ranker (0.0.2) by 03UZLUISF 15:16
15:18 Manifest0 left 15:23 uzl left 15:24 Manifest0 joined
ugexe why are you demonstrating BUILD instead of TWEAK? 15:27
it also reads a bit weird to claim attributes are private by default. there is no default, you must be explicit 15:29
although i guess that is how you look at it
15:36 patrickb left 15:42 freddykiks joined 15:43 antoniogamiz left 15:44 Manifest0 left 15:45 netrino left 15:50 Manifest0 joined 15:51 netrino joined 15:52 sena_kun joined 15:54 domidumont left 15:56 freddykiks left 15:59 abraxxa left
Altreus > Note that there is no Roman numeral for zero and the largest possible Roman numeral with the above rules is 3,999. 16:03
what part of the rules limits it to 3,999? :\
I thought it had some character limit but there isn't 16:04
16:12 [particle] left 16:16 ravenousmoose joined 16:18 [particle] joined, ravenousmoose left 16:19 ravenousmoose joined 16:20 kaare__ joined, kaare_ left, ravenousmoose left 16:22 ravenousmoose joined 16:24 mtg joined, netrino left 16:30 netrino joined 16:34 molaf joined 16:35 [Coke] joined
[Coke] anyone have a sample for how to wrap an or create one from scratch? Want to modify the stdin sent to a process without having to invoke another external process to do so. 16:37
*an IO::Handle
... Oh, it's in the docs, you say? *facepalm*
16:44 Manifest0 left, robertle joined 16:45 dakkar left
[Coke] ok, what I want is to be able to do a .lines over a file and turn that into an IO::Handle or a Proc::Async::Pipe that I can feed to bind-stdin, that looks different than the example. 16:46
m: say .log10 for 10 X** 1..4 16:50
camelia 1
2
2.9999999999999996
4
[Coke] m: say .log10 for 10 X** 1..10 # huh, it's multiples of 3. 16:51
camelia 1
2
2.9999999999999996
4
5
5.999999999999999
7
8
8.999999999999998
10
16:51 roguelazer left
[Coke] wonders if he's returned at a weird time, or if freenode is now a wasteland. 16:51
16:52 Manifest0 joined, roguelazer joined
El_Che [Coke]: it feels emptier 16:52
tobs m: sub lcfirst ($_) { S[^\w] = $/.lc }; say lcfirst "HELLO" # Xliff, timotimo (backlogging) 16:53
camelia hELLO
tobs if I ever made a list of fanciest p6 syntaxes, substitution-assignment would rank pretty high 16:54
16:55 roguelazer left, holyghost joined
holyghost hi 16:55
Xliff, did you see my PaganVisions2 mail ? 16:57
16:57 roguelazer joined 16:58 roguelazer left 16:59 roguelazer joined 17:01 roguelazer left, roguelazer joined 17:03 netrino left 17:05 ravenousmoose left, dolmen left 17:06 molaf left 17:08 nadim joined 17:09 netrino joined 17:10 rindolf left 17:18 Manifest0 left 17:26 Manifest0 joined 17:27 msiism left 17:29 rindolf joined 17:30 |oLa| joined 17:41 uzl joined 17:42 netrino left 17:43 vrurg left, vrurg joined 17:48 netrino joined
ugexe m: 42 R= my $a; say $a; # the fanciest syntax 17:50
camelia 42
ugexe [Coke]: i'm not sure that is possible. bind-stdin requires something with a native descriptor, not just something that is IO::Handle 17:53
i suppose you could could just write data some some file, then pass the process the handle to *that* file (which can still be written to) 17:57
17:58 lichtkind joined 18:01 netrino_ joined
uzl Hi, ugexe! The only reason why I used BUILD instead of TWEAK was because it's the submethod that bless calls, although I'm not sure if that's reason enough ;-) 18:02
18:03 netrino left
uzl You says that it's a bit weird to claim attributes are private by default. Any idea on how could it be phrased better? 18:04
My mental image of $. is that it's just a shortcut for $! and an accessor. Thus declaring everything with $! would mean they couldn't be accessed w/o from outside the class. 18:08
alexghacker timotimo: I was almost defeated, even with your advice, until I used .WHAT on @!cells/@.cells to notice that, unless they were overridden with the tweaks, after each object was bound to the same array. So what looks like is necessary is to update the binding using := in the private method. 18:10
perlpunks.de/paste/show/5cf6b368.6bbb.2ff 18:11
timotimo you mean .WHERE? 18:12
alexghacker errr
No, I meant .WHICH
actually
timotimo m: say [1, 2, 3].WHICH; say [1, 2, 3].WHICH
camelia Array|73982616
Array|74695744
timotimo right
i was actually just about to go AFK
alexghacker thanks for the pointer to the right direction 18:13
timotimo glad i could help 18:14
ugexe thats why i said it depends on how you look at it. you could say $! just doesn't create accessors instead of $. creates accessors. 18:15
uzl
18:17 |oLa| left
ugexe but yeah i dont have strong feelings either way. just noting it felt weird reading it 18:17
[Coke] ugexe: I'm not sure the native descriptor part was clear in the docs. 18:18
uzl ugexe: I see. I guess I look at it going starting from a barebone situation (so to speak) and then adding stuff to it.
[Coke] hurls docs.perl6.org/type/Proc::Async#me...bind-stdin - if you could add some color there, that'd be great. 18:19
(and thanks for the tip)
ugexe m: IO::Handle.new.open 18:21
camelia IO::Handle is disallowed in restricted setting
in sub restricted at src/RESTRICTED.setting line 2
in method new at src/RESTRICTED.setting line 23
in block <unit> at <tmp> line 1
ugexe "Invocant of method 'd' must be an object instance of type 'IO::Path', not a type object of type 'IO::Path'. Did you forget a '.new'?" 18:22
uzl BTW, what did you strike as odd with the usage of BUILD vs TWEAK? Admittedly I get confused oftentimes when deciding to use BUILD or TWEAK.
* strike you
ugexe i believe we encourage the use of TWEAK because it has the behavior most people expect
"This means that BUILD may change an attribute, but it does not have access to the contents of the attribute declared as its default; these are available only during TWEAK (see below), which can 'see' the contents of an attribute initialized in the declaration of the class." 18:24
uzl Fair enough. I'll change it ;-)! 18:25
ugexe m: class Foo { has $.attr; submethod BUILD($!attr = $!attr * 2) { } }; say Foo.new(attr => 1).attr 18:26
camelia Use of uninitialized value of type Any in numeric context
0
in code at <tmp> line 1
ugexe m: class Foo { has $.attr; submethod TWEAK($!attr = $!attr * 2) { } }; say Foo.new(attr => 1).attr
camelia 2
uzl Oh, great. Thanks! 18:27
18:29 sauvin left
ugexe [Coke]: I'm not sure how someone would document that. I'm not sure we have anything for working with actual file descriptors other than .native-descriptor for accessing it *if* it exists 18:30
Something backed by a file descriptor -- ok but what does "file descriptor" mean in the context of perl6? 18:31
18:32 Manifest0 left 18:33 ravenousmoose joined 18:38 Manifest0 joined
[Coke] I'm asking because we setup p6doc's test to use awk (originally, now p5) to send input to aspell.. and I want to just use the p6 I'm in to generate that output on the fly. Guess I could save it out to a file and 'cat' it if I'm desperate to remove the p5 dep. 18:39
18:58 farcas82 joined 18:59 lizmat left 19:00 lizmat joined 19:02 andrzejku joined
ugexe yeah it'd be nice if there was a way to get like a file descriptor for some sort of in-memory abstraction 19:07
19:07 adu joined
ugexe i guess thats sort of what a socket is 19:07
sockets have descriptors, but a socket is not an IO::Handle (just close to it) so that doesn't help with bind-stdin 19:08
timotimo you mean like memfd? 19:10
ugexe yeah, except portable 19:12
skids m: class sayer { has $.accum is rw = ""; method print (*@s) { $.accum ~= [~] @s } }; my sayer $s .= new(); { temp $*OUT = $s; say "hello world"; say "Not really saying this yet" }; print $s.accum.uc 19:22
camelia HELLO WORLD
NOT REALLY SAYING THIS YET
ugexe well, yes, but that doesn't work with anything expecting a low level file descriptor like Proc.bind-stdin 19:23
19:23 farcas82 left
skids Ah, I see. IO::Pipe not "portable" enough? 19:26
19:27 abraxxa joined 19:28 woolfy left, noisegul left, abraxxa left, cpan-p6 left 19:29 lizmat left
ugexe the issue is getting a native file descriptor to represent some perl6 data that doesn't otherwise have a file descriptor 19:30
so you could create some IO::Pipe, but without a file descriptor it doesn't matter for e.g. .bind-stdin
skids Right so why not open a pipe and supply it with that perl6 data?
And use that fd? 19:31
timotimo pushing data into pipes could block, maybe?
and you'd be copying that data around, perhaps unnecessarily
though i'm not sure moar will just allow you to get the address-in-memory of a VMArray's blob for example
ugexe i dont think you get a file descriptor from doing IO::Pipe.new(...)
i imagine its given/set a file descriptor at some point 19:32
skids If you're piping data to a process via .bins-stdin, you're copying it.
ugexe github.com/rakudo/rakudo/blob/45bb...#L231-L239 19:33
skids The only way not to is if the receiving process knows how to set up a SYSV shm or other mmap. Which I'm guessing aspell doesn't :-)
19:36 cpan-p6 joined, cpan-p6 left, cpan-p6 joined
ugexe run("cat", :in("foo.pdf".IO.open)) would only copy once, instead of via an intermediary 19:39
19:40 Manifest0 left
timotimo passing a memfd also means that the other process can seek, and you can change the contents while the other program is running 19:44
19:45 Manifest0 joined 19:50 Manifest0 left
skids (point taken about seeking). But, barring programs that seek, if you're modifying, you necessarily have an intermediary process doing the modifying and the data on either side of that is potentially different so... I don't get what you are trying to do... 19:52
19:53 andrzejku left, andrzejku joined
ugexe and if you're not modifying it? 19:54
19:54 Manifest0 joined
ugexe essentially what is asked is a generic source with a file descriptor that can work with any sink that uses a file descriptor 19:55
so yeah you can just write to a file while some other process reads from it, but thats not exactly ideal 19:56
20:01 Manifest0 left 20:05 uzl left 20:06 Manifest0 joined 20:10 ufobat_ joined 20:14 ufobat__ left 20:24 gfldex left 20:25 vrurg left, vrurg joined 20:26 gfldex joined, Manifest0 left 20:28 Kaiepi joined 20:30 Manifest0 joined, gfldex left 20:31 molaf joined
skids If you're not modifying it... and it's data in your Perl6 process, then it's either A) for the 90+% of consumers that don't seek, a matter of opening a pipe fd and setting up some async to push the data to it or B) using unportable mmap/memfd features or an abstraction library (which necessarily loses some features) and putting your output into a Buf you allocate via NativeCall (thus assuming the responsibility of managing the memory) 20:48
Xliff m: DateTime.now(timezone => 'utc') 20:49
camelia Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5utc' (indicated by ⏏)
in block <unit> at <tmp> line 1
20:49 dolmen joined
Xliff Oh! It's already in UTC! /o\ 20:50
20:50 ravenousmoose left 20:59 pecastro joined 21:00 skids left 21:01 lizmat joined, dolmen left 21:05 holyghost left 21:06 woolfy joined, andrzejku left
ugexe how do you open a pipe fd in perl6 without spawning another process? 21:10
because that is exactly what is otherwise being asked for (its just not possible afaik)
21:10 netrino_ left
ugexe IO::Pipe.new(...) doesn't just create a fd though 21:11
like i said, someone could just create a temp file and write data to it while reading it from elsewhere. but there is a lot of boilerplate that needs to be carefully considered in even just setting up a temp file to accomplish this. why can't this behavior be abstracted further? 21:12
21:17 donaldh joined 21:19 donaldh left 21:26 donaldh joined, donaldh left 21:27 donaldh joined 21:30 dolmen joined 21:31 donaldh left 21:32 gfldex joined 21:36 Manifest0 left 21:37 gfldex left 21:41 Manifest0 joined 21:44 gfldex joined 21:45 netrino_ joined 21:47 obfusk left 21:49 obfusk joined 21:50 dolmen left 21:51 obfusk left, lizmat left 21:53 obfusk joined 21:58 Manifest0 left 22:04 Manifest0 joined, dolmen joined 22:05 robertle left
Xliff m: my ($a, $b) = "?hello".split('?'); say $a.defined; say $a.chars; 22:05
camelia True
0
22:06 woolfy left 22:08 rindolf left 22:12 Manifest0 left 22:17 Manifest0 joined 22:18 netrino_ left 22:24 netrino_ joined 22:28 nadim left 22:33 Manifest0 left 22:39 Manifest0 joined 22:46 farcas82 joined 22:51 pecastro left, Manifest0 left 22:55 Manifest0 joined 22:56 netrino_ left
Xliff m: DateTime.now.say 22:56
camelia 2019-06-05T00:56:59.481714+02:00
Xliff m: DateTime.now(timezone => 0).say 22:57
camelia 2019-06-04T22:57:28.466629Z
23:00 Altai-man_ joined 23:02 sena_kun left 23:03 netrino_ joined, lizmat joined 23:04 dolmen left 23:05 sena_kun joined 23:07 Altai-man_ left 23:19 Manifest0 left 23:24 Manifest0 joined 23:31 Manifest0 left 23:32 mtg left 23:36 netrino_ left, Manifest0 joined
Xliff m: chr(0xC7).say 23:41
camelia Ç
23:42 netrino_ joined 23:46 khisanth_ left 23:57 Manifest0 left 23:59 khisanth_ joined