🦋 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 doc: d8c38a702a | Coke++ | xt/search-categories.t
Use category list from documentation

  * Avoid having two copies of the same data
  * minor whitespace fix in test description
00:06
doc: b79374095d | Coke++ | doc/Language/operators.pod6
Use category from approved list
linkable6 Link: docs.raku.org/language/operators
doc: 8273088eeb | Coke++ | xt/search-categories.t
Verify each category is actually used
Geth ¦ doc: coke assigned to Altai-man Issue "Routines" category is unused github.com/Raku/doc/issues/4064 00:12
¦ doc: coke assigned to JJ Issue Category case inconsistency github.com/Raku/doc/issues/4063 00:13
¦ doc: coke assigned to Altai-man Issue Category case inconsistency github.com/Raku/doc/issues/4063
hythm m: class C is repr('CStruct') { has int $.x; method increment () { $!x += 1 } }; my $obj = C.new(:1x); my @a = $obj; say @a; $obj.increment; say @a 02:48
camelia [C.new(x => 1)]
[C.new(x => 2)]
hythm ^ is this correct? I was expecting `x => 1` for both cases, or this is how it's supposed to work for `CStruct` classes? 02:50
Voldenet CStruct is a pointer to the struct, not the actual struct 02:51
it's more useful in most contexts
hythm so is there is a way to pass a copy of it? I tried .clone, but its NYI
Voldenet if you need any solution that works, I suppose that just creating `clone` method will work 02:58
m: class C is repr('CStruct') { has int $.x; method clone { self.new(:$!x) }; method increment () { $!x += 1 } }; my $obj = C.new(:1x); my @a = $obj.clone; say @a; $obj.increment; say @a
camelia [C.new(x => 1)]
[C.new(x => 1)]
moon-child hythm: note you also cannot use c interfaces that expect a by-value struct 03:02
this is a flaw in dyncall 03:03
hythm Thanks everyone.  went with clone method 03:09
CIAvash weekly: www.ciavash.name/blog/2022/04/25/f...-on-emacs/ 05:08
notable6 CIAvash, Noted! (weekly)
Geth ¦ doc: JJ self-unassigned Category case inconsistency github.com/Raku/doc/issues/4063 05:21
Guest20 hi! I've got some 2d data in a 2d array. but when I use the map function it flattens the result into 1d. are arrays bad for mapping 2d data or am I doing something else wrong? 05:50
Voldenet post some example, because it works like one would expect 05:53
m: say (1, 2; 3, 4).map(*.map(* * 2))
camelia ((2 4) (6 8))
Voldenet m: say (1, 2; 3, 4).deepmap(* * 2)
camelia ((2 4) (6 8))
Voldenet m: say [[1, 2], [3, 4]].deepmap(* * 2) 05:54
camelia [[2 4] [6 8]]
Guest20 I get these outputs from the repl: 05:56
> my @array[2; 2] = [[1, 2], [3, 4]]
[[1 2]
 [3 4]]
> @array.map(* * 2)
(2 4 6 8)
that's a 8 ) rather than a smily 05:57
Voldenet Ah, that's a shaped array, I don't use them much 06:00
they come with odd limitations 06:01
m: my @array[2; 2] = [[1, 2], [3, 4]]; say @array[1]
camelia Partially dimensioned views of shaped arrays not yet implemented. Sorry.
in block <unit> at <tmp> line 1
Voldenet m: my @array = [[1, 2], [3, 4]]; say @array[1]
camelia [3 4]
Guest20 should I use the nested lists instead? they look like they work okay
Voldenet tbh. I prefer to always use simple arrays instead 06:06
lists are supposed to not be mutable 06:07
Voldenet m: my $x = 42; my @l = (1, 2; 3, $x); @l[1][1] = 5; say @l; say $x 06:07
camelia [(1 2) (3 5)]
5
Voldenet m: my $x = 42; my @l = (1, 2; 3, $x); @l[1][0] = 5; say @l; say $x
camelia Cannot modify an immutable List ((3 42))
in block <unit> at <tmp> line 1
Voldenet m: my $x = 42; my @l = [[1, 2], [3, $x]]; @l[1][1] = 5; say @l; say $x
camelia [[1 2] [3 5]]
42
Voldenet this piece of docs may be enormously useful to pick the right structures to use: docs.raku.org/language/list 06:09
Guest20 thank you for the help
El_Che japhb: oops 08:45
Geth problem-solving/JJ-patch-1: 84e555ee96 | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | .github/CODEOWNERS
Remove self as owner of that section

I can no longer claim responsibility for the documentation repo *de facto*. It's only sensible to remove myself from here too.
09:48
problem-solving: JJ++ created pull request #322:
Remove self as owner of that section
Nemokosch hi, any idea why qq{{' ' x $n}} does not interpolate? 09:52
is this intended?
if I use different parens for qq, it does
gfldex your delimiter is {{ 09:59
Nemokosch well you wish that was the problem but it wasn't; the same happens if the brackets aren't next to each other 10:03
> > qq{ByteFeld_ausgeben("{' ' x $n}", } 10:04
> ByteFeld_ausgeben("{' ' x 4}",
> > qq/ByteFeld_ausgeben("{' ' x $n}", /
> ByteFeld_ausgeben(" ",
or better said, the question does arise, the first example was wrong 10:11
Geth doc/old-docs: 4 commits pushed by (JJ Merelo)++, Coke++ 11:43
lizmat and yet another Rakudo Weekly News hits the Net: rakudoweekly.blog/2022/04/25/2022-...inrelease/ 12:10
jaguart a bit confused by ``race``... expecting threading 12:37
m: race for <a b c> { $*THREAD.say } 12:38
camelia Thread #4 (GeneralWorker)
Thread #4 (GeneralWorker)
Thread #4 (GeneralWorker)
jaguart m: await( <a b c>.map({ start { $*THREAD.say }}) )
camelia Thread #4 (GeneralWorker)
Thread #4 (GeneralWorker)
Thread #4 (GeneralWorker)
jaguart On my linux host, race all has the same thread number (effectively serialised), while awaiting promises does thread 12:39
Geth ¦ doc: Altai-man self-assigned "Foreign" is repeatedly used when other categories should probably fit better github.com/Raku/doc/issues/4062 13:32
gfldex m: <a b c>.race(:batch(1)).map: { $*THREAD.say }; 13:46
camelia Thread #4 (GeneralWorker)
Thread #4 (GeneralWorker)
Thread #4 (GeneralWorker)
gfldex jaguart: race-statement doesn't have a small enough batch-size to show what goes on in your example and the host of camelia may not have enough cores to do any threading. 13:47
jaguart gfldex: thank you - :batch(1) tadah! :) 13:53
Juerd I like that the .04 release has faster startup than .03 15:37
~30 ms off. Not there yet but a good improvement either way 15:38
Juerd strace shows quite some time (approx. 20 ms) is spent reading /proc/stat and /proc/cpuinfo. What are those needed for?! 15:45
Apparently that's a libuv thing 15:47
[Coke] do we have docs on how the current docs site is published? I got the impression it was being done by hand recently. 19:08
sena_kun [Coke], the best bet is maybe migration ASAP 19:15
[Coke] That's a possibility but I know there's several outstanding questions. 19:17
sena_kun yes, that's why fixing them is a must to move forward IMO 19:18
but otherwise you can ask rba for access to the server where the docs host, then you can generate a static set of pages using Documentable and just rsync it, I think
kybr could someone point me to the state of the art for Java interoperability? importing a Java library and calling a function? 20:38
tellable6 2021-05-09T22:02:00Z #raku <tbrowder> .tell kybr checkout my 2021 advent post about santa claus and raku: a christmas tree forming a raku script
[Coke] kybr: stackoverflow.com/questions/271563...from-perl6 21:12
(yes that's old. not sure if we have something more recent)
sena_kun camelia, say 42; 21:50
m: say 42;
camelia 42
sena_kun camelia, help
camelia sena_kun: Usage: <(nqp-moarvm|debug-cat|prof-m|nqp-js|p5-to-p6|nqp-jvm|rakudo-jvm|star-m|rakudo-moar|m|nqp-q|j|star|nqp-m|perl6|r|sm|r-m|rakudo|nqp-mvm|p6|r-j|r-jvm|rm|master|nqp|p56|rj)(?^::\s(?!OUTPUT)) $perl6_program>
sena_kun camelia, info
does camelia have external API or can it have one?
[Coke] p5-to-p6: $|=1 22:53
camelia # Do not edit this file - Generated by Perlito5 9.028

{
sub JS::inline (*@_);
sub Java::inline (*@_);
${'|'} = 0;
$warnings::VERSION = 1.42
}
class main {
${'|'} = 1
}
melezhik .tell patrickb I've added support for any git urls, not just GH - sparrowhub.io:2222/report/232 23:10
tellable6 melezhik, I'll pass your message to patrickb
melezhik for example for source hut and gitlab
one just need to make checkbox - "not a GitHub URL" when adding git repo 23:11
japhb melezhik: Why not autodetect that? 23:12
(Or at least autodefault)
melezhik because it will take oath2 integration with gitlab/sourcehut
right now it's only auto detect for GH repos 23:13
japhb melezhik: Right, but GH urls only come in a few fixed formats. You could set the default by just prefix match on the URLs
melezhik because GH is the only oauth supported
japhb Oh, I see, I think I had missed that detail. 23:14
melezhik anyway, right now ANY git repos are supported as long as they publicly accessed via `git clone $url`
however to enable login one need to have a GH account