🦋 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.
jaguart rf: lol - I know that feeling :) 02:25
rf jaguart: Yeah I wasn't even running the right code lol, I was targeting another block without even knowing 02:32
PipStuart Nemokosch: Sorry I missed the "c" in your nick twice. My oversight. 02:52
tellable6 PipStuart, I'll pass your message to Nemokosch
ispyhumanfly Hey all, are their any good/recommended CLI frameworks for Raku? 04:22
tellable6 2023-01-18T19:33:38Z #raku <tonyo> ispyhumanfly no problem. i have a fix for that bug in progress
hey ispyhumanfly, you have a message: gist.github.com/33b390c3a9593b641a...63abab2213
ispyhumanfly tonyo: Great, I'll grab the fix when ready.
jaguart not sure about CLI frameworks, but when I'm big I'm going to be like github.com/ugexe/zef/blob/main/lib...LI.rakumod 04:29
I also quite like App::Mi6 - ala `my $app = App::Mi6::App.new; multi sub MAIN ... { $app.cmd('build') }` approach 04:31
ispyhumanfly jaguart: haha 04:32
jaguart: jaguart: Thank you. I'll dig into your comments.. 04:35
CIAvash tonyo: Thanks, it's been updated, should I close the issue or you'll do it? 05:43
jjatria Nemokosch: what's up? 10:19
tellable6 jjatria, I'll pass your message to Nemokosch
Homer_Simpson how can I treat each line of a file as a separate array element 14:51
[Coke] ... call .lines
Homer_Simpson pastebin.com/Gc6XnMGL
[Coke] again, .slurp gives you a single string including newlines; .lines gives you an array of lines; 14:52
you aren't calling .lines there, it's commented out
(this is the same thing we talked about yesterday) 14:53
Homer_Simpson ah ok thx 14:54
yes I commented that bit out cause I thought slurp was needed, but replacing slurp with lines worked 14:55
what does slurp do again, I know what chomp does
[Coke] "slurps" the file into a variable: it takes all the contents and puts them in a single string. 14:56
Homer_Simpson ohh
[Coke] docs.raku.org/routine/slurp
Nahita .lines doesn't give you an array. that you're assigning it to a @-sigiled thing reifies it, it being a lazy sequence that didn't fetch any lines until you asked, one way of which is @-sigiled assignment
[Coke] yes, it's really a Seq. but it is a Positional. Was only contrasting vs. string. 14:57
[Coke] Once we get String vs. Positional, we can drill down into types of array-like things. 14:58
m: dd $*ARGFILES.lines; 14:59
camelia ("»Wann treffen wir drei wieder zusamm?«", " »Um die siebente Stund‘, am Brückendamm.«", " »Am Mittelpfeiler.«", " »Ich lösche die Flamm.«", " »Ich mit«", "", " »Ich komme vom Norden her.«", " »Und ich vom…
[Coke] m: dd $*ARGFILES.lines.^name;
camelia "Seq"
[Coke] m: dd $*ARGFILES.lines.^mro
camelia (Seq, Cool, Any, Mu) 15:00
[Coke] m: dd $*ARGFILES.lines.^roles
camelia (Sequence, PositionalBindFailover, Iterable)
Homer_Simpson how come it is reading the file from bottom to top 15:02
pastebin.com/r7cbrZWk 15:04
and I also gotta do lines(contents) + 1 for some reason
ugexe for "data.ldr".IO.lines -> $line { say "This is line {$++} and its contents are: {$line}" } 15:06
that is more idiomatic 15:07
Homer_Simpson ok loop (my $i = 0 ; $i < elems(@contents) ; $i++)
Nemokosch or: for "data.ldr".IO.lines.kv -> $index, $line { say "This is line $index and its contents are: $line" } 15:13
you can write C-ish code in Raku as well but there isn't much point. You are throwing away the benefits while keeping the downsides 15:14
Homer_Simpson ok that works too thx but it is still printing in reverse order 15:23
its putting line 3's contents as line 0
err as line 1 15:24
I could make the loop decrement but then its basically C again and its not how computers read files anyhow
ugexe i think you're confused because nothing anyone has told you would read a file in reverse order 15:25
ugexe you might want to reevaluate what you're doing, the contents of the file, or how much coffee you've had today 15:25
Homer_Simpson ah oops ok thats how the file is 15:26
[Coke] :) 15:34
melezhik ispyhumanfly - check sparrow, it's cli framework, just very opinionated )))) , if you after creating cli apps with small efforts - sparrow could be a good fit - raku-advent.blog/2020/12/07/mixing...g-sparrow/ 17:01
tonyo CIAvash: i can close the ticket 17:31
notna Hi Rakoons. Who knows how the "Rakudo Star Bundle MacOS .dmg disk image file" on rakudo.org/star/macos was build in the past? 20:44
Any script or "how-to" somewhere, which I could start from?
[Coke] as one of the mac users, nope. 21:06
I typically build from scratch if doing dev or use rakubrew otherwise
sorry!
notna @coke: "building from scratch"... with the Srtar BASH script? 21:12
[Coke] no, with xcode, git, etc. 21:30
rakudo.org/downloads/rakudo/source 21:32
ugexe: rakudo.org/downloads/rakudo/source - should thaty last zef line say -I. , not -Ilib?
[Coke] (under linux/mac) 21:40
tonyo iirc there was a bundling script in the repo for it notna 21:45
github.com/rakudo/star/wiki/01_Rak...quickstart 21:46
ugexe [Coke]: yeah it should say -I. instead of -Ilib 22:57
it shouldnt technically matter, but its best practice
ugexe similar for others, like the WSL instructions 23:06
Homer_Simpson anyone know how I can tweak the given condition so that it checks for a number followed by a space because it is thinking 11 is line type 1: pastebin.com/GKPNRvs3 23:48
Homer_Simpson I sort of fixed it in a not very good way 23:56
I made substr 0 to 2 and changed '0' '1' '2' '3' '4' '5' to '0 ' '1 ' '2 ' '3 ' '4 ' '5 '
[Coke] do you care about the spacing, or would: 23:59
m: dd '01 02 03 04'.words
camelia ("01", "02", "03", "04").Seq