🦋 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 Evening, folks. 00:19
guifa o/ 00:32
pingu /g says use :g but when I do it says unsupported modifier 00:49
rf Show code 00:50
pingu ok 01:01
pastebin.com/p2u3tkfm 01:03
rf That is simply a syntax error, try $data ~~ :g /\r?\n/ 01:04
pingu still isnt working 01:18
pastebin.com/A4WyYWGD 01:19
if @data_ldr ~~ :g /\r?\n/ does : Missing block at C:\Users\kris\Desktop\CommaProjects\test\testing.raku:6 ------> if @data_ldr ~~ :g /\r<HERE>?\n/ 01:21
rf try m:g/blah blah. 01:22
pingu that works on the short regex but if I do it here I get: Quantifier quantifies nothing at C:\Users\kris\Desktop\CommaProjects\test\testing.raku:6 ------> if (@data_ldr ~~ m:gmx /(?<HERE>P<color_codes>(?:\d+[ ]){13}\d+)[ ] (?P< 01:27
raku is probably better at handling the exeptions so ill just use the first (shorter) regex then 01:29
rf I think there is a syntax error in your second regex, not because m:g 01:31
MasterDuke (?:) i.e., a non-capturing group, is just [] in raku 01:35
pingu ok how do I assign the data that the regex matches, so a variable? 01:46
rf Captures, I recommend you read this whole thing docs.raku.org/language/regexes 01:50
pingu ah crud I forgot its just the built in $/ 01:56
pingu ok all this does is print the newlines lol. I wanted to print the newlines 02:03
pingu ok i got it thx bbl 02:04
Geth rakudoc/main: 744e7a2be2 | (Will Coleda)++ | 2 files
Fix Deprecated warning

Use correct version with fallback if needed.
Closes #20
02:22
Geth rakudoc/main: 79f8dc0c66 | (Will Coleda)++ | 2 files
Updating Changelog

Revert version change until we're ready to publish
02:28
saraaa hi Earn Money by Playing Games With APP t.co/gINw00dVFI 07:54
el saraaa: no 08:06
Voldenet You can earn some money by working on raku
Zephyr should I delete that on the Discord side just in case 08:28
p6steve yes ^^ 08:31
Nemokosch hello 09:30
tellable6 2023-02-08T11:21:06Z #raku-dev <nine> Nemokosch: appending is ok
2023-02-08T12:31:21Z #raku-dev <ab5tract> Nemokosch: There's the answer of whether you can actually descend from it or not
Nemokosch :D 09:31
leont m: sub foo is trailing_docs("Foo!") {}; say &foo.WHY 13:36
camelia No such method 'set_docee' for invocant of type 'Str'
in block <unit> at <tmp> line 1
leont I guess That doesn't work as expected…
I guess it's expecting a POD entry, which almost makes sense but makes it rather hard to use 13:38
And giving the error on fetching instead of on setting makes it confusing
Nemokosch you could open an issue for it 14:29
I get more optimistic about the resolution of issues, once there are more issues I can actually solve 😄 14:30
El_Che on other news, telemetry is bad: github.com/golang/go/discussions/58409
tonyo sad 14:31
shmup yuck 14:32
tonyo "opt-out" by default is on brand for go, though
El_Che not go
googl
tonyo huh? is that discussion not adding telemetry to the go compiler?
El_Che by people employed by google :)
tonyo: yes, it is 14:33
Nemokosch Remember when Audacity had a telemetry "incident"?
tonyo guess i won't go past whatever version they're on now 14:35
El_Che GOOGLE_DO_NOT_SPY_ON_ME=1 go get some.pkg 14:36
how to install a go pkg :)
tonyo i hope that dies before it grows legs 14:39
El_Che on the other hand, it may be an incentive to finally learn rust :) 14:40
or get more libs into raku :)
tonyo write a go generator to transpile to raku 14:41
El_Che and sends data to Microsoft 14:42
tonyo bingpt
El_Che bingo
Nemokosch 🤣 14:45
ab5tract Does anyone know where the code for tellable6 lives? 15:19
shmup <google> El_Che, you forgot to say please.
Nemokosch ab5tract yes, it's hidden somewhere in Whateverable, I think under xbin 15:23
github.com/Raku/whateverable/blob/...ellable.p6 right
ab5tract thanks 15:28
zashi Hi. How can I include/use/require another raku file that is just sitting besides my current running raku script in the same folder? I've managed to build a module but this is not what I want.. 16:35
ugexe use lib $*PROGRAM.parent; use my_other_filename_minus_extension; 16:37
Nemokosch are .raku files good to go? iirc there was some extension-sensitivity involved 16:39
zashi I tried .raku and .p6 and nogo
ugexe if its a module then it should be .rakumod 16:40
zashi its not a module. its just a plain script
raku script
tonyo when you say include/use/require are you meaning run the script or embed its source in the parent, then? 16:41
ugexe require "{$*PROGRAM.parent.absolute}/my-file.raku"; 16:42
zashi ok, both forms seems to work, I just had to use quotes. any idea what is the namespace everything is imported into? can't seem to access subs from that file 16:45
Nemokosch simple: if they aren't marked for exporting, nor our-scoped, then they won't
if they are our-scoped, hm, tbh I'm not sure but I guess you could somehow refer to the compunit? 16:46
zashi well, the content of the file is : sub hello is export {say "hello"} 16:48
but now I noticed that whatever I put as file in require, I get no error, but I dont think it does anything
tonyo zashi: if you want it to export into a namespace, you should have a file called `META6.json` that lists that file in the provides and at the top of your file you can do `unit module <Some Name>;`, in the script you want to say hello, `use <Some Name>; hello;` 16:49
zashi than I actually cant have a project that is multiple files? I have to split it into modules? 16:50
if I want to split a project by function = file then I would have a huge amount of modules? 16:51
tonyo you want one function per file?
Nemokosch iirc require doesn't do importing on itself, import would. And use is a combination of them. 16:53
you can import a module and a module is supposed to have a certain file extension 16:53
tonyo m: '/tmp/xxx.rakumod'.IO.spurt: 'sub hello is export { "hello".say; }'; require "/tmp/xxx.rakumod" <&hello>; hello; 16:54
camelia hello
tonyo ^
zashi: ^ you can import named exports that way 16:55
Nemokosch oh okay, require is apparently the runtime version of use. I mixed it up with need 16:56
(perhaps because these words mean the same...) 16:56
zashi ok, it works. having a file with .rakumod is acceptable. having a META6.json would not be, because that means I'd have equally count of folders :) 17:09
tonyo module name and folders don't need to align 17:12
ugexe require "{$*PROGRAM.parent.absolute}/lib/Zef/Utils/FileSystem.rakumod" <&list-paths>; say list-paths($*CWD)
you have to declare what you want to import when requiring 17:13
tonyo you could just put `Mod::Fn1` in `lib/fn1.rakumod`
zashi tonyo: 17:22
> module name and folders don't need to align
no, Im just saying IF I would have been required to have a META6.json individually for each module
zashi but apparently I dont need to 17:22
pingu how do I make this perl 5 regex into valid per 6: my $regex = qr/1[ *\t].[ *\t]0/p; 17:23
Nemokosch what does it do? Not gonna lie, I'm not used to these regexes anymore 😄 17:33
lizmat neither :-)
moritz rx{ 1 <[\ * \t]> . <[\ * \t]> 0 } 17:35
Nemokosch when moritz is around, he either changes directory or casually translates plain old PCRE to Raku regexes 😛 17:38
pingu infact can I do something like this: my $linetype = qr/^^[ \t]+?[1-6][ \t]+/p; 17:40
my $color = $linetype~qr/[ \t]+[[:digit:]][ \t]+/p;
if I just did two if's or one if with an && it would still start from the beginning of each line so I decided to put $linetype inside of $color 17:42
since raku doesn't like long complex perl 5 regexes 17:43
it seems to understand short ones, so I made each paramater a regex
pingu so it should be, any spaces or tabs (or nothing) followed by 0,1,2,3,4,5 or 6 followed by any spaces or tabs, followed by any whole number followed by any spaces or tabs 17:54
and yes that means any positive integer only 17:56
pingu oh great it doesnt even understand the first regex, in $linetype 18:05
Nemokosch you made that one up, right? 18:16
pingu I get them from regex101 18:19
i.e as pcre , before that I write and test it as PCRE<PHP>7.3 18:21
lizmat / \s* <[0123456]> \s* \d+ / 18:32
/ \s* <[0123456]> \s* \d+ \s* /
m: " 1 456 " ~~ / \s* (<[0123456]>) \s* (\d+) \s* /; say ~$0; say ~$1 18:34
camelia 1
456
Nemokosch ok sorry missed a couple of messages 18:35
pingu back 19:38
pingu it works if its one regex but not if its two: pastebin.com/vWf1UBSJ 20:37
if I do $linetype ~ $color it says im trying to coerce it into a string
if (@data_ldr[$i}[] ~~ $linetype ~ $color) { . . . } 20:38
if (@data_ldr[$i][] ~~ $linetype ~ $color) { . . . }
would $\(if the above code worked) therefore be the matches of $linetype and $color contatenated? 20:39
pingu unless I need & or && (conjunction) 21:14
pingu named regexes are clearer 21:17
melezhik o/ 22:20
tellable6 2023-02-08T20:25:06Z #raku <tonyo> melezhik: that unattended flag onlyh works in that specific function - working off the dist branch which is introducing dist management stuff and i'll integrate that there if you want to do some pre-testing on that branch
melezhik .tell tonyo - that's ok, I can wait till the issue is fixed, anyway I have already renewed my fez token, so it's not possible to reproduce the bug now 22:21
tellable6 melezhik, I'll pass your message to tonyo
melezhik if someone is interested in running docker tasks inside SparrowCI pipelines - now this is possible - github.com/melezhik/sparrowci-dock...arrow.yaml 22:22
ci.sparrowhub.io/report/2985 22:25
ci.sparrowhub.io/report/2986 22:27
Nemokosch do you know a simple way to trace down warnings? 22:32
rf .tell melezhik I have a large JVM based code base I want to run in CI, does Sparrow support JVM images? 22:50
tellable6 rf, I'll pass your message to melezhik
pingu ok here is the full parser regex, now I need someone to convert it into raku regex101.com/r/HCK9jC/4 22:51
Nemokosch looks full cursed tbh 23:06
btw found the answer to my own question: CX::Warn control exception, CONTROL phaser can catch it 23:07
tonytheraku Installed rakudo star from source this afternoon on aarch64 (Pi), seems to be working OK but the logs say that several modules failed to install, some flagged as [CRIT]. Is this a significant issue? Should I just try to zef them into place from the repos?
El_Che rakuthetony: I would go the zef router. If I understand correctly, there is no magic in the modules in star: not pinned for stability etc. So updating sound ok 23:09
2c
tonytheraku El_Che Thanks, will do, but wonder why the modules didn't install? Is I was missing something important enough to cause this, maybe the compiler installation would have flunked (but it didn't)? 23:11
El_Che tonytheraku: no idea actually 23:12
tonytheraku It's a minor mystery, but I've got enough working for now, I'll dig into the zef repos see what I can cobble together 23:13
rf Is there a very idiomatic way to check if a positional is empty? 23:21
if @list.elems
I thought but it doesnt feel right
Nemokosch especially since this can fail on lazy stuff - remember? 23:24
"cannot call .elems on a lazy list", bool context, bang, suddenly it's "empty", although it's just lazy 23:25
a plain if @list is actually better for an empty-check 23:26
because that only tries to fetch one element to decide
guifa Agreed, `if @list` 23:31
or you can also prefix with ? to force boolean context (like if passing as an argument) 23:33
foo( ?@list, arg2, arg3)
rf I like if @list 23:39
elcaro Call me crazy, but for code I plan to maintain, I like if @list.elems == 0 or @list ~~ Empty, because they're more explicit. 23:55