Tako Schotanus

Results 614 comments of Tako Schotanus

Option 4: `Path.parent` should either return `Path?` or have some other way to detect that there is no parent path. Going for options 1 and 3 will make detecting that...

Yes @lucaswerkmeister , but that's _you_ specifically asking for a mapping of that path to your current file system, you can't use that to deal with just any path you...

Option 3 could perhaps be handled using the following rules: 1. path is "." or ends with "/." -> add "." 2. path is ".." or ends with "/.." ->...

> append .., then normalize Well, the thing is that if someone passes `foo/bar/../baz/one/two` and calls `.parent` on it I'd expect it to return `foo/bar/../baz/one` and not `foo/baz/one`. Otherwise you...

Oh and the stop condition isn't good enough because it doesn't deal with the root path, so you'd still need to test for `path != root`. So maybe a property...

> Perhaps the logic for normalizing a single “transition” could be shared… Well remember that the condition probably has to return true as well for someone who explicitly passes a...

Btw IMO Java handles this badly, asking for the parent of a path like `foo/bar/.` gives you `foo/bar` (the same for `foo/bar/..`. It seems they literally just hack off the...

Yes, you can't call it `parent` if what you really do is `removeLastPart` ;) And if you type `cd ./..` in Linux or `cd .\..` in Windows it does exactly...

See my "motto" :laughing: But seriously I'd just leave it alone, who knows what kind of reason someone had to pass that specific path. If it's because they have dirty...

Be careful though, `Iterable`s are not "stable", it's not guaranteed that repeated iterations over their content return the same result. Turning them into a sequence might give you access to...