🦋 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.
00:09 soverysour joined 00:14 soverysour left 00:15 jpn joined 00:16 guifa left 00:20 jpn left 01:11 hulk joined 01:12 kylese left 01:16 jpn joined
tbrowder i filed an issue with zef. maybe ugexe can add a tweak to "zef test ." 01:17
01:21 jpn left 01:30 nine left, nine joined
ugexe tbrowder: you should be ensuring your test cases ultimately test those code paths 01:35
if your test never tries to access or use your pod file then it will never be precompiled
if you want to force precompile everything when you test, then use `zef install . --force-install --dry` 01:37
that will run the tests and precompile everything regardless as if it is going to be installed. it wont actually install (because --dry) and you wont have to keep updatin gthe version (because --force-install) 01:38
otherwise as i mention earlier you can just write a test that handles this 01:40
github.com/ugexe/zef/blob/main/t/0...d.rakutest
that test ensures every file precompiles 01:41
this issue isn't specific to pod either. if you write a module that doesn't parse and your tests don't ever use that module, you'll not encounter the error until install time when it gets precompiled prior to install 01:47
[Coke] ugexe++ 01:57
02:15 hulk left, kylese joined 02:29 guifa joined 02:43 jpn joined 03:07 guifa left 03:11 guifa joined 03:15 guifa left 03:31 wayland left 03:34 wayland joined
Xliff How can I get META6 information from raku? Isn't there a dynamic var for it? 03:51
05:00 jpn left 05:18 Sgeo_ joined 05:21 Sgeo left 05:30 Sgeo_ left 05:45 phogg left 05:50 phogg joined
xinming m: class T { has @.x }; my %h = :x<a b c>; (T.new(|%h.Capture), T.new(|%h)).raku.say; 07:02
camelia (T.new(x => [("a", "b", "c"),]), T.new(x => [("a", "b", "c"),]))
xinming In this case, How can we initialize the @.x as expected? Since we are providing a list to in the arg. But it seems, that args becomes an item in the list. 07:03
Is this a bug or I use it wrong?
m: class T { has @.x }; my %h = :x<a b c>; (T.new(:x[1,2]), T.new(|%h.Capture), T.new(|%h)).raku.say;
camelia (T.new(x => [1, 2]), T.new(x => [("a", "b", "c"),]), T.new(x => [("a", "b", "c"),]))
xinming I think I know the reason, because when the pair :x<a b c> is in Hash, there is a scalar container around the list. 07:09
But still wonder wether we can turn hash into a Capture, and directly used as functiona rgs. 07:10
ab5tract xinming: only if you tweak it manually 07:28
m: class T { has @.x ; method TWEAK(:@x) { @!x = |@x }}; my %h = :x<a b c>; (T.new(:x[1,2]), T.new(|%h.Capture), T.new(|%h)).raku.say;
camelia (T.new(x => [1, 2]), T.new(x => ["a", "b", "c"]), T.new(x => ["a", "b", "c"]))
ab5tract a trait could probably do that too 07:29
xinming ab5tract: Yea, that worked, But I don't feel it's natural that we need to TWEAK this ourselves. and it creates hidden bugs. :-( 07:38
ab5tract What hidden bugs? 07:39
xinming I mean when we write app
In my personal script, I use @.array in class to test the value is "empty", But actually, it still recevies the $[] from arg., So @.array is not empty. 07:40
I don't know if this is documented BTW
ab5tract FWIW It would create more hidden bugs to change the behavior 07:42
You can’t have a default that covers all cases. This is part of why TWEAK exists in the first place 07:43
I also mentioned that a trait could likely handle this case
xinming yea, Probably we can add some fixing in attribute traits
yea, a trait is probably right way to go, and can be wel documented.
ab5tract How do you feel about giving a try at implementing it? 07:48
xinming I won't promise since I've been busy with daily life, But will try when I have time. :-) 07:54
ab5tract Cool :) 07:55
xinming I'm still learning embedded development, and I'll use raku as host language to control the SoC
ab5tract Ahh, that sounds very fun
07:58 dakkar joined
Xliff What would be a good name for it? 08:03
The trait, I mean.
08:26 sena_kun joined 08:32 wayland76 joined, wayland left 08:33 jpn joined
xinming Xliff: "bind" or "decont" ? 08:43
08:46 soverysour joined 08:51 soverysour left 08:59 kjp_ left 09:01 kjp joined 09:32 jpn left 09:37 jpn joined
ab5tract Naming it would indeed probably be the hardest part :) 10:02
11:06 soverysour joined, soverysour left, soverysour joined, jpn left 11:09 jpn joined 11:12 Tirifto left, abraxxa joined
abraxxa What happened to the nxadm raku builds? The latest version is still 2024.02 11:13
11:14 jpn left
lizmat El_Che ^^ ?? 11:16
11:17 jpn joined 11:22 jpn left 11:24 jpn joined 11:29 lizmat_ joined, soverysour left 11:33 lizmat left
tbrowder ugexe: ref yr response, if i had just ensured ALL my modules were tested with "use-ok" the error would have been found, and rapidly! i have gotten lazy with the "basic" load test. thanks for the reminder! 11:34
i'm gonna add that to my lint suite 11:36
11:41 Tirifto joined 11:46 jpn left
wayland76 ab5tract: Great, I think I understand a bit better this time. I'll give it a go. 11:49
12:05 lizmat_ left 12:06 lizmat joined 12:12 jpn joined
ugexe tbrowder: it could probably be some type of test module even. Something `use Test::UseAll <use-all>;` and then `use-all("directory containing META6.json")` e.g. `use-all("../")`, which then would iterate over all files recursively and `use-ok()` any file with a rakumod or rakudoc extension. 12:19
[Coke] releasable6: status 12:53
releasable6 [Coke], Next release in ≈2 days and ≈6 hours. There are no known blockers. Changelog for this release was not started yet
[Coke], Details: gist.github.com/7ea898a8f48c3a1c3e...b47c8da269
[Coke] .seen finanalyst 12:58
tellable6 [Coke], I saw finanalyst 2024-05-24T09:21:18Z in #raku-dev: <finanalyst> lizmat: I found .join.naive-word-wrapper in RakuDoc::To::Text, but cant find where naive-word-wrapper is documented.
13:40 ACfromTX left 14:14 soverysour joined 14:19 jpn left 14:22 soverysour left 14:26 jpn joined 14:31 soverysour joined 14:36 jpn left, simcop2387 left, perlbot left 14:40 simcop2387 joined, Salizer joined 14:42 perlbot joined
tbrowder ugexe: sounds good, add that to raku's Test suite 14:43
14:44 soverysour left
tbrowder Xliff: thnx to ugexe's help i've found a way to interrogate the META6.json file whether installed or not 14:46
14:48 abraxxa left
tbrowder my module HowToUseModuleResources demos that, but it needs some more work mainly in documentation. 14:49
14:50 Salizer left 14:51 soverysour joined, soverysour left, soverysour joined
tbrowder the truth is any file in the repo can be interrogated if (1) it exists in the repo file system, (2) there exists a "resources" directory in the top of the repo dir, and (3) the file is listed in the META6.json's "resources" list with its path listed as *relative* to the resources directory 14:53
for example, put in the META6.json file: "resources": [ "../META6.json" ], ..." 14:56
14:59 soverysour left 15:03 thaewrapt left 15:04 soverysour joined, soverysour left, soverysour joined 15:05 Core7850 joined 15:06 thaewrapt joined 15:07 Core7850 left
Xliff tbrowder: You can also do that from a module listed in a META6.json by referencing the $?DISTRIBUTION variable. $?DISTRIBUTION.meta gives you everything in META6, without referring to META6! 15:07
15:14 soverysour left, Salizer joined 15:20 xinming left 15:24 Salizer left 15:25 Salizer joined 15:33 soverysour joined, soverysour left, soverysour joined, Salizer left 15:35 Geth left, Geth joined 15:43 soverysour left 15:50 soverysour joined, soverysour left, soverysour joined
lizmat clickbaits rakudoweekly.blog/2024/05/27/2024-...-incoming/ 15:51
16:05 Salizer joined
antononcube Also a clickbait: youtu.be/YCnjMVSfT8w 16:09
tbrowder Xliff: thnx 16:17
if that's all you need that's cool 16:19
16:21 Xliff left 16:30 Salizer left 16:37 dakkar left, xinming joined 16:42 xinming left 16:43 xinming joined 17:14 jpn joined 17:25 jpn left 17:30 jpn joined 17:42 jpn left 17:57 Chanakan left 18:00 Chanakan joined 18:34 sena_kun left, sena_kun joined 18:35 Brian11 joined
tbrowder but when i use that method i don't all that's in the actual META6.json 18:35
*don't get
well, maybe, sensitive stuff... 18:37
ugexe everything in META6.json will be in $?DISTRIBUTION.meta 18:50
or rather, $?DISTRIBUTION.meta{$key-name} can access any $key-name in META6.json 18:51
tbrowder yes, exactly, plus ver 19:05
19:16 soverysour left 19:35 xinming left 19:37 xinming joined 19:47 xinming left
Brian11 Hi, I'm having trouble getting my head around modules and "use" when it comes to local files. 19:52
Is there any good write ups that can help? I am finding the docs in relation to this a bit confusing. 19:53
19:54 xinming joined
ugexe tbrowder: yeah 'ver' showing up is sort of a old compatibility thing... note how in META6.json we declare "version":1 but in code we do `use Foo:ver<1>` (version vs ver). That being said you should generally be using .meta<version> 20:02
librasteve Brian11: have you read this docs.raku.org/language/modules? 20:04
20:14 Brian11 left 20:39 jpn joined 20:45 jpn left
ok - here's the basics, make a dir structure like this: . ├── lib │   └── C.rakumod └── script.raku 20:50
then C.rakumod is class C { has $.x; }
and script.raku is use lib './lib'; use C; my $c = C.new: :x(42); say $c.x; 20:51
you can embellish this basic pattern in many ways such as adding a module or unit keyword (the docs explain the effect of these) 20:52
note that is export is not needed on class declarations (it is the default, you can privatise the class with my class 20:53
)
tbrowder take a look at Mi6::Helper’s bin file mi6-helper to assist in quickly starting a new repo. 21:24
21:24 nine left, nine joined
gfldex lolibloggedalittle: gfldex.wordpress.com/2024/05/28/sm...ing-pairs/ 21:43
ab5tract gfldex++ 21:49
22:04 sena_kun left
antononcube @lizmat "ParaSeq" is interesting! 22:18
gfldex lizmat: On that topic, did you think about feed operators when you wrote ParaSeq? They where meant to autothread. 22:30
22:31 Sgeo joined
lizmat yes, I have both >>. and ==> in mind with ParaSeq 22:32
gfldex Cool. :)
22:32 teatwo left 22:33 teatwo joined
tbrowder lizmat: jmerelo's Pod::Load module works grear 22:34
lizmat also .hyper obviously
tbrowder *great to check and extract pod from a file, but it uses some nqp. sometime when you're not busy (ha ha) could you take a look and see if that nqp might change in your improvement of Raku? 22:37
i'll check with jj, too, but he is very busy with non-raku work now. 22:38
23:03 wayland76 left