🦋 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.
Geth doc: tbrowder++ created pull request #4103:
Add example of file path analysis
01:56
SmokeMachine Is there already a link for the Raku conference? 11:04
tbrowder g'day. visiting IO::Path again, it seems unfinished that IO::Path.parent has no terminator. that is to say that, for a real file $f with no more than 10 parents will give the same result with $f.IO.parent(100). 11:07
lizmat m: dd "/".IO.parent # hmmm.... 11:08
camelia IO::Path.new("/", :SPEC(IO::Spec::Unix), :CWD("/home/camelia"))
lizmat tbrowder: so you'd argue that should probably create a Failure ? 11:09
tbrowder or do something. i would like to see something like this to return the "top" parent IO::Path.parent(*) 11:11
and make IO::Path.parents return a number 11:12
of parents
Voldenet I agree with the .IO.parent point
giving "/" to a script is an edge case otherwise
tbrowder exactly 11:13
right now i have to test for "/" at every step
Voldenet right now my scripts don't even support that properly, because I know to not run them in root 11:14
which isn't exactly elegant convention
tbrowder anyhow, i know lizmat, coke, and vrurg can come up with an elegant solution 11:15
what time is raku conf kickoff? 11:17
lizmat 15:00 UTC 11:41
tbrowder: if you log in on conf.raku.org and set your timezone correctly in your personal settings, it should produce conf.raku.org/2022/schedule with your times 11:43
Voldenet m: role Assignable[::T] { method COERCE(T $t){ $t but Assignable[T] } }; my Assignable[Int]() $ = 42; 12:03
camelia Impossible coercion from 'Int' into 'Assignable[Int]': method COERCE returned an instance of Int+{Assignable[T]}
in block <unit> at <tmp> line 1
Voldenet m: role Assignable[::T] { my \T2 = T; method COERCE(T $t){ $t but Assignable[T2] } }; my Assignable[Int]() $ = 42; 12:08
camelia ( no output )
lizmat tbrowder: the problem with IO::Path.top is that on Windows, there is not a single top 12:15
C:\ and D:\ would both be top, no ?
I'd rather see a method "is-top" on an IO::Path that would return a Bool indicating there's no more parents 12:16
Nemokosch +1 for a link for the conference... 12:24
Voldenet I'm not sure if uniform path handling is going to ever work well on windows 12:25
for example `raku -e $*CWD.IO.dir.say` on windows can fail easily
tbrowder lizmat: that would work for me 12:26
Voldenet which happens when $*CWD is unc path 12:27
on win2003 \\?… is correct unc path, on vista+ it isn't
tbrowder well Windows people should pick a better OS! ;-D 12:28
Voldenet I wish windows was more unix like, eh
tbrowder you bet! 12:29
lizmat: how about the IO::Path.parents method retuning number of parents (counting is-top)? 12:31
Voldenet imo msys2 does the right thing: /c/whatever becomes `c:\whatever` and `//whatever/test` becomes `\\whatever\test` 12:33
lizmat so that $io.parents.tail would give yu top ?
Voldenet imo .parents.tail should return '/' on unix and 'drive:' or '\\servername' 12:45
lizmat not drive:\ ? 12:46
I thought drive: implied current directory on that drive Voldenet ? 12:47
Voldenet you can do `dir c:`
it's somehow weirder for UNC paths 12:49
because in most tools \\servername is not a proper root
you can't `ls \\server`, `ls \\server\path` is valid 12:50
tbrowder if we’re looking at a parent dir, what about getting children? (without File::Find)?
Voldenet .dir(:recursive)? 12:52
tbrowder sorry just first generation :~) 12:53
Voldenet continuing the above, on msys2 bash I can just `ls //server`, which is totally weird, but consistent 12:54
tbrowder or specify depth of search
file child vs dir child 12:55
Voldenet (in powershell you need `net view \\server` which is a few more layers of weird)
tbrowder hm, looking like good parts of File::Find! 12:56
one of my fav modules 12:59
Voldenet I've thought about it and drive:\ is more sane 13:12
Voldenet either way, probably more difficult issue is properly handling unc paths, because there's no good default on whether "\\whatever\" should be included as top parent or not 13:30
[Coke] "on vista+ it isn't" - do we need to be supporting vista with even code examples at this point? 14:33
Voldenet I'm not sure what is supported when you run raku in compatibility mode on windows, but probably not 14:38
(vista+ is the current state though)
(win2003 is still in use, but unsupported) 14:39
[Coke] sorry, how to run raku in compatibility mode? 14:43
I am just... running it.
ah. You can manually choose to run something in compatibility mode - but why would you do that? 14:44
Nemokosch it only goes to Vista anyway
[Coke] That sounds like a DIHWIDT.
Nemokosch on Windows 10
Voldenet either way, I have not seen \\?-style paths in a while 14:48
[Coke] +1 14:52
(Something that could be part of the documentation, supported versions of windows when looking at OS-specific methods) 14:53
s/methods/classes/
[Coke] Can we get a ticket on the backlog to stop installing "perl6" executables? 14:54
ls
... dammit. :)
Voldenet I've checked and .net doesn't support that 14:55
lizmat The 2nd Raku Conference has started! conf.raku.org 15:02
Voldenet til perl6 is not a symlink to raku 15:04
ugexe \\? style paths are used internally at the libuv level 15:34
which allows long paths to be used 15:35
also libuv only supports >= windows 8 15:45
ingy microsoft.github.io/language-serve...ification/ lists `perl6` 17:26
someone should PR that
lizmat where would that need to be PRed ? 17:27
ingy My guess would be add `language-server-protocol/specifications` to github.com :) 17:28
bad guess :) 17:29
github.com/microsoft/language-server-protocol
github.com/microsoft/language-serv...ch?q=perl6
lizmat thanks 17:30
ingy domains like lizmat.github.io/foo are gh-pages web pages for lizmat/foo repo (as I'm sure you figured out) 17:33
lizmat if you set that up, right ?
ingy yep
github.com/lizmat/App-Rak/settings/pages 17:34
lizmat lizmat.github.io/App-Rak/ # ingy++ 18:09
El_Che (been so busy it didn't even register in my mind there was a conf atm) 18:35
who's the one speaking?
atm
lizmat japhb
El_Che I don't think we've talked irl, hence I didn't recognize the voice :)
lizmat www.youtube.com/watch?v=VoxWnNJ0gTI
El_Che that one has scrollback 18:36
nice!
El_Che lizmat: maybe something for the topic? 18:44
lizmat 🦋 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!
lizmat Raku Conference Day 1 on Youtube: www.youtube.com/watch?v=VoxWnNJ0gTI 🦋 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! 19:34
SmokeMachine Hi people! Sorry for not being there for answer questions… was there any question? 21:34
SmokeMachine Is there a way to get the chat? 22:11
jast check the topic 22:30
SmokeMachine I mean the conference’s zoom’s chat 22:32
ingy lizmat++ Wow! Nice looking site: lizmat.github.io/App-Rak/ 23:01
lizmat: fyi using your own domain name there is easy peasy if you want. I use gh-pages for almost all my sites. 23:04
lizmat ingy: will look at that tomorrow... first some shuteye& and thanks again for the nudge
ingy sure, but it wasn't even a nudge. :) 23:05