🦋 Welcome to the IRC channel of the core developers of the Raku Programming Language (raku.org #rakulang). This channel is logged for the purpose of history keeping about its development | evalbot usage: 'm: say 3;' or /msg camelia m: ... | log inspection situation still under development | For MoarVM see #moarvm
Set by lizmat on 22 May 2021.
lizmat Files=1351, Tests=117115, 288 wallclock secs (34.72 usr 9.69 sys + 4022.00 cusr 323.90 csys = 4390.31 CPU) 10:05
Geth JSON-JWT/main: 3a43f2abe8 | (Elizabeth Mattijsen)++ | 11 files
First commit in zef ecosystem
10:44
JSON-JWT/main: 37fdc96db1 | (Elizabeth Mattijsen)++ | Changes
1.1
10:48
JSON-JWT/main: 76423da9c7 | (Elizabeth Mattijsen)++ | 2 files
Fix typo in pod
10:53
Geth JSON-JWT/main: 052510a472 | (Elizabeth Mattijsen)++ | 4 files
1.1.1
11:52
patrickb good *, everyone 21:05
I'm looking at the breakage of IO::Path::parent I have caused.
m: /tmp/hiea/../foo".parent.parent 21:06
camelia ===SORRY!=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> /tmp/⏏hiea/../foo".parent.parent
expecting any of:
infix
infix stopper
statement end
statement modifier…
patrickb m: "/tmp/hiea/../foo".parent.parent
camelia No such method 'parent' for invocant of type 'Str'. Did you mean
'print'?
in block <unit> at <tmp> line 1
patrickb m: "/tmp/hiea/../foo".IO.parent.parent
camelia ( no output )
patrickb m: say "/tmp/hiea/../foo".IO.parent.parent
camelia "/tmp/hiea/../..".IO
patrickb I'd say that is correct behavior. Previous rakudo blindly removed elements from the end (but only if it's an absolute path). 21:07
Now File::Directory::Tree does: while $path !~~ :e { $path.=parent } 21:10
nine Whether that's correct depends on how "parent" is defined. In the file system sense, the above output is the only correct version. Of course "parent" could be defined as "chop off the last path part", then the previous behaviour would be correct
Seems like File::Directory::Tree is of the chopping persuation 21:11
patrickb The previous behavior was very inconsistent. It did the "blindly chop of" thing only for absolute paths and a broken version of the new behavior for relative paths. 21:12
[Coke] (tree) (chopping) (get it?)
nine is glad someone noticed :D 21:13
Seems like chopping is what the design meant: design.raku.org/S32/IO-OLD.html#parent
design.raku.org/S32/IO.html#.parent only says "Removes last portion of the path and returns the result as a new IO::Path." 21:14
patrickb I'm unsure I would read that into those docs. It also states that it doesn't remove "..". 21:15
patrickb Untested, but I'd say the examples given would work both in the new just as in the old implementation. 21:16
patrickb The difficult question is what should happen if the path already contains a ".." 21:19
nine I'm more and more convinced that .parent is meant as a plain stupid path string manipulation method, i.e. "foo/..".IO.parent -> "foo", "/tmp/hiea/../foo".IO.parent.parent -> "/tmp/hiea", etc. 21:29
Because if not, what method would fill this role?
ugexe .stupid-parent 21:30
nine If we had that, then yes :) But we don't, so there's just parent. If you want the smart parent, you do $path.add('..').resolve
Or rather ($path ~~ :d ?? $path.add($*SPEC.updir).resolve !! $path.parent) which...yes... but at least it's possible 21:32
Geth roast: patrickbkr++ created pull request #802:
Change .parent behavior to "stupid" resolving
21:37
rakudo: patrickbkr++ created pull request #4800:
Change parent to always just remove the last element
21:59