🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). This channel is logged for the purpose of keeping a history about its development | evalbot usage: 'm: say 3;' or /msg camelia m: ... | Log inspection is getting closer to beta. If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 25 August 2021.
Geth flycheck-raku: 4da1970a75 | (Siavash Askari Nasr)++ | 2 files
Update CHANGES.md, add 2022 to copyright
07:33
suman How to read this piece of raku documentation? method race(Int(Cool) :$batch = 64, Int(Cool) :$degree = 4 --> Iterable) 08:00
tellable6 2022-02-27T08:31:00Z #raku <nine> suman: docs.raku.org/syntax/Coercion%20type
2022-02-27T08:31:00Z #raku <CIAvash> suman: type of $xx values of type `Cool` and `Num` are accepted and values of type `Cool` are coerced to target type `Num` docs.raku.org/syntax/Coercion%20type
suman What does Int(Cool) mean? Is it Int inherting from Cool?
MasterDuke it's actually very similar to that message. anything of type Cool is coerced to type Int 08:02
Nemokosch It reads just like a function call 08:26
[Coke]_ It's like the first thing the routine does is call .Int on that parameter and use *that* instead of the passed in value. 13:28
[Coke] do we have instructions on how to release new versions of, say, IO::Path::ChildSecure? (community module) 13:30
lizmat is it still on the old ecosystem? 13:31
[Coke] I don't know
lizmat but it needs a new release ?
[Coke] There's a pending PR 13:32
(which I submitted)
want to get it merged and then an update released with it. (And we should consider also github.com/raku-community-modules/...e/issues/5 at the same time, probably a small effort) 13:33
lizmat ok, will look at it in a mo
[Coke] I can do #5 too if we can get another release.
lizmat: thanks; please feel free to just tell me the steps as opposed to doing them, that's fine. 13:34
(or just do them, also fine. :)
lizmat well, I'd start with merging the PR :-) 13:35
ok, looks like it needs to be moved to the zef ecosystem as well... and that's a little more involved 13:36
Coke: do you already have a zef login ? 13:37
[Coke] rather :-)
[Coke] Probably not 14:25
Geth ecosystem: 103576ca1a | (Elizabeth Mattijsen)++ | META.list
Freeze IO::Path::ChildSecure

while it is being moved to the zef ecosystem
14:43
Tirifto Is there any direct way a Raku program can write to its own STDIN? I found that it is read-only, and one can get pipes to external programs run with ‘run’, but can a program to this to itself? 17:29
[Coke] could you do it from C? you could probably cheat and get $*IN.native-descriptor and do something with that. 17:53
[Coke] m: dd $*IN.native-descriptor 17:53
camelia 0
[Coke] ah, right, that's just the ID. so slightly modified answer: probably with NativeCall 17:54
Voldenet You can't write to your own stdin
[Coke] m: $*IN.say: 3; #wtf? 17:55
camelia Failed to write 2 bytes to filehandle: Bad file descriptor
in block <unit> at <tmp> line 1
[Coke] (weirdly, that works locally)
Tirifto (Huh, same here, at least in a clean script…) 17:57
Voldenet "it works" meaning… what exactly?
You still can't read contents you wrote using $*IN.slurp.say 17:58
Tirifto Well, the placed line is printed, so it does *something*. :P 17:58
I guess I won’t be pursuing this if there’s no straightforward way though. I don’t really have that big of a need for it. 18:00
nine Why would you need it in the first place? 18:08
nine m: $*IN does role :: { method READ(Int:D $bytes) { "foo\nbar".encode } }; say get; 18:12
camelia foo
Tirifto nine, just a silly thing. I made a small text adventure for a game jam and have thought of adding a game saving/loading functionality. The most straightforward way seems to be saving by exporting the history of the player’s commands, and loading by interpreting them after starting a new game. And of course commands are read from STDIN, so it seemed like the most straightforward way to do that would be feeding them to STDIN. :P 18:19
(It should still be easy to do it without touching STDIN directly.) 18:21
nine Tirifto: well it is! There is a reason why $*IN is a dynamic variable: so you can replace it with a different handle or handle-like object. So: { my $*IN = ReplayHandle.new(:$commands); execute-commands-from-stdin() } 18:22
Tirifto … that’s a really good point! :D 18:25
japhb Also ... being able to change your input source is quite useful for testing, if you don't want to go through the pain of writing tests via pty. 18:58
ugexe whats another word for whitespace (\s) that could be used in place of it? 19:01
tellable6 2021-12-30T18:10:00Z #raku <atroxaper> .tell ugexe, please, tell me, is there a legal way to know which module what to 'use' from a custom CompUnit::Repository's need or so? An argument only tell us about what to load, but who needs it?
japhb ugexe: What are you trying to do? 19:06
ugexe basically s/whitespace/foospace/ on some non raku related stuff 19:08
also its not for me even. but i thought it was interesting i couldnt think of anything so i asked here 19:09
MasterDuke blankspace 19:13
ugexe yeah that could work 19:16
[Coke] what's the context of the space? Only other word I can think of is "gutter" for typesetting. 19:29
Xliff Has anyone been able to use Raku to script for Hexchat? 22:02
phogg Looks like it has a d-bus interface, maybe that could be used. Else I suppose you must write a plugin first. 22:06
Xliff D-Bus? Huh. Thanks, phogg 22:07
Xliff How easy would it be for Raku to tie into a Perl5 XS module? 22:16
lizmat not.... but with Inline::Perl5 you can use just about any Perl module as long as it's not a source filter 22:27
melezhik . 22:33
I have this error - 992686 Segmentation fault (core dumped) , from Rakudo , how can I debug it ? 22:34
gist.github.com/melezhik/f5e86c2ef...707d9bcc0c 22:35
tbrowder anyone here going to raku conf in houston? if so, interested in some core hacking?
melezhik Not sure , what causes it. Maybe I also need to run dmesg on the server 22:36