🦋 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.
00:03 perryprog_ left 00:10 perryprog joined 00:11 perryprog left 00:12 epony left 00:16 BenGoldberg left 00:17 perryprog joined 00:25 BenGoldberg joined 00:26 perryprog left 00:27 perryprog joined 00:37 jmcgnh left 00:44 jmcgnh joined 01:04 approaching236 left 01:14 aborazmeh left 01:16 a3f left 01:17 aborazmeh joined 01:18 aborazmeh left, aborazmeh joined, epony joined 01:19 a3f joined 01:22 BenGoldberg left, Ben_Goldberg joined, Ben_Goldberg is now known as BenGoldberg 01:35 leont left 01:36 yuplushi_ left 01:37 perryprog left, aluaces left, perryprog joined 01:38 mowcat left 01:42 BenGoldberg left, Ben_Goldberg joined, Ben_Goldberg is now known as BenGoldberg 01:45 holli__ left 01:57 molaf left 01:59 Ben_Goldberg joined, BenGoldberg left, Ben_Goldberg is now known as BenGoldberg 02:10 molaf joined 02:22 Kaeipi left, Merfont joined 02:48 yuplushi joined 03:07 k-man left 03:09 Kaeipi joined 03:11 Merfont left 03:16 k-man joined 03:19 Ben_Goldberg joined, BenGoldberg left, Ben_Goldberg is now known as BenGoldberg 03:38 orinthe left 03:39 orinthe joined 04:17 Kaeipi left 04:20 Kaiepi joined, afresh1 joined 04:23 MasterDuke left 04:26 Kaeipi joined 04:27 Kaiepi left 04:28 BenGoldberg left, Ben_Goldberg joined, Ben_Goldberg is now known as BenGoldberg 04:30 BenGoldberg left, Ben_Goldberg joined, Ben_Goldberg is now known as BenGoldberg 04:33 afresh1 left 04:36 afresh1 joined 04:40 skids left 04:49 xinming left 04:51 xinming joined 04:57 BenGoldberg left, Ben_Goldberg joined 04:58 Ben_Goldberg is now known as BenGoldberg 05:02 aluaces joined 05:03 aluaces is now known as alberto, alberto is now known as Guest26585 05:04 holli__ joined 05:08 jmerelo joined, newbie76 joined 05:16 molaf left 05:25 frot-lab joined 05:26 bocaneri joined 05:28 molaf joined 05:35 bocaneri left, bocaneri joined 05:36 bocaneri left 05:37 bocaneri joined, newbie76 left 05:38 bocaneri left
AlexDaniel` greppable: :P5 05:38
greppable6 AlexDaniel`, 21 lines, 9 modules: gist.github.com/5d59400d110d66b008...63f673c7ae
05:38 bocaneri joined, bocaneri left 05:39 molaf left 05:42 xinming left 05:44 xinming joined 05:53 xinming left, xinming joined 05:57 xinming_ joined 06:01 xinming left 06:02 dmc00 left 06:14 tejr left, xelxebar left, tejr joined, xelxebar joined 06:15 maettu joined 06:16 BenGoldberg left, Ben_Goldberg joined 06:17 Ben_Goldberg is now known as BenGoldberg 06:25 holli__ left 06:43 dakkar joined 06:53 Altai-man joined 07:07 Guest26585 is now known as aluaces 07:12 tony-o left, tony-o joined, maettu left 07:17 domidumont joined 07:20 kensanata joined 07:35 bocaneri joined, MasterDuke joined 07:39 alainbebe joined 07:42 BenGoldberg left 07:43 bocaneri left 07:44 bocaneri joined 08:00 alainbebe left 08:02 frot-lab is now known as hungrydonkey
gfldex How do I access WHY of a class attribute? 08:11
08:11 Sgeo left 08:14 rindolf joined 08:21 pecastro joined 08:28 hungrydonkey left 08:30 frot-lab joined
CIAvash Not sure, using `^attributes` on the class? 08:35
08:39 maettu joined 08:40 holli__ joined 09:00 domidumont left 09:07 wamba joined
kawaii Good morning :) I'm having some issues in capturing errors/exceptions from a Proc (or maybe an IO::Pipe?!) object. I have `my $cmd = run @cmd, :in, :out, :err;` but my process is dying at the point of `$cmd.in.close;`, I've tried wrapping it in a `try` block and doing `if $! { say $cmd.exitcode }` and `$cmd.err.slurp.say` but _nothing_ I do seems to let me assign the value of the exception or even see the exit code. 09:21
full routine code at the moment for those interested www.irccloud.com/pastebin/tYxJPGun/
09:22 holli__ left
moritz kawaii: my experience with this is that it's easier to get it working reliably with Proc::Async 09:22
one problem is that UNIX pipes only buffer so much output before they block. That means you must drain the stdout and stderr pipes before they run full, without blocking them if there's nothing to read 09:25
not an easy task when using blocking IO
(this might not be your actual problem, but still a problem that needs solving)
perlpunks.de/paste/show/5f7d89ba.323f.a6 this is part of the code I use to run external programs; no piping to stdin in this example though 09:26
09:27 maettu left
kawaii moritz: thanks, I'll take a look at Proc::Async instead and see if it's simple enough to make it worth refactoring this block :) 09:27
moritz you can print to its stdin ith `$proc.print(Str)`, and at the end $proc.close-stdin; 09:28
good luck :-) 09:29
09:33 pecastro left
kawaii moritz: well, time to see if it works :D www.irccloud.com/pastebin/KOczCSdO/ 09:37
09:41 sena_kun joined, Kaeipi left 09:43 Altai-man left
kawaii www.irccloud.com/pastebin/BU1txtpN...%21%20%3A) 09:46
moritz: nice, got it working the same as before like so; now time to see if I can capture errors, thanks for your help! :)
09:50 aborazmeh left
kawaii so I'm pretty new to using supplies/taps, and now my stdout and stderr are both supplies, are supplies False if nothing is sent down them? What's the best way to "do X if stderr else do Y if !stderr"? 09:51
10:06 holli__ joined
MasterDuke kawaii: i think the docs have a good example with react/whenever 10:07
kawaii MasterDuke: yep, reading those now :D
hmm `whenever $cmd.stdout(:bin) { $document = $_; }` I tried this but I assume the actual result of my command isn't contained within `$_` 10:32
10:32 BenGoldberg joined
timotimo the whenever block could be run multiple times 10:34
so it would overwrite the previous value each time
kawaii timotimo: I am not really sure if what I'm writing even makes sense www.irccloud.com/pastebin/NKkIfapE/ 10:36
timotimo you can output a little message whenever the stdout block runs 10:40
to see if it's run multiple times
or initialize $document to be a buf8.new() and do $document ~= $_ inside the block which will work whether or not the block runs multiple times 10:41
10:41 Kaiepi joined 10:48 __jrjsmrtn__ left 10:49 holli__ left 10:50 __jrjsmrtn__ joined
kawaii www.irccloud.com/pastebin/DYyA3QGS/ 10:52
timotimo: further down the rabbit hole :D www.irccloud.com/pastebin/TJJDOy0Q/ 10:53
note that my `say 'awoo';` was nowhere to be seen 🤔
timotimo well, yeah, i don't think the program outputted anything on stdout 10:54
given how it spits out an error on stderr
Geth ¦ problem-solving: AlexDaniel self-unassigned META6 specification only exists "de facto" github.com/Raku/problem-solving/issues/236 10:56
kawaii timotimo: so I feel like something is up with my `print` and `close-stdin` then, if the program is upset about what it's being fed
wow async is awful to work with :D 10:57
timotimo have you tried outputting exactly what $content is that you're feeding into it?
i gotta go now tho
kawaii yeah it's just raw markdown 10:58
11:02 xelxebar left
kawaii ah, start must be called before close-stdin 11:02
probably my issue
11:02 xelxebar joined 11:06 BenGoldberg left 11:14 aborazmeh joined, aborazmeh left, aborazmeh joined 11:17 jmerelo left 11:19 cpan-raku left 11:21 cpan-raku joined, cpan-raku left, cpan-raku joined 11:41 MasterDuke left 11:42 leont joined 11:48 frot-lab left 11:53 MasterDuke joined 12:01 maettu joined 12:12 domidumont joined 12:14 jmerelo joined, pecastro joined 12:16 MasterDuke left 12:17 andinus joined 12:29 aborazmeh left 12:31 aborazmeh joined, aborazmeh left, aborazmeh joined 12:34 JJAtria[m]1 left, matiaslina left, kiti_nomad[m] left, suzusime[m] left, unclechu left, AlexDaniel` left, ThaEwat left, CIAvash left 12:39 AlexDaniel` joined 12:45 unclechu joined, ThaEwat joined 12:46 kiti_nomad[m] joined, CIAvash joined, matiaslina joined, JJAtria[m] joined, suzusime[m] joined, aborazmeh left 12:49 aborazmeh joined, aborazmeh left, aborazmeh joined 12:50 jmerelo left 12:54 maettu left 13:03 Kaeipi joined, suzusime[m] left, CIAvash left, Kaiepi left, finsternis left, m_athias left, hoelzro left, bisectable6 left, tellable6 left, sourceable6 left, statisfiable6 left 13:04 committable6 left, quotable6 left, evalable6 left, nativecallable6 left, linkable6 left, notable6 left, benchable6 left, Altreus left, timlegge left, m_athias joined 13:05 CIAvash joined 13:09 suzusime[m] joined, finsternis joined, hoelzro joined, bisectable6 joined, tellable6 joined, sourceable6 joined, statisfiable6 joined, committable6 joined, quotable6 joined, evalable6 joined, nativecallable6 joined, linkable6 joined, notable6 joined, benchable6 joined, Altreus joined, timlegge joined, suzusime[m] left, suzusime[m] joined 13:15 holli__ joined 13:17 jmerelo joined 13:23 MasterDuke joined
kawaii is there a regex flag to return a copy when applying to an immutable string? 13:23
timotimo you use S instead of s
kawaii big S returns me a string of 'False' timotimo 13:24
`CATCH { template 'templates/error.crotmp', $_.message ~~ s:g/"\n"/"<br>"/ }`
timotimo m: say S/lmao/roflmao/ given "hellmao" 13:25
camelia helroflmao
timotimo you need to use it a bit differently from s///
kawaii ahh
13:26 domidumont left
kawaii timotimo: thanks, works :D 13:26
13:28 gordonfish left 13:32 nige left 13:36 nige joined 13:40 Altai-man joined, domidumont joined 13:42 |Sno| left, sena_kun left 13:44 sno joined 13:49 wamba left, skids joined 13:56 holli__ left 13:57 BenGoldberg joined, pecastro left 13:58 maettu joined 14:27 Sgeo joined, silug left 14:31 BenGoldberg left 14:34 MasterDuke left
Geth Raku-Steering-Council/main: 97030f054d | (Elizabeth Mattijsen)++ | announcements/20200907.md
Add announcement of Vadim Belman joining
14:46 MasterDuke joined
rypervenche Is there a point in setting the type of a constant variable? 15:00
moritz rypervenche: what do you mean by "constant variable"? 15:05
rypervenche A variable set with the "constant" prefix. 15:06
moritz we call that a constant, not a variable :-)
rypervenche Touché :X
moritz well, you can always use the type annotation to communicate with the reader of the program 15:07
lizmat m: constant Int A = "foo"
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing initializer on constant declaration
at <tmp>:1
------> 3constant Int7⏏5 A = "foo"
lizmat m: constant Int $a = "foo"
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing initializer on constant declaration
at <tmp>:1
------> 3constant Int7⏏5 $a = "foo"
moritz oh
you cannot even
lizmat apparently :-)
rypervenche In the scripts that I've looked at, I usually see people not setting a constant's type. I was just curious if that was a personal choice or if there was maybe a reason one doesn't need to.
lizmat rypervenche: if a type were allowed, it would cause a compile-time check 15:08
m: my Int $a := BEGIN "foo"
camelia Type check failed in binding; expected Int but got Str ("foo")
in block <unit> at <tmp> line 1
lizmat hmmm... that's runtime :-)
[Coke] "as soon as possible (maybe sooner later)" 15:09
rypervenche Ⓜ my Int constant $a := 1; say $;
gah, emoji plugin...
m: my Int constant $a := 1; say $; 15:10
camelia (Any)
rypervenche m: my Int constant $a := 1; say $a;
camelia 1
lizmat m: my Int constant $a = "foo"
camelia 5===SORRY!5=== Error while compiling <tmp>
Type check failed in constant declaration of $a; expected Int but got Str ("foo")
at <tmp>:1
------> 3my Int constant $a = "foo"7⏏5<EOL>
rypervenche Ok, so perhaps if I were doing some operation that *could* result in a type that I'm not expecting when setting my constant, I might want to use that. Otherwise, if I'm simply setting a constant to a value, I wouldn't need/want the type check then, yes? 15:12
15:13 maettu left
moritz correct 15:17
m: constant A = 42; sub f(Str $x) { }; if False { f(A) } # checking if the compiler is smart enough to catch that 15:18
camelia 5===SORRY!5=== Error while compiling <tmp>
Calling f(Int) will never work with declared signature (Str $x)
at <tmp>:1
------> 3t A = 42; sub f(Str $x) { }; if False { 7⏏5f(A) } # checking if the compiler is sma
rypervenche Thanks. I'm always looking to have good standards for myself and not do anything unnecessary or redundant. 15:22
15:45 jmerelo left 15:52 [Coke] left 15:57 holli__ joined 15:58 [Coke] joined 15:59 mowcat joined 16:01 gordonfish joined 16:17 molaf joined 16:19 kensanata left 16:23 aborazmeh left 16:28 maggotbrain left 16:29 maggotbrain joined 16:33 mowcat left 16:34 dakkar left 16:50 bdju left, bdju joined 16:51 domidumont left 16:55 bdju left 16:56 bdju joined 16:57 pecastro joined 17:03 approaching236 joined 17:12 wamba joined 17:22 BenGoldberg joined 17:35 Doc_Holliwould joined
cpan-raku New module released to CPAN! Math::Libgsl::Histogram (0.0.1) by 03FRITH 17:36
17:38 holli__ left, jmerelo joined 17:41 sena_kun joined 17:43 Altai-man left 17:57 BenGoldberg left 18:08 orinthe left 18:09 orinthe joined 18:15 aluaces left 18:23 Black_Ribbon joined 18:24 mowcat joined 18:27 wamba left 18:29 orinthe left 18:30 orinthe joined 18:37 orinthe left 18:43 orinthe joined 18:55 jmerelo left
gfldex kawaii: Did you consider to use Shell::Piping? I'm asking because your problems sound strangly familiar and I believe to have covered them all in that module. 18:55
19:03 wamba joined 19:12 vrurg left 19:17 MasterDuke left 19:24 vrurg joined 19:29 Zero_Dogg left 19:36 aluaces joined 19:43 Zero_Dogg joined 19:59 rindolf left 20:05 vrurg left 20:07 vrurg joined 20:18 sena_kun left 20:19 vrurg left, vrurg joined 20:30 Sgeo_ joined 20:31 orinthe8 joined, oodani left, colomon__ joined, colomon_ left, cooper left, oodani joined 20:32 andinus` joined, cooper joined, andinus left 20:33 orinthe left, Sgeo left, orinthe8 is now known as orinthe 20:45 wamba left 20:48 BenGoldberg joined 20:50 patrickb joined
rypervenche m: enum RPS < rock paper scissors >; say 'rock' ~~ RPS; # Should this work, or is my syntax wrong? 20:51
camelia False
moritz m: enum RPS < rock paper scissors >; say rock ~~ RPS 20:53
camelia True
moritz rypervenche: ^^ that's how it works
and if you want to look up an enum element by name, you can do it like this: 20:54
m: enum RPS < rock paper scissors >; say RPS::<rock>.^name
camelia RPS
20:56 nige left
rypervenche moritz: Hmmm, how might I test a string given to me to see if it matches an enum then? (My first time using enums :P ) 20:57
For example, if I do something like: my $var = get;
moon-child m: enum RPS<rock paper scissors>; my $good = "rock"; my $bad = "granite"; say RPS::{$good}; say RPS::{$bad}; 20:59
camelia rock
rypervenche Ahhhh, thanks. 21:00
moon-child x<y> is generally shorthand for x{"y"}
21:04 MasterDuke joined 21:12 pecastro left, skids left, mtj_ left 21:13 pecastro joined 21:22 BenGoldberg left 22:06 bocaneri left 22:09 maggotbrain left, bocaneri joined 22:10 maggotbrain joined 22:27 patrickb left 22:30 patrickb joined 22:51 patrickb left 22:57 leont left 23:04 codesections joined
codesections o/ 23:05
tellable6 2020-10-05T20:08:06Z #raku <tbrowder> codesections is it ok to use yr raku.sublime-text syntax code? if so, what should attribution be? would it be ok to use in PR to Zola?
23:12 leont joined 23:14 skids joined
codesections .tell tbrowder Oh, I should probably have noted in the file: that code is forked from github.com/silentTee/sublimetext3-perl6-syntax 23:14
tellable6 codesections, I'll pass your message to tbrowder
codesections .tell tbrowder that code is under an MIT license, so using it should be fine (and using the minor alterations I made is also fine) 23:15
tellable6 codesections, I'll pass your message to tbrowder
tbrowder codesections: got it, thnx! 23:16
23:26 pecastro left 23:38 sftp left 23:44 BenGoldberg joined 23:48 BenGoldberg left, Ben_Goldberg joined, Ben_Goldberg is now known as BenGoldberg