»ö« 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:07 Manifest0 left 00:13 Manifest0 joined 00:14 PotatoGim left
guifa <AlexDaniel timotimo Aearnus>.map(*++) I had just remembered in the docs saying the optimizer had freedom to not do it but wasn’t sure how strong that optimization was. Definitely not worth it then for counting the number of digits in a number :-) 00:14
00:17 tbrowder left
MasterDuke guifa: .chars wouldn't work? 00:17
00:17 mrsolo left
guifa Negative. -12.3.Str.chars gets you 5 00:17
But I need it to be 3
MasterDuke ah 00:18
then maybe .comb(/\d/).elems ? 00:20
00:22 PotatoGim joined 00:24 PotatoGim left 00:28 isacl___ left
ugexe m: say ord(42); say ord(420); 00:38
evalable6 52
52
ugexe maybe that should fail/throw? 00:39
i.e. fail if more than 1 char 00:40
00:40 isacl___ joined 00:42 mrsolo joined
Xliff m: my $a; $a = $/[0] if "aaa" ~~ /('a' 00:43
evalable6 (exit code 1) 04===SORRY!04===
Regex not terminated.
at /tmp/HNc9PnYa6u:1
--…
Xliff, Full output: gist.github.com/2d04790482094e4be4...627e2bc193
Xliff m: my $a; $a = $/[0] if "aaa" ~~ /('a') aa/; say $a
evalable6 「a」
Xliff m: my $a; $a = $/[0] if "aaa" ~~ /.aa/; say $a
evalable6 (Any)
Xliff m: my $a; $a = $/[0] if "zaa" ~~ /(.)aa/; say $a 00:44
evalable6 「z」
AlexDaniel ugexe: if that starts to throw, then .uniname should too
ugexe: it *feels* like they both do .foos[0]
so in that sense the behavior is consistent and easy to understand 00:45
although it makes me wonder why these shortcuts exist at all :)
like: .ord vs .ords[0], that's quite a bit shorter but are we really designing the language for golfing? :) 00:46
note that the second one explicitly tells you what it means and how it's going to behave in edge cases
00:46 PotatoGim joined
guifa MasterDuke: I went with .comb.map(* ne ‘.’ | ‘-‘).elems, I figure avoiding regex will be a bit faster, but maybe if there’s overhead with junctions I should be wary of and use .map({ $^a ne ‘.’ && $^ ne ‘-‘ }). Although important thing is to get it working first and the junction is clearer to me anyways 00:47
MasterDuke a junction will almost certainly be slower than using && or || 00:48
AlexDaniel ugexe: then there's also .chr which does something completely useless on actual lists
MasterDuke but yeah, a regex is probably also slow 00:49
AlexDaniel and .chrs works fine on single values
00:49 tbrowder joined
AlexDaniel so, why? 00:49
ugexe: ah also, .uniprop goes into the same list with .ord and .uniname 00:50
00:50 w_richard_w joined, nekomune left 00:52 netrino left
AlexDaniel I'm fond of throwing things away from the language, so maybe don't listen to me :) 00:53
but I do thing that if somebody proposed `.chr` today we wouldn't add it because we already have .chrs which just works 00:54
think*
00:57 nekomune joined
ugexe i agree the non-plural variants seem a bit pointless 01:00
probably just brought over from perl 5 01:01
Xliff m: sub a { return 1; LEAVE { 'I LIVE!' } }; say a
evalable6 WARNINGS for /tmp/nzezyCh0Js:
1
Useless use of constant string "I LIVE!" in sink context (line 1)
01:01 kurahaupo_ joined
Xliff m: sub a { return 1; LEAVE { say 'I LIVE!' } }; say a 01:01
evalable6 I LIVE!
1
Xliff I love phasers! =)
01:03 kurahaupo left
AlexDaniel Xliff: I loved them too github.com/perl6/whateverable/comm...59d760d803 01:05
ugexe: consider filing a ticket here github.com/perl6/problem-solving/issues 01:06
ugexe: it's unlikely that non-plural variants will go away, but we can have some very soft deprecation on them
“not recommended in new designs” :)
Xliff m: sub a { return 1; LEAVE say 'I LIVE!' }; say a # Ooh! Statements 01:09
evalable6 I LIVE!
1
Xliff m: sub a { return 1; LAST say 'I LIVE!' }; say a # *shrug* 01:10
evalable6 1
Xliff m: sub ab ($a, $b) { ($a, $b).say }; my %h = ( a => 5, b => -1 ); ab( |%h<a b> ); 01:15
evalable6 (5 -1)
01:26 buffet_ joined 01:27 buffet left, Manifest0 left 01:32 mowcat joined 01:33 Manifest0 joined 01:41 _jrjsmrtn joined 01:43 __jrjsmrtn__ left 01:45 rindolf left
Xliff m: class A { method a { 1 }; method b { 2 }; }; my $meth = 'a'; A."$meth"() 01:51
evalable6
Xliff m: class A { method a { 1 }; method b { 2 }; }; my $meth = 'a'; A."$meth"().say
evalable6 1
Xliff m: class A { method a { 1 }; method b { 2 }; }; my $meth = 'b'; A."$meth"().say
evalable6 2
Xliff m: class A { method a { 1 }; method b { 2 }; }; my $meth = 'b'; A.\$meth().say
evalable6 (exit code 1) 04===SORRY!04=== Error while compiling /tmp/pZ03ih6WF4
Malformed postfix call
at /tmp/pZ03ih6WF4:1
------> 03}; method b { 2 }; }; my $meth = 'b'; A.08⏏04\$meth().say
Xliff m: class A { method a { 1 }; method b { 2 }; }; my $meth = 'b'; A.$meth().say
evalable6 (exit code 1) No such method 'CALL-ME' for invocant of type 'Str'
in block <unit> at /tmp/H_wzrRzsfR line 1
02:03 Manifest0 left, Manifest0 joined 02:13 ryanth left 02:28 Xliff left 02:30 Cabanossi left 02:34 admiral joined, Cabanossi joined 02:39 admiral left 02:53 Manifest0 left 02:58 Manifest0 joined 03:00 vrurg left 03:01 vrurg joined 03:05 Manifest0 left 03:11 Manifest0 joined, Cabanossi left 03:13 Cabanossi joined 03:20 zacts joined 03:25 adu joined 03:48 Manifest0 left 03:53 Manifest0 joined 03:54 zacts left 03:57 zacts joined 04:10 Manifest0 left 04:16 Manifest0 joined 04:22 zacts left 04:40 Manifest0 left 04:43 aindilis left 04:48 Manifest0 joined 04:51 aindilis joined 04:57 Manifest0 left 05:03 Manifest0 joined 05:10 Manifest0 left 05:15 Manifest0 joined 05:28 Manifest0 left 05:33 Manifest0 joined 05:35 aborazmeh joined, aborazmeh left, aborazmeh joined 05:55 w_richard_w left 06:02 adu left 06:04 jmerelo joined 06:11 andrzejku joined 06:20 Manifest0 left
Elronnd anyone use p6 for web? Should I use cro or bailador? (Or something else?) 06:21
06:27 Manifest0 joined 06:34 andrzejku left 06:36 Manifest0 left
discord6 <Tyler (Aearnus)> I have the same question 06:37
Elronnd I found this www.nntp.perl.org/group/perl.perl6...g5203.html (also the reply). Also cro has fancy stuff like http/2 and websockets 06:38
I think I'm gonna go with cro
06:38 beardio joined 06:39 andrzejku joined
Elronnd I got a failing test building rakudo in freebsd 06:39
in LWP::Simple, get-w3-redirect.t
ah, looks like the w3 website it relies on is broken - jigsaw.w3.org/HTTP/300/301.html 06:41
06:41 Manifest0 joined 06:45 domidumont joined 06:53 |oLa| left
jmerelo Elronnd: you will probably get going faster with Bailador, but in the long run Cro is the best option 06:57
Elronnd: please raise an issue there github.com/perl6/perl6-lwp-simple 06:58
Elronnd: it's working now? jigsaw.w3.org/HTTP/300/Overview.html
Elronnd hum, must have been temporarily down. When I visited it before in my browser it spat out some weird json-formatted error about unimplemented GET or something like that 07:01
alright, I'll do cro then 07:02
jmerelo Elronnd: hum. Might be somethign else. If you've still got that in your terminal, copy/and paste it to an issue.
Elronnd 0nah, wiped that screen 07:03
is probably fine though
I'll run a make test and see what happens
jmerelo Elronnd: thanks!
Elronnd yep, tests for lwp simple pass now 07:08
(maybe shouldn't depend on a third-party website for that test, though?)
07:11 sivoais_ joined, sivoais left
Elronnd hmmm, when I run the 'cro' command, it just hangs forever, no matter what I give it 07:13
xq definitely should not depend on something as fragile as network for tests 07:15
would be more reliable to make a temporary http server listen on 127.0.0.1 and test using that 07:16
Elronnd well maybe, but then you have to test the server too
so it's unclear if what's being tested is client or server
xq on a bright side this setup theoretically should fail in a reproducible way 07:17
Elronnd true
lizmat weekly: theperlfisher.blogspot.com/2019/04/...g-out.html 07:20
notable6 lizmat, Noted!
holyghost I'm a week away with my kids, I return the week after 07:23
07:23 holyghost left
Geth doc: 8a35386261 | (JJ Merelo)++ | doc/Type/Metamodel/CurriedRoleHOW.pod6
Adds M::CurriedRoleHow

Mainly for the sake of illustration. Text copied from @jnthn comment at the beginning of the source code. Refs #1306
07:26
synopsebot Link: doc.perl6.org/type/Metamodel::CurriedRoleHOW
doc: e911e2e132 | (JJ Merelo)++ | doc/Type/Metamodel/CurriedRoleHOW.pod6
Adds an example of direct use refs #1306
07:35
synopsebot Link: doc.perl6.org/type/Metamodel::CurriedRoleHOW
07:44 skaji left, skaji joined 07:45 mrsolo left, mithaldu_ left, hfjvjffju left, Peter_R left 07:47 hfjvjffju joined, mithaldu_ joined, Peter_R joined, mrsolo joined 07:54 DarthGandalf left 08:03 DarthGandalf joined 08:04 andrzejku left 08:05 Manifest0 left
Geth doc: a96b45966c | (JJ Merelo)++ | doc/Type/Metamodel/CurriedRoleHOW.pod6
Got it right this time

Curried roles are simply roles that have been provided with a parameter, but before they have been fully instantiated by punning or being mixed in a class. [Synopse](design.perl6.org/S14.html), for once, was useful.
Refs #1306
08:07
synopsebot Link: doc.perl6.org/type/Metamodel::CurriedRoleHOW
08:08 aindilis left 08:09 aindilis` joined 08:12 Manifest0 joined
Elronnd Is cro awesome enough to be exposed directly to the open internet, or should I still reverse-proxy it behind nginx? 08:13
08:16 sauvin left 08:20 andrzejku joined
jmerelo Elronnd: there are many sites in production, including Edument's 08:23
Elronnd but do they run nginx in front of it, or do they let cro handle everything itself? 08:28
08:28 sauvin joined
jmerelo Elronnd: not sure. I think not, but you can ask sena_kun or jnthn when they are around. 08:28
Elronnd I guess the question is, does the increased speed from the static file-serving outweight the increased latency added by the second http connection you need for reverse proxy? 08:29
ok
08:42 Xliff joined
Xliff m: class A { method a { ... } }; A.new 08:42
evalable6
Xliff m: class A { method a { ... } }; A.a.new
evalable6 (exit code 1) Stub code executed
in method a at /tmp/z7Zs2GeFy0 line 1
in block <unit> at /tmp/z7Zs2GeFy0 line 1
08:43
08:43 sivoais_ left
Xliff m: class A { method a { ... } }; class B does A { }; 08:43
evalable6 (exit code 1) 04===SORRY!04=== Error while compiling /tmp/nJYjFG9cJ7
A is not composable, so B cannot compose it
at /tmp/nJYjFG9cJ7:1
Xliff m: class A { method a { ... } }; class B does A { method a { 1 } };
evalable6 (exit code 1) 04===SORRY!04=== Error while compiling /tmp/e6FZdzIFT_
A is not composable, so B cannot compose it
at /tmp/e6FZdzIFT_:1
08:43 sivoais joined
Xliff m: class A { method a { } }; class B does A { method a { 1 } }; 08:43
evalable6 (exit code 1) 04===SORRY!04=== Error while compiling /tmp/C45Nhdvkp9
A is not composable, so B cannot compose it
at /tmp/C45Nhdvkp9:1
Xliff m: class A { method a { '' } }; class B does A { method a { 1 } }; 08:44
evalable6 (exit code 1) 04===SORRY!04=== Error while compiling /tmp/KmLdT3d1J6
A is not composable, so B cannot compose it
at /tmp/KmLdT3d1J6:1
Xliff m: class A { method a { }; }; class B does A { method a { 1 } };
evalable6 (exit code 1) 04===SORRY!04=== Error while compiling /tmp/fK4YF_uQd_
A is not composable, so B cannot compose it
at /tmp/fK4YF_uQd_:1
Xliff m: class A { method a { ... } }; class B is A { };
evalable6
Xliff m: role A { method a { ... } }; class B does A { }; 08:46
evalable6 (exit code 1) 04===SORRY!04=== Error while compiling /tmp/Wdn2yDF_iU
Method 'a' must be implemented by B because it is required by roles: A.
at /tmp/Wdn2yDF_iU:1
Xliff m: role A { method a { ... } }; role B { method a { 1 } }; class BB does A { also does B }; 08:47
evalable6
Xliff m: role A { method a { ... } }; role B { method a { 1 } }; class BB does A { method a { 'a' }; };
evalable6
08:48 beardio left
Xliff m: use NativeCall; class A is repr('CPointer') { submethod DESTROY { say "BOO!" } }; A.new 08:49
evalable6 WARNING: unhandled Failure detected in DESTROY. If you meant to ignore it, you can mark it…
Xliff, Full output: gist.github.com/a26383346eb9d2f1a2...c3ba0c1823
08:56 Manifest0 left 09:00 _jrjsmrtn left 09:01 Manifest0 joined 09:04 andrzejku left 09:14 __jrjsmrtn__ joined 09:29 hamhu3_ joined 09:31 hamhu3 left 09:49 jmerelo left 09:53 sena_kun joined 09:56 kurahaupo_ left 10:03 rindolf joined 10:17 CIAvash joined 10:22 CIAvash left 10:24 Black_Ribbon left 10:29 Xliff left 10:37 ayerhart left 10:41 ayerhart joined 11:09 netrino joined 11:13 araraloren joined 11:29 andrzejku joined 11:39 ayerhart left 11:43 MasterDuke left 11:50 aborazmeh left 11:51 ayerhart joined 11:57 andrzejku left
jnthn Elronnd: All of the Cro things I've got in production have a reverse proxy in front of them (some Apache, some nginx) 11:58
12:02 araraloren left, araraloren joined
moritz the social class of people who write Cro applications is called croletariat, right? :D 12:02
jnthn It is now :P 12:03
sena_kun .oO ( crolean's prayer )
12:03 MasterDuke joined, MasterDuke left, MasterDuke joined
El_Che moritz: croletes 12:05
Cro-Magnons 12:09
moritz Cro-ssants :D
El_Che hehe
hahainternet Web 2.Cro 12:10
jnthn And of course, when we need a break for writing Cro applications, we go to the cro bar... :) 12:11
El_Che Hoed u voor al te gretige koopjesjagers op tweedehandssites die meer bieden dan de vraagprijs. De politie van Mechelen-Willebroek jaagt op dieven die via die sites toegang proberen te krijgen tot de rekening van de verkoper. Dat meldt VRT. 12:12
oops
ignore :)
12:12 Sgeo__ left
El_Che If you raise cros, they'll peck out your eyes 12:13
12:13 Sgeo__ joined
araraloren Can't read that :D 12:13
12:48 Nycatelos joined
Nycatelos tyil: desu 12:48
12:48 Nycatelos left 13:23 natrys joined 14:13 buffet_ is now known as buffet 14:30 MilkmanDan left 14:31 MilkmanDan joined 14:33 buffet left 14:59 zacts joined 15:04 zacts left 15:05 andrzejku joined 15:07 nekomune left 15:11 cpan-p6 left, cpan-p6 joined, cpan-p6 left, cpan-p6 joined 15:19 nekomune joined
guifa Is there a cleaner way to conditionally pass a named parameter based on its definedness? (I know theoretically I could use a capture slip, but then I lose some of the self-docmenting that goes from explicitly mentioning it) 15:23
Right now I’m using foo( |(:$bar if $bar) ) but it just feels… ugly 15:24
If I pass directly, the second method gets an Any type and that prevents the default value from being loaded 15:27
15:28 thepler joined 15:29 hamhu3 joined 15:32 hamhu3_ left 15:34 thepler left 15:44 zacts joined 15:57 natrys left 16:29 hamhu3_ joined 16:32 hamhu3 left 16:34 zacts left 16:38 zakharyas joined 16:40 ctilmes_ joined 16:41 ctilmes left 16:45 Sgeo_ joined 16:46 sena_kun left 16:48 xinming left, sergot left, titsuki_ left, pierrot left, chee left, tailgate left, masak left, aeruder left, niceplace left 16:49 Sgeo__ left
gabc Hi, let's say I have a string "~/dir" and I want to expand the ~ to be a absolute path, is there a method for that already? 16:52
Right now I have this, $file.subst: /^.*\~/, $*HOME; which seems to work but feels clunky
16:52 nekomune left
MasterDuke gabc: docs.perl6.org/routine/resolve#cla...%3A%3APath seems like it might do what you want 16:53
lizmat MasterDuke: that doesn't do ~ expansion 16:54
gabc It doesn't seem to work, maybe it's an osx thing
16:54 zacts joined
lizmat my "solution": my $file = "~/ten"; $file = $*HOME ~ $file.substr(1) if $file.starts-with("~/"); 16:56
gabc Looks good too thanks :) 16:59
I tried to see if something already did the ~ expansion and couldn't find anything
MasterDuke oh, .absolute works
m: say "~/".IO.absolute 17:00
evalable6 /home/bisectable/git/whateverable/~
gabc In my case it doesnt:
> "~/".IO.absolute
/Users/g/Music/~
(my cwd is ~/Music)
17:01 nekomune joined
gabc And even then, /home/bisectable/git/whateverable/~ <- this isn't right is it? 17:01
lizmat MasterDuke: I don't think anything does ~/ expansion, as it is an shell / OS specific thing 17:02
17:03 ctilmes__ joined 17:04 ctilmes_ left
MasterDuke hm 17:04
17:05 sergot joined, titsuki joined 17:06 masak joined, niceplace joined, tailgate joined, chee joined, masak is now known as Guest47580, xinming joined, chee left, chee joined 17:07 aeruder joined, pierrot joined
gabc anyway, thanks for the help again :) 17:12
17:13 ctilmes__ left 17:14 aindilis` left 17:15 aindilis joined
SmokeMachine guifa: |(:bar($_) with $bar) 17:16
guifa SmokeMachine it’s not exactly prettier haha 17:17
I was hoping for something like :?$bar
:-)
SmokeMachine But this one tests definedness and not truthness... 17:18
guifa ah fair
in my case the two may as well be the same, that’s probably why it’s been working 17:19
SmokeMachine guifa: maybe a slang for that? 17:22
://$bar ?
Definedness 17:23
And :||$bar for truthness?
guifa I like the idea. I’ve never written a slang before. 17:24
SmokeMachine m: my $bla =True; say :!$bla 17:28
evalable6 (exit code 1) 04===SORRY!04=== Error while compiling /tmp/RypFO4HrNd
Malformed False pair; expected identifier
at /tmp/RypFO4HrNd:1
------> 03my $bla =True; say :!08⏏04$bla
SmokeMachine could be bla => False
17:29 Kaiepi left
SmokeMachine m: given 42 { dd [ :.is-prime ] } 17:30
evalable6 (exit code 1) 04===SORRY!04=== Error while compiling /tmp/Zj19zqcydb
Bogus statement
at /tmp/Zj19zqcydb:1
------> 03given 42 { dd [ :08⏏04.is-prime ] }
expecting any of:
colon pair
SmokeMachine Could be :!is-prime
guifa: ^^
17:37 sena_kun joined 17:40 lucasb joined 17:54 zakharyas left
Elronnd jnthn: alright 17:54
18:03 antoniogamiz joined
antoniogamiz I'm back :D \o/ 18:04
if someone is near Granada and wants to participate: github.com/antoniogamiz/devroom-perl-eslibre 18:05
18:09 ctilmes joined 18:13 ctilmes left 18:17 zacts left
guifa antoniogami: I’ll be near there this summer 18:24
Ah but it’s in June. I don’t get there until July
18:26 ctilmes joined 18:32 zacts joined, zacts left
antoniogamiz guifa: almost :( 18:33
cpan-p6 New module released to CPAN! AttrX::Mooish (0.6.2) by 03VRURG 18:41
18:49 andrzejku left, andrzejku joined 18:50 antoniogamiz left 18:55 araraloren left 19:01 zacts joined
guifa AND DONE! 19:02
Intl::CLDR now has a fully featured decimal number formatter
19:06 domidumont left 19:31 zachk joined, zachk left, zachk joined
guifa say format-number(12348596, :language<ar>, :scientific) —> ١٫٢٣٤٨٥٩٦اس٧ 19:34
say format-number(532812, :language<de>, :long) —> 5,3 Tausend
say format-number(384921923, :language<ja>, :short) —> 3.8億 19:35
19:42 roguelazer joined 19:46 vrurg left 19:47 roguelazer left 19:58 ctilmes_ joined, ctilmes left 20:02 khisanth_ left 20:04 zacts left, andrzejku left 20:07 zacts joined, zacts left 20:15 khisanth_ joined 20:28 qad2 joined 20:32 qad2 left 20:37 roguelazer joined 20:39 roguelazer left 20:46 roguelazer joined 20:54 roguelazer left 21:08 Black_Ribbon joined 21:31 Cabanossi left, Guest47580 is now known as masak 21:35 reu left 21:39 Cabanossi joined 21:40 zacts joined 21:47 zacts left 21:54 reu joined 22:05 squashable6 left 22:07 sena_kun left
masak is pleased to confirm that `enum E does R <...>` Just Works 22:09
22:10 squashable6 joined, ChanServ sets mode: +v squashable6 22:19 roguelazer joined
timotimo DrForr: did you know about "<comment> +"? 22:28
DrForr: also, the paragraph near the end about "the csv test suites" sounds like you're referring to tux's test-t, but that uses stuff other than regexes to become fast 22:31
22:32 zacts joined 22:34 TBC_z87 joined 22:35 MasterDuke left
guifa So say I have a grammar Foo. It can get instantiated with special settings and has associated actions that are basically obligatory for it to be usefull. What’s the best way to use that instantiated grammar in another grammar? Or is the only way to make the new grammar a subclass of Foo? 22:39
guifa thinks it would be awesome to actually be able to request a reusable regex/grammar that detects numbers — based on locale — even when percentages/exponential/etc, and then can provide the value 22:45
jnthn guifa: Dunno if it helps, but it's possible to put tokens/rules/regexes in a role also 22:48
guifa: Which means you can make composable pieces that are then put together 22:49
timotimo if the actions are so inextricably linked to the grammar itself, it may not be the worst idea to actually put them inside the tokens/rules/regexes 22:51
guifa Ah! That would be much more agreeable than a grammar (and make more sense, “grammar DocumentParser does LocalizedNumberParser” sounds much better than “grammar DP is LNP”) 22:52
With the NumberFormatter grammar already made it shouldn’t be too hard to make a new one that does lenient parsing 22:54
timotimo or even "also does ParseLocalizedNumbers" 23:00
"also does That-Thing-With-The-Numbers" 23:05
23:10 reach_satori joined 23:12 MasterDuke joined, MasterDuke left, MasterDuke joined
guifa will worry more about naming after he makes it work :-) 23:12
cpan-p6 New module released to CPAN! Pygments (0.0.1) by 03MATIASL 23:24
23:28 zacts left, zacts joined
MasterDuke anyone have an email address for Skarsnik? 23:35
23:39 lucasb left 23:40 [Sno] left 23:44 [Sno] joined 23:45 llfourn left 23:50 ayerhart left 23:52 ctilmes joined 23:53 ctilmes_ left 23:57 llfourn joined, Kaiepi joined 23:58 rindolf left
Kaiepi ping 23:59
\o
23:59 Kaiepi left, Kaiepi joined