🦋 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 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 8 June 2022.
tbrowder ref path parts, that's not quite correct. iour IO guide doesn't 14:19
show how deeper dir structures work. in fact, i would like to see more class methods to truly take a path apart. (perhaps one called .subpaths or such since .parts is taken; or .all-parts; OR enhance the current .parts) 14:22
Voldenet consider calling them path segments 14:37
it's URI naming, but I find it neat
tbrowder i like that. but fiddling deeper with docs i see most examples are using syntax of "/full/path".IO.method but i don't see a more practical example where a prog has a path or file name in $filename and then operate on that. i'm still working on a possible doc chg and finding lots i've not visited before in the IO and IO::Path classes... 14:51
tbrowder yep, path handling imho could be better. 15:56
[Coke] I am using proc::async to run a bunch of git commands, and for some reason my list of branches isn't matching up when I run the commands by hand. the async pattern makes it a little challening to true up the output from the various commands to the output I'd get by hand. (esp. since I'm running commands with 100s of branch names) 15:57
I'm sure I'm doing something stupid somewhere, just can't do the matchup to see what it is. :) 15:59
tbrowder file.parents for all paths, e.g.: "/a/b/c".IO.parents.say: "/a", "/a/b" 16:00
file 16:01
"/a/b/c".segments.say: "a", "b", "c" 16:02
hm, a quick glance at rakudo source and it looks like .segments would be a cake walk for lizmat ;-) 16:15
ugexe split on $SPEC.dir-sep 16:18
$*SPEC.dir-sep
which also probably reads better than something like 'segment' which could reasonably be interpreted to mean many other things 16:19
tbrowder .path-segments
ugexe i dont see how a developer can imply what .path-segments means either 16:20
(i.e. windows will have a volume, is that part of a segment?)
tbrowder m: my $p = "/a/b/c"; $p.split: $*SPEC.dir-sep 16:21
camelia ( no output )
ugexe m: say "/a/b/c".split($*SPEC.dir-sep) 16:22
camelia ( a b c)
tbrowder yes, i would expect to get the volume
ugexe right, but would everyone?
tbrowder good question
run it up the flag pole and see if anyone salutes it :-D 16:23
i think we already show the volume on .parts (or one of the other methods) 16:25
anyhow, i see the work-around for my current use case 16:26
thnx for the $*SPEC.dir-sep reminder 16:27
[Coke] is there a case where "git show -q --format='...' remotebranch1 remotebranch2 remotebranch3" would not return 3 lines of output? 16:40
DOH. Yes - when two of the branches are the same commit. 16:48
I had started chunking the git calls (had been doing 2 calls per branch, figured out how to do 1 per a hundred)... but now over the thousands of branches I'm looking at, some are dupes, and so fall off the output list. Oy. 16:50
[Coke] raku, sorry I doubted you. :) 16:57
lizmat clickbaits rakudoweekly.blog/2022/08/01/2022-...merelease/ 18:13
[Coke] m: class A { has Int $.foo } ; my $a = A.new; $a.foo = 3; 20:41
camelia Cannot modify an immutable 'Int' type object
in block <unit> at <tmp> line 1
[Coke] What dumb thing am I doing here?
ugexe m: class A { has Int $.foo is rw } ; my $a = A.new; $a.foo = 3; 20:42
camelia ( no output )
[Coke] ah, that dumb thing. Thanks