🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). Log available at irclogs.raku.org/raku/live.html . If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 6 September 2022.
rf m: my $proc = Proc.new(:command('curl5', '-v'), :out, :err); dd $proc; 00:45
camelia Proc $proc = (my \Proc_6154464698824 = Proc.new(in => IO::Pipe, out => IO::Pipe.new(proc => Proc_6154464698824, path => IO::Path, chomp => Bool::True, nl-in => "\n", nl-out => "\n", encoding => "utf8"), err => IO::Pipe.new(proc => Proc_6154464698824, …
rf m: my $proc = Proc.new(:command('curl5', '-v'), :out, :err); dd $proc.err; 00:46
camelia (my \IO::Pipe_4695249479552 = IO::Pipe.new(proc => (my \Proc_4695249560008 = Proc.new(in => IO::Pipe, out => IO::Pipe.new(proc => Proc_4695249560008, path => IO::Path, chomp => Bool::True, nl-in => "\n", nl-out => "\n", encoding => "utf8"), err => IO:…
rf tonyo Yeah something is broken with the stderr 00:49
tonyo Yeah something is broken with the stderr, and stdout returns the same thing
rf m: my $proc = Proc.new(:command("curl5", "-v"), :out, :err); say $proc.err.IO.slurp 00:55
camelia Cannot resolve caller slurp(IO::Path:U: ); none of these signatures matches:
(IO::Path:D: :$bin!, *%_)
(IO::Path:D: :$enc!, *%_)
(IO::Path:D: *%_)
in block <unit> at <tmp> line 1
rf err is Null for some reason
lizmat clickbaits rakudoweekly.blog/2023/03/20/2023-12-priced-2/ 10:31
El_Che I am not clicking on whatever you're selling, lady! 10:37
:)
lizmat yeah, I get it: you're not buying it :-) 10:38
Anton Antonov Has anyone used "WebService::GitHub" recently? Does that package still "work." If it does, please, point to example usage code. The examples in the README and repository do not work for me. (See here: raku.land/zef:raku-community-modul...ce::GitHub .) 12:32
jast I can't even install it (but possibly I just have no idea what I'm doing), but have you tried the alternative auth parameters from the "Setup" section in the readme? 12:40
Anton Antonov @jast Thanks for trying it out! I did try a few alternatives without success. I am giving up on this package. 12:41
Is there a simple (or complicated but already coded) way of finding all of the keywords and symbols in Raku? (I can scrape the documentation, but that is too much work for me.) 12:45
lizmat t/spec/S02-types/WHICH.t contains a list of classes that are expected to exist in Raku 12:47
although it may be incomplete
Anton Antonov Ok, that is a good start. Also, this index can be used: raku-musings.com/keywords.html . 12:55
Nemokosch gonna see about that Github module 13:18
Anton Antonov @Nemokosch Ok, sounds good. 🙂 13:25
[Coke] (musings index) ooh, nifty 13:47
[Coke] was very happy to click on that, click on a random article, click on a random link to the docs... it worked (whew) 13:49
Anton Antonov @Coke I am mostly interested to use that list of keywords and symbols to make a Raku plug-in for Geany.
Nemokosch Geany, lol 13:59
so, it seems that CSON allowed one to wrap long lines without preserving the line breaks 14:27
to be honest, I don't terribly mind to let this one go if there is no good way to do it in Raku
still let me ask: is there a way to wrap string literals so that the linebreaks don't count into the string? 14:28
lizmat q:to/END/.subst("\n",:g) 14:37
q:to/END/.subst("\n", " ":g) # if you want it replaced by a space
q:to/END/.subst("\n", " ",:g) # if you want it replaced by a space
[Coke] signs up for google bard waitlist 14:44
Nemokosch I was looking for a new favorite Raku snippet 14:54
$data>>.=subst: 'XXX', $name, :g;
quite a solid candidate xD
"change the arbitrary template marker to the given string in all leaf nodes" 14:55
while deepmap is kind of awkward for arrays, it makes perfect sense for JSON-like structures where it's common that only leaf nodes hold custom data 14:57
rf Morning folks 15:17
Nemokosch how does the is copy trait copy exactly? 17:27
I should have suspected that it doesn't try to copy hard enough since it doesn't even exist for @-sigilled variables 17:29
anyway, apparently it's pretty simple to get deep clone (or at least deep enough for my purposes) 17:47
my $data = $input>>.clone;
tbrowder__ hi. i know how to get a modules version from the local one in its repo. BUT how do i get it from the installed version? the docs are a bit confusing to me. the docs say this "say $?DISTRIBUTION.meta<ver>;" but it doesn't work for me 21:26
and i hate to hard wire it 21:29
ugexe you cant access $?DISTRIBUTION from outside the distribution its from, so that wont work 21:30
for instance you could query the various CompUnit::Repositories for some distribution and see what versions it finds
but i'm not sure you can like `use Foo; say Foo.^ver;` unless ^ver was explicitly set in Foo 21:31
however if you are asking if `$?DISTRIBUTION.meta<ver>;` works for a given distribution when installed, yes it works 21:32
i.e. an installed distribution can use its own $?DISTRIBUTION in that way
tbrowder__: also you probably want `$?DISTRIBUTION.meta<version>;` 21:33
tbrowder__ well, how do i get access to it internally? i've tried it from an installed bin file...but maybe it needs to be in the lib part...gonna check... 21:34
ugexe cant be in a bin file
cant be in a bin file 21:35
it has to be in a module
you can then use that module from the bin file
tbrowder__ i do have a get-version sub in the lib, and call it from the bin file
ugexe can you show me the code?
tbrowder__ www.irccloud.com/pastebin/zKSNXJ3h/ 21:36
ugexe i don't see why you need anything other than $?DISTRIBUTION.meta<version> // ''; 21:37
`sub get-version is export { $?DISTRIBUTION.meta<version> }`
if the `version` key exists in the META6.json file, then the above should be sufficient for installed and non-installed 21:38
tbrowder__ because i want to see the version when i'm in my repo 21:39
ugexe i dont see why that would be any different
i'd have to see your repo i guess
$?DISTRIBUTION is going to use your local repo if you are running `raku -I. bin/my-code.raku` 21:40
and its going to be the installed repo if you run `raku bin/my-code.raku`
tbrowder__ ok, that should be okay. i'll try that... 21:41
that works fine, thanks! 21:44
lucs ugexe: I appear to have a problem with "zef install .", problem that is solved with "zef install /full/path/to/my/module". 21:46
Are you aware of such problems, or would it be useful for me to send you the details?
(Appears to have to do with some "resources" not being found." 21:47
ugexe it works for me fwiw
im pretty sure the CI tests have a test case for absolute local paths as well
whats your repo, and wheres the full output 21:48
lucs It also involves NativeCall, just saying.
Um, it's not my module actually, so I'll write up the problem in detail, rather than go back and forth here with you. 21:49
rf Does anyone know off hand what algorithm .sort uses? 22:10
[Coke] Rakudo::Sorting.MERGESORT-REIFIED-LIST( 22:15
rf [Coke]++
[Coke] github.com/rakudo/rakudo/blob/main...G.raku#L69 22:17