🦋 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.
_grenzo @aruniecrisps I've updated your issue on cro-http with a solution. 01:10
gfldex Do we have a "representative" on lobste.rs ? 08:53
librasteve if so, please can i get an invite? 08:58
gfldex That's why I'm asking. :)
There are alot ... halve-truths about Raku dropped on that site. 08:59
librasteve grenzo ++ … does this mean cro-http needs to change docs to reflect making a self cert? (i had got the idea that the fake-tls was to avoid that step) 09:04
tbrowder__ m: 11:44
evalable6
tbrowder__ i'm having probs with using when blocks to parse @*ARGS elements. the user has to identify an input file name and i code it like this fragment: my $ifil; for @*ARGS { when not $ifil.defined { $ifil = $_ if $_.IO.f } }; 11:50
that works for defining $ifil, but following when blocks are ignored. i've tried using proceed but no help. 11:51
i've had some success putting that block last, just before the default block. 11:52
should i just use a for loop? 11:56
kjp tbrowder: Are you expecting, on each iteration of the for loop, for that when clause to execute, and then have the following code (more when clauses?) executed? 12:05
tbrowder__ yes. i suspect i'm attempting an invalid attempt. the docs are a bit confusing on the issue. in the meantime, i've reverted to a for loop and all is well. (sounds like a good entry for a trap for the unwary). 13:40
lizmat tbrowder_: how about: my $ifil = @*ARGS.first(*.IO.f); 13:42
tbrowder__ ^^
tbrowder__ thnx, but i want file to be entered in arbitrary position 14:08
next prob though, how to properly test for bool True or False from a sub return? 14:09
m: sub bool($f) { False }; my $v = boo(5); say $v 14:11
camelia ===SORRY!=== Error while compiling <tmp>
Undeclared routine:
boo used at line 1. Did you mean 'bool'?
tbrowder__ m: sub bool($v) { False}; my $v = bool(5); dd $v 14:12
camelia Mu $v = Bool::False
tbrowder__ m: sub bool($v --> Bool) { False}; my $res = bool(5); if $res.so { say "true" } else { say "false"}; 14:16
camelia false
tbrowder__ any cleaner way to do that? 14:17
lizmat tbrowder__ but my code allows it to be at any position ? 14:20
tbrowder__ sorry, i see that. 14:32
tbrowder__ so can that be combined with a method to also remove it from @*ARGS 14:35
lizmat than you could ask for the index where it's found 14:36
tbrowder__ like: $ifil = @*ARGS.first(*.IO.f).shift. 14:37
lizmat e.g.: my $index = @*ARGS.first(*.IO.f, :k); and then splice out that element out of @*ARGS
tbrowder__ thnx, but for my use i think a for loop is simpler. 14:39
lizmat m: my @a = ^10; sub eject(@a is raw, &target) { with @a.first(&target, :k) { @a.splice($_,1) } else { Nil } }; say @a.&eject(* == 3); say @a 14:43
camelia [3]
[0 1 2 4 5 6 7 8 9]
lizmat tbrowder__: or create a "sub eject" and use that :-) 14:44
afk& 14:49
m: my @a = ^10; sub eject(@a is raw, &target) { with @a.first(&target, :k) { @a.splice($_,1).head } else { Nil } }; say @a.&eject(* == 3); say @a 14:50
camelia 3
[0 1 2 4 5 6 7 8 9]
lizmat really afk&
_grenzo @librasteve Alternatively, they could check in new cert and key 15:34
librasteve ok - will try it - thanks! 19:05
I just saw the concerns on reddit about apt-get rakudo 21:48
www.reddit.com/r/rakulang/comments...libraries/ 21:49
I get that rakudo.org is keen to showcase all the many ways to get and run rakudo, but I am worried that it (and we) are spread too thin and that newbies will get a less than awesome experience from many of the ways listed 21:51
ok - I have made this github.com/librasteve/raku-Distro-Meta 22:34
please go here to make a case to keep or drop your favourite distros ... I will start to submit PRs to prune the tree and let you all know how I feel about it 22:36
github.com/rakudo/rakudo.org/pull/98 ... here's the kick off PR - please do comment 22:47