🦋 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.
guifa2 Is there any way to catch the output to $*ERR? 00:44
Xliff guifa2: From an external process? Proc::Async 00:53
guifa2 meh no time to practice using that. I want to get this module posted. Test files will have to come later ha
Xliff guifa2: my $p = run |@cmd-with-args, :out, :err; $p.err.slurp.say; 01:05
guifa2 okay maybe that's not that bad ha
Xliff m: my $p = run "ls", "-l", ".", "qqrq", :out, :err; $p.err.slurp.say
camelia ls: cannot access 'qqrq': No such file or directory
Xliff That's just using run() which returns a regular proc object. 01:09
ctilmes kybr, lizmat: You can feed a Supply from a gzipped file with Libarchive::Filter -- gunzip($*iohandle, $supplier) I think will do it. Let me know if there is a friendlier way to do the interface 04:59
lizmat: Or just gunzip('file.gz', $supplier) 05:00
cpan-raku New module released to CPAN! Net::BGP (0.1.9) by 03JMASLAK 06:18
xinming_ in docs/announce/2020.01.md There is a markdown usage of Raku[^1] What does [^1] mean in this example pleae? 06:20
Will [^1] rendered into home page?
tobs xinming_: in some markdown extensions (like pandoc's) this syntax creates a footnote. 07:31
cpan-raku New module released to CPAN! Trait::Traced (0.0.1) by 03KAIEPI 12:59
xinming_ tobs: Ok, Thanks. 13:37
alipoor90 Is Perl 6 language finalized? as a beginner, should i start with Perl 6 or Perl 5? which one is less-complex/easier-to-learn? 15:46
xinming_ m: multi x (Num $a) { $a.say; }; x(3)
camelia 5===SORRY!5=== Error while compiling <tmp>
Calling x(Int) will never work with any of these multi signatures:
(Num $a)
at <tmp>:1
------> 3multi x (Num $a) { $a.say; }; 7⏏5x(3)
xinming_ alipoor90: choose perl6, spec is already finialized, Implementation covers major part of the the spec. and you'll see the most advanced programming language on this earth ATM. :-) 15:47
m: multi x (Num $a) { $a.say; }; x(3) # <--- Why won't Int be converted to Num? 15:48
camelia 5===SORRY!5=== Error while compiling <tmp>
Calling x(Int) will never work with any of these multi signatures:
(Num $a)
at <tmp>:1
------> 3multi x (Num $a) { $a.say; }; 7⏏5x(3) # <--- Why won't Int be conve
tobs m: multi x (Num() $a) { $a.say; }; x(3) # xinming_: if you want to have it converted, use the coercing form Num() or Num(Int) if you only want to coerce Ints to Num 15:49
camelia 3
xinming_ tobs: I know, I'm just curious why Num won't do the auto convertion, I use it in sub MAIN (Num $a) { } 15:52
tobs if only looks as if Raku automatically coerces types as needed because the internals (of Rakudo) do the coercions explicitly (like if you add two things using infix:<+>, it coerces to Numeric). There is no implicit coercion due to signatures. 15:53
xinming_ sub MAIN (Int $a) { } do the auto convertion.
tobs `perl6 -e 'sub MAIN (Num $x) { $x.say }' -- 3` <- does not fire for me. Replacing Num by Int does. So MAIN seems to follow the same rules. 15:56
and "why?" -- because that's the rule. If you want it to try converting automatically, you have Num() in the signature. 15:57
or you can use a type constraint that includes Int and Num and everything else you can sensibly work with. For example Numeric generalizes Int and Num: 16:15
m: multi x (Numeric $a) { $a.say }; x(3); x(<4>); x(π)
camelia 3
4
3.141592653589793
xinming_ tobs: Thanks for the Numeric type, I thought Num is the same as Numeric, Num is just shortcut. :-) 16:23
SaviourOfTheCock That was supposed to read Cockatiel, goddamit 16:59
DockHolliwood I just found a cockatiel in the middle of the road. I was able to catch it and return it to the owner. Feels nice. 17:03
Poor baby sat ride on the center line, cars whizzing by left and right. I only saw it cause i was riding my electrical trike. 17:04
*right
melezhik Hi! I just launched an experimental instance of RakuDist API allowing Raku modules authors to test their distribution against different OS online - github.com/melezhik/RakuDist#run-tests-via-api 17:42
an example of request - `curl repo.westus.cloudapp.azure.com/raku...ate::Names -d os=debian`
curl repo.westus.cloudapp.azure.com/raku...ate::Names -d os=debian 17:43
AlexDaniel melezhik: I think you're missing .lines on .stderr and .stdout 17:47
melezhik: see broken output here: repo.westus.cloudapp.azure.com/raku...110395.txt
melezhik AlexDaniel: yeah, I am aware of, thank you 17:49
it should be 'repo.westus.cloudapp.azure.com/raku...i/run/sake -d os=debian' btw
AlexDaniel yeah 17:51
melezhik AlexDaniel: just an idea - have a chatboot that invoke RakuDist calls for a certain module, something like "rkd: sake debian" 19:00
could be handy for module releases
or when debugging module development
guifa2 For custom exceptions, is there a best practice yet for where to put them? I've seen some just included inside of a module as a non-exported class, others with a lib/X/Foo.pm6 structure for exceptions in module Foo, and others with lib/Foo/X.pm6 19:05
tobs guifa2: the topic certainly came up, but I don't remember the conclusion: github.com/Raku/problem-solving/issues/57 19:09
(the ticket is still open anyway) 19:10
guifa2 oh hey, at least I wasn't the only one wondering ha
xinming_ !seen SmokeMachine 19:12
How do we use seen bot?
guifa2 "Yeah,if anything I'd document it as a "Trap" and leave it on the grounds of no consensus." Sounds about like the discussion going on in my head, so that's a relief. 19:13
lizmat .seen xinming_ 19:15
tellable6 lizmat, I saw xinming_ 2020-01-15T19:12:30Z in #raku: <xinming_> How do we use seen bot?
AlexDaniel tellable6: xinming_ 19:18
tellable6 AlexDaniel, I saw xinming_ 2020-01-15T19:12:30Z in #raku: <xinming_> How do we use seen bot?
AlexDaniel seen: xinming
tellable6 AlexDaniel, I saw xinming 2020-01-15T19:12:30Z in #raku: <xinming_> How do we use seen bot?
AlexDaniel tellable6: help
tellable6 AlexDaniel, Like this: .tell AlexDaniel your bot is broken # See wiki for more examples: github.com/perl6/whateverable/wiki/Tellable
AlexDaniel tell: xinming 19:22
tellable6 AlexDaniel, I saw xinming 2020-01-15T19:12:30Z in #raku: <xinming_> How do we use seen bot?
AlexDaniel any command should work, except !seen :) 19:23
xinming_ .seen SmokeMachine 19:28
tellable6 xinming_, I saw SmokeMachine 2020-01-13T16:54:34Z in #raku: <SmokeMachine> wouldn't that make sense to always say the type?
lizmat hmmm... looks like we lost Geth again 19:31
ping tyil
xinming_ Is Geth SmokeMachien?
lizmat no, Geth is a bot, Smokemachine is noty :-) 19:32
guifa2 p6: CX::Warn.new.throw; say "Why didn't we reach here?" 19:42
camelia control exception without handler
in block <unit> at <tmp> line 1
guifa2 if warn() throws a CX::Warn, what's going on differently when throwing it directly? 19:43
lizmat add a CONTROL block and see if it winds up there ? 19:44
guifa2 Interesting, I get a MoarVM panic if I use CONTROL { … } without an explicit .resume 19:51
Hmmm, it seems that it's creating an non-standardish exception with the CONTROL_WARN constant when you use warn (whereas die actually uses a standard Exception class) 19:57
ryan59 I stumbled upon a case where some code wont parse because of whitespace... is this expected?: pastebin.com/W5vJQm77 20:13
If the comma and test description string are moved up a line after the closing curly everything works 20:14
guifa2 A terminal } is considered equivalent to }; 20:18
So that's what causing it. I'd say it's working as expected, because I don't know how much special casing is desired with that behavior 20:19
ryan59 makes sense 20:20
thx
lizmat indeed, a } at the end of a line is the end of that statement 20:29
always
tyil lizmat: sorry, was doing a li'l nap 20:37
lizmat okidok :-)
tyil wonder what's causing Geth to be dropped, the logs show nothing
Xliff o/ 22:04
Can a Supply tell if it has been tapped?
jnthn In general, no. Of course, a Supplier does keep track of an active subscriber list, but that's an internal detail and you can't ask for it. 22:10
Xliff :( 22:11
jnthn But most are stateless
Xliff Yeah. I'd just want to know if a Supplier has had one of its supplies tapped.
jnthn Just wrap it
sub keep-if-tapped($s, $p) { supply { $p.keep; whenever $s { .emit } } } or so 22:12
(I don't know how you want to find out)
For Supplier you can subclass it
Xliff Yeah, that might be for the best.
jnthn Override Supply, callsame(), wrap the result up as shown (but you maybe would set an attribute instead) 22:13
Xliff Actually, I'd also need to create my own TapList... 22:14
m: my $s = Supplier.new; my $sup = $s.Supply; $s.^can('tap').gist.say 22:18
camelia ()
Xliff m: my $s = Supplier.new; my $sup = $s.Supply; $sup.^can('tap').gist.say
camelia (tap)
Xliff m: my $s = Supplier.new; my $sup = $s.Supply; $sup.^can('tap')[0].^name.say
camelia Method
Xliff So I can wrap that.
lizmat Kaiepi: does that ring bell with you? www.reddit.com/r/rakulang/comments...m_sockets/ 22:28
ryan26 is awaiting a promise from a start to check if a Proc::Async has exited unreliable? Sometimes the promise will hang on "Planned" forever... well after the process has terminated... 22:31
Xliff jnthn: Look about right? gist.github.com/Xliff/ba271400c195...4738a9a628 22:32
ryan26 I haven't figured out a way to code up a minimal test case yet... it seems to only happen when I quit my async proc immediately after opening it... 22:34
Kaiepi yeah lizmat, there's a pr open for adding support for it to IO::Socket::INET but it's blocked until this next release gets made 22:36
lizmat ok
Kaiepi commented 22:42
lizmat Kaiepi++ 22:43
cpan-raku New module released to CPAN! Sys::Domainname (0.0.1) by 03JMASLAK 22:59
DockHolliwood what tool do you guys use for module authoring? esp. packing and uploading? 23:09
Xliff Halp? gist.github.com/Xliff/ba271400c195...4738a9a628 23:17