Won’t it be useful to always append trailing slashes to paths for all core path functions? We then would see at first glance if a path leads to a directory or a file. When you see for example
~/config, you can’t tell if this is a file or a directory – the implementation of this convention would clarify this.
Some additional thoughts:
Currently we have both, as
normpath(@__FILE__, "..")shows a trailing slash, whereas
@__DIR__) show no trailing slash. This could be unified.
dir * "/" * filewould then expand to
"<DIR>//<FILE>". That doubled slash makes no difference, which makes this backwards-compatible.
It should be better for Windows compatibility, as I assume
dir * "/" * filewouldn’t work there, whereas
dir * file(with trailing slash convention) should do the trick, as this should automatically use a backslash.
dir * "/" * "var"could expand to
diris empty – which could have negative impact on system roots.