🦋 Welcome to Raku! raku.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: colabti.org/irclogger/irclogger_log/raku
Set by ChanServ on 14 October 2019.
Voldenet m: my @h; @h.push: <d>, <b c>; @h.perl.say; my ($val, @list) := do given @h { when :($, @) { @h }; default { (Any, ()) } }; [$val, @list].perl.say 00:00
xinming_: ^ the above should work 00:01
00:01 Kaiepi joined
Voldenet not sure if you can otherwise assign in destructuring signatures, it doesn't sound like something that should even be possible 00:04
00:05 pecastro left 00:18 hungrydonkey joined 00:26 patrickz joined 00:30 patrickb left 00:38 stanrifkin joined
stanrifkin i've got an linking error with rakudobrew 2020.01 "multiple definition of `cmp_tc'" 00:44
anybody got the same error as me? 00:45
00:55 patrickz left 01:13 titsuki left 01:16 wildtrees left 01:17 ZZZzz left 01:30 SqrtNegInf left 01:32 rasch joined, rasch is now known as rafsch 01:34 sena_kun left 01:35 __jrjsmrtn__ joined 01:37 _jrjsmrtn left 01:49 sena_kun joined 01:58 ZZZzz joined 02:31 molaf left 02:32 Tirifto left 02:43 molaf joined 02:59 rafsch left 03:01 stanrifkin left 03:16 ZZZzz left 03:30 leont left 03:33 sena_kun left 03:35 epony left 03:36 epony joined 03:37 epony left 03:38 epony joined 03:48 sena_kun joined 03:58 ZZZzz joined 03:59 ukine joined 04:38 molaf left 05:02 Itaipu joined 05:05 Itaipu_ left
elcaro how do i disable SSL verification in Cro 05:14
similar to `-k` in curl, or `$ua->insecure(1)` in Mojolicious
05:24 Itaipu_ joined 05:25 Itaipu left 05:29 xinming_ left, xinming_ joined 05:33 sena_kun left 05:34 aborazmeh left 05:36 Redfoxmoon joined 05:37 Redfoxmoon left, Redfoxmoon joined 05:48 sena_kun joined
Voldenet elcaro: probably Cro::HTTP::Client.get("whatever", :ca(insecure => True)) 05:54
uh, `:ca(:insecure)`, even 05:57
Cro::HTTP::Client also has 'ca' property 06:01
s/property/attribute/ 06:02
06:12 |Sno| left 06:15 Doc_Holliwould joined, Doc_Holliwood joined 06:16 sauvin joined 06:26 erdic left 06:27 erdic joined 06:28 jmerelo joined 06:29 hungryd91 joined, hungrydonkey left 06:30 epony left 06:43 epony joined
stoned75 hi. can someone help me and tell me if this snippet is idiomatic enough ("rakuic" ?) ? Or how it can be made more idiomatic ? gist.github.com/stoned/66816a5c15b...07263b7825 06:44
the idea was to use Supply.first ;)
jmerelo stoned75: there's no such thing as idiomatic in Raku. TIMTOWTDI 06:49
stoned75: that one looks fine, really
stoned75 I was sure someone would say this ;)
jmerelo m: m: my @results = gather for 1..1 { ^10 .map: *.take }; say @results 06:50
m: my @results = gather for 1..1 { ^10 .map: *.take }; say @results
Camelia has stopped working...
06:53 nebuchadnezzar left
stoned75 my @results = gather for Real { ^10 .map: *.take }; say @results 06:53
07:03 |Sno| joined 07:25 rindolf joined 07:27 rindolf left 07:29 domidumont joined 07:31 rindolf joined 07:32 sena_kun left 07:33 stoned75 left 07:35 darkstardev13 left, Doc_Holliwould left, Doc_Holliwood left
SmokeMachine m: my Supply $s .= from-list: ^100 .roll x *; $s.first: *.is-prime; react whenever $s { .say } 07:41
:( no bots?! 07:42
07:43 hacktor left 07:47 sena_kun joined 08:00 kensanata joined 08:02 darkstardev13 joined 08:06 zakharyas joined
jmerelo m: class Sunk { has $.titanic; method sink { say "Sinking $!titanic"; }}; Sunk.new( :titanic($_) ) for 1..3; 08:23
SmokeMachine: no bots
08:39 scimon joined 08:49 Doc_Holliwood joined, Doc_Holliwould joined
Geth doc/master: 4 commits pushed by (JJ Merelo)++ 08:51
08:57 nebuchadnezzar joined 09:06 rindolf left 09:07 dakkar joined, daxim left 09:12 daxim joined 09:17 rindolf joined, wamba joined 09:28 APic left 09:32 vike left 09:33 sena_kun left 09:35 Doc_Holliwood left, Doc_Holliwould left 09:42 APic joined 09:48 sena_kun joined 09:51 Black_Ribbon left 09:52 cpan-raku left, cpan-raku joined, cpan-raku left, cpan-raku joined 09:55 hungrydonkey joined 09:58 hungryd91 left, pecastro joined 10:20 wamba left 10:28 hungryd18 joined 10:31 hungrydonkey left 10:33 wamba joined 10:36 vike joined 10:37 hungryd18 left 10:38 hungrydonkey joined 10:51 NODE left 10:52 NODE joined 10:53 libertas joined 10:54 NODE left 10:55 NODE joined 10:57 NODE left, gabiruh_ is now known as gabiruh 10:59 NODE joined 11:05 hungryd22 joined 11:06 Redfoxmoon left 11:07 Redfoxmoon joined 11:08 hungrydonkey left 11:09 domidumont left 11:12 NODE left 11:13 NODE joined 11:30 hungrydonkey joined 11:34 sena_kun left, hungryd22 left 11:36 NODE left 11:37 NODE joined 11:39 nosqrt left 11:42 Doc_Holliwood joined, Doc_Holliwould joined 11:49 sena_kun joined 11:51 NODE left 11:53 NODE joined 11:57 NODE left 11:58 NODE joined 12:03 wamba left 12:04 titsuki joined 12:09 zakharyas left 12:22 Kaiepi left
cpan-raku New module released to CPAN! Math::Libgsl::Matrix (0.0.4) by 03FRITH 12:23
12:23 Kaiepi joined 12:25 squashable6 left 12:28 squashable6 joined 12:30 Doc_Holliwood left, Doc_Holliwould left 12:31 wamba joined 12:34 domidumont joined 12:46 leont joined
elcaro more cro struggles... client.get('/path/to/api?query=query+goes+here') works fine 12:50
but how can i pass the query normally. i've tried `query => { query => '...' }`
12:51 NODE left
elcaro as well as `body` but i just keep getting 404 12:51
also, when i create a request, how can i see the stringified url it's sending? 12:52
12:52 NODE joined
jnthn You probably don't want a body with a GET request, though I think you'd want to pass a content-type for the body too if sending one 12:54
CRO_TRACE=1 in the environment will show you details of what it sends
I don't think there's a convenient way to form query strings yet, though Cro::Uri provides the way to do the percent encodingt. 12:55
elcaro i did have trace on, and the api reported back the value cannot be null, so i suspected the query wasn't getting passed 12:56
just to be clear, this works in mojolicious with `$ua->get($path => form => { query => '...' }) 12:57
api docs say it's a GET, with a query param
jnthn Yes, as noted, there's no better way to do it yet than putting together the query string yourself, using encode-percents on the parts. Please make an issue requesting it at github.com/croservices/cro-http/issues/new 12:58
12:58 wamba left
elcaro ahh, sorry i missed that comment. ok, thanks... i will construct a Cro::Uri object manually 12:59
jnthn It really should be there (there's plenty of conveniences for getting query string parts on the server side...)
elcaro ok... i can raise an issue, but it just clocked midnight here, so it'll need to wait until tomorrow 13:00
thanks again
jnthn OK, thanks 13:01
I'm planning to spend some time on the HTTP client in the next week or so anyway, so can have a look at adding this too :) 13:02
13:02 pecastro left 13:03 wamba joined 13:04 squashable6 left 13:05 kensanata left 13:07 squashable6 joined
Geth doc: 3e6270d197 | (Elizabeth Mattijsen)++ | doc/Type/Mu.pod6
Elaborate on the volatility of .WHERE values
linkable6 Link: docs.raku.org/type/Mu
13:21 NODE left 13:22 NODE joined 13:25 titsuki left 13:27 NODE left 13:28 NODE joined 13:29 lucasb joined 13:30 NODE left 13:31 NODE joined 13:33 sena_kun left, titsuki joined 13:36 NODE left 13:37 titsuki left 13:38 leont left, NODE joined 13:39 NODE left 13:40 NODE joined 13:46 aindilis left 13:49 sena_kun joined 13:50 zakharyas joined 13:51 NODE left 13:52 NODE joined 13:57 pecastro joined 13:58 mtj_ joined 14:12 jmerelo left 14:14 Xliff left
cpan-raku New module released to CPAN! Math::Libgsl::Matrix (0.0.5) by 03FRITH 14:27
14:30 kensanata joined 14:36 ukine1 joined, ukine left 14:39 Coleoid joined 14:44 wamba left 14:48 NODE left 14:49 NODE joined 14:51 NODE left, wamba joined 14:53 NODE joined 14:54 NODE left 14:55 NODE joined 14:59 rindolf left 15:08 rindolf joined 15:12 NODE left 15:14 NODE joined, zakharyas left 15:16 zakharyas joined 15:18 NODE left 15:19 NODE joined 15:24 cpan-raku left, cpan-raku joined, cpan-raku left, cpan-raku joined 15:27 NODE left 15:29 NODE joined 15:30 NODE left 15:31 NODE joined 15:32 sena_kun left 15:36 NODE left 15:37 NODE joined
Coleoid Good morning - (my local offset) + (your local offset), #raku. 15:37
15:39 NODE left
Coleoid I'm trying to use the newly announced rakubrew, had trouble, and failed to make contact via listed urls for CPAN or Github... 15:39
15:40 NODE joined
Coleoid Though a new search just found the repos on Github, so perhaps I have no question any longer. 15:40
Enjoy the day!
guifa Coleoid: if you get any problems, don’t hesitate to ask. We’re all on different TZs so someone will eventually be able to respond but sometimes might take a bit 15:41
guifa heads to $day-job
15:43 Doc_Holliwould joined, Doc_Holliwood joined 15:48 NODE left, sena_kun joined 15:49 NODE joined
Coleoid Thanks, guifa. I just posted an issue in the right repo, so I think I'm good. Patrick Böker said right up front not to expect it to work right now, so I'm not fussed. 15:50
15:51 NODE left 15:52 NODE joined 15:54 NODE left 15:56 NODE joined 15:57 wamba left
cpan-raku New module released to CPAN! Text::Utils (2.1.0) by 03TBROWDER 16:00
16:00 NODE left 16:01 aborazmeh joined, aborazmeh left, aborazmeh joined 16:02 NODE joined 16:03 wamba joined
Kaiepi m: say "aa" ~~ / (<[abc]>) <!before $0> . / 16:13
m: say 1
is there a way i can ensure a capture group is not repeated? 16:14
16:15 kensanata left 16:17 Itaipu_ left 16:19 ctilmes joined
ctilmes elcaro: URI::Template makes it easy to construct URIs, filling in variables and constructing queries, etc. 16:21
jnthn: ^
16:34 ukine1 left 16:41 Doc_Holliwould left 16:42 wildtrees joined, molaf joined 16:43 wildtrees left, MatrixBridge joined, MatrixBridge left, wildtrees joined, Kaiepi left 16:46 Kaiepi joined
cpan-raku New module released to CPAN! Math::Libgsl::Matrix (0.0.6) by 03FRITH 16:47
16:48 NODE left 16:50 NODE joined 16:54 aindilis joined 17:00 NODE left 17:02 NODE joined 17:03 NODE left
Geth doc: Kaiepi++ created pull request #3217:
Reorganize and add Trait::Traced to the debugging programs page
17:04 NODE joined 17:09 wamba left 17:14 squashable6 left 17:15 squashable6 joined 17:17 |Sno| left 17:18 aborazmeh left 17:19 Kaiepi left 17:20 Kaiepi joined 17:23 pecastro left 17:24 farcas82regreg joined 17:27 domidumont left 17:29 dakkar left
SmokeMachine m: say "aa" ~~ / (<[abc]>) (.) <?{ $0 ne $1 }> / 17:30
17:30 scimon left, Redfoxmoon left, Redfoxmoon joined 17:33 sena_kun left 17:39 NODE left, Kaiepi left 17:40 NODE joined 17:42 NODE left 17:43 NODE joined 17:47 sena_kun joined 17:51 Kaiepi joined 17:53 wamba joined 18:02 hungrydonkey left 18:03 chloekek joined, chloekek left, chloekek joined 18:09 wamba left, wamba1 joined 18:10 nosqrt joined
Geth doc: 6d64be7ed6 | (Elizabeth Mattijsen)++ | doc/Language/faq.pod6
Mention Perl 6, fixes #3216
linkable6 Link: docs.raku.org/language/faq
linkable6 DOC#3216 [closed]: github.com/Raku/doc/issues/3216 [RFE][docs][easy to resolve] Mentions of Perl 6 in the docs were edited out a little TOO thoroughly
18:22 lnkcmplxct joined, lnkcmplxct left
SmokeMachine I am testing my new asetniop keyboard... 18:24
I am spending too long to write anything... but it is cool 18:26
moritz imagines an actively cooled keyboard :D 18:32
lizmat moritz: do you know how and where camelia is supoosed to run ? 18:33
it's been awol for two days now :-(
moritz lizmat: it's supposed to be running on niner.name... and the weird thing is that it says it's running just fine 18:35
lizmat nine ^^ ?? :-)
moritz perlpunks.de/paste/show/5e4445c2.1f8b.f8 18:36
no idea why it doesn't actually connect 18:37
18:37 zakharyas left 18:42 pecastro joined 18:43 wamba1 left
rypervenche How would a regex be affecting $/ in this context? I don't think I quite understand it. docs.perl6.org/language/traps#Grammars 18:44
moritz rypervenche: a normal regex match like 'a' ~~ /a/ sets $/ to the resulting Match object 18:45
rypervenche Oooooh
moritz this is true everywhere, not just in action methods
rypervenche I completely overlooked that. That makes total sense now.
18:49 [Sno] joined
nine moritz: there's a weird issue with the VMs losing network. To be precise inbound packets get lost somehow. Rebooting the VM doesn't help, it's not any hardware offload, iptables or ebtables issue. A reboot of the host seems to be the only workaround. 18:51
Been traveling all day so I didn't dare to reboot. OTOH I still got ~ half an hour till my flight back home leaves... 18:52
18:53 aborazmeh joined, aborazmeh left, aborazmeh joined, nine left 18:58 nine joined
moritz nine: interesting 19:00
19:00 camelia joined
nine m: "reboot went well".say 19:01
camelia reboot went well 19:02
lizmat whee!
19:04 wildtrees left 19:05 wildtrees joined
moritz nine++ indeed 19:07
19:15 aborazmeh left 19:26 sauvin left 19:33 wamba joined 19:34 sena_kun left
Geth doc/master: 5 commits pushed by (Ben Davies)++, (Juan Julián Merelo Guervós)++ 19:34
19:40 aborazmeh joined, aborazmeh left, aborazmeh joined 19:48 squashable6 left 19:49 sena_kun joined 19:50 squashable6 joined 20:01 rafaelschi joined 20:04 [Sno] left 20:06 [Sno] joined 20:12 zakharyas joined, wamba left 20:13 wamba joined 20:24 rafaelschi left 20:31 rindolf left 20:37 mahmudov joined 20:38 stoned75 joined, Coleoid left
Doc_Holliwood weekly: www.perlmonks.org/?node_id=11112794 20:45
notable6 Doc_Holliwood, Noted! (weekly)
20:47 aborazmeh left, skyl4rk left 20:50 molaf left
rypervenche Yay! I finally got my grammar working! It took me a while to figure out the issues with using regexes in an action, as well as the nested $matches. 20:59
I'm curious to know if I did anything horrible or inefficient in my phone-number method: gist.github.com/rypervenche/2a42fb...df93369d08 21:00
21:13 wamba left 21:26 _lgtaube joined 21:29 _lgtaube left 21:30 zakharyas left
MasterDuke rypervenche: i don't see any glaring algorithmic inefficiencies. however, if you're looking to optimize, `$num .= substr(1) if $num.starts-with("9") and $num.chars == 11` might be faster than `$num = $num.flip.chop.flip if $num ~~ / ^ 9 \d ** 10 $ /` 21:31
rypervenche Oh! Thanks a lot. I knew there had to be something better. 21:32
MasterDuke since you already know that all the characters are numbers by the definition of the phone-number token
21:33 sena_kun left
MasterDuke i'm not going to promise anything, you should measure both 21:33
and you could do the same with the following lines. e.g., `$num = "88850$num" if $num.starts-with("1" | "4") and $num.chars == 5` 21:35
rypervenche Ooh, I should be able to use $/ again in that case. 21:37
MasterDuke and if you want just one complicated line (and only if you know 1,4,5 are the only possible values for the leading character), `$num = "8885{ $num.starts-with("5") ?? "5" !! "0" }$num"` 21:40
but that's a questionable "optimization" 21:41
21:41 aluaces left 21:44 aluaces joined
rypervenche That's lovely. I think I'll stick with the longer version since it's more understandable and extendable. 21:44
MasterDuke yep 21:45
rypervenche Still though, it's going to take me a while to start using the ternary operator. It's good to see more examples of how it can be used like this. 21:46
21:49 sena_kun joined 21:59 chloekek left 22:11 mahmudov left
xinming_ What is the right way to do smart match on the $_ without using when? 22:13
Something like the m// for smart match.
lizmat .ACCEPTS ? 22:15
22:16 maggotbrain left
lizmat .ACCEPTS(foo) or foo.ACCEPTS($_) depending on what's where :-) 22:16
xinming_ Got it, thanks. will use .ACCEPTS 22:17
22:18 MasterDuke left, maggotbrain joined
xinming_ m: my @h = <a>, <c d e>; given @h { when (Any, List) { "Value matched".say; }; default { "Not matched".say; }; }; @h.ACCEPTS(\(Str, List)).perl.say; 22:20
camelia Value matched
xinming_ hmm
m: my @h = <a>, <c d e>; given @h { when (Any, List) { "Value matched".say; }; default { "Not matched".say; }; }; :(Str, List).ACCEPTS(Any, List).perl.say;
camelia Value matched
Cannot resolve caller ACCEPTS(Signature:D: Any:U, List:U); none of these signatures match:
(Mu:U: \topic, *%_)
(Mu:U: Mu:U \topic, *%_)
(Any:D: Mu:D \a, *%_)
(Any:D: Mu:U, *%_ --> Bool::False)
(Any:U: \top…
xinming_ How do I match do the same with ACCEPTS for the when (Any, List) in this example please? 22:21
22:21 skyl4rk joined 22:22 Doc_Holliwood left
xinming_ I tried the @h.ACCEPTS(\(Any, List)); @h.ACCEPTS((Any, List),); none worked 22:25
22:26 mahmudov joined
xinming_ @h ~~ (Any, List) <--- In this example, How can we write it with the .ACCEPTS version? 22:27
lizmat hmmmm 22:36
xinming_ I got it.
m: (Any, List,).ACCEPTS(("5", <a b c>),).perl.say; 22:37
camelia Bool::True
lizmat xinming_++
stoned75 lizmat: hi. sorry for the log2 incorrect example and thanks for your fix 22:41
lizmat stoned75: yw
22:53 wamba joined 22:54 melezhik left
Voldenet Is there some nice way to turn binary stdin into Supply of Buf[uint8]? 22:59
what I'm doing now is: sub raw-stdin { my Supplier $s .= new; start { loop { my $buf = $*IN.read; last unless $buf; $s.emit($buf) }; $s.done }; $s };
22:59 wamba left
Voldenet but do I really that thread? 23:00
jnthn $*IN.Supply(:bin) ?
23:00 wamba joined
Voldenet m: sub raw-stdin { my Supplier $s .= new; start { loop { my $buf = $*IN.read; last unless $buf; $s.emit($buf) }; $s.done }; $s }; react whenever raw-stdin() { .say } 23:02
camelia ( no output )
Voldenet hm
23:02 MasterDuke joined, farcas82regreg left
Voldenet apparently no, Supply only accepts buffer size 23:03
23:03 foo222 joined
Voldenet $*IN = "/dev/stdin".IO.open(:bin); react whenever $*IN.Supply 23:05
23:08 hungrydonkey joined
Voldenet ah, `"-".IO.open(:bin);` doesn't actually open a file, so it's a better solution 23:19
m: "-".IO.open(:bin).close; react whenever $*IN.Supply { .say
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing block
at <tmp>:1
------> 3close; react whenever $*IN.Supply { .say7⏏5<EOL>
expecting any of:
statement end
statement modifier
statement modifier loo…
Voldenet m: "-".IO.open(:bin).close; react whenever $*IN.Supply { .say }
camelia A react block:
in block <unit> at <tmp> line 1

Died because of the exception:
read bytes requires an object with REPR MVMOSHandle (got VMNull with REPR Null)
in block <unit> at <tmp> line 1
Voldenet …which means you can close $*IN without even touching it 23:20
23:20 farcas82regreg joined 23:33 sena_kun left 23:38 mahmudov left 23:46 sena_kun joined 23:47 lucasb left 23:50 AlexDaniel joined 23:51 AlexDaniel left, AlexDaniel joined 23:54 foo222 left 23:58 wamba left 23:59 pecastro left, mahmudov joined