-
Notifications
You must be signed in to change notification settings - Fork 1
Kluge: Path notation: little endian C\B\A or C=:B=:A, versus big endian A:=B:=C
We are all used to UNIX style path notations A/B/C, e.g. grandparent/parent/child. I call this a big endian path notation.
I like putting some fraction of my path in places like my Emacs mode line, or in my shell prompt. Usually truncated so that it isn't too long. So, it might look like ~/lib or .../foo/lib.
Eventually I figured out that this often put the stuff that I was most interested in, the leaf name, and an indeterminate position. Even if I highlighted it it could be hard to find.
So I therefore started inverting things. Instead of big endian A/B/C grandparent/parent/child I started writing things in little endian notation, with the leaf first C\B\A child\parent\grandparent.
Note that I use backslash \ as the path separator for little endian paths, because it looks like the opposite to the slash / separator for big endian path.
Unfortunately, using backslash \ as a path separator creates problems related to C syntax escape characters. Well nothing is perfect.
Some systems use > as a path separator. E.g. A > B > C, grandparent > parent > child. E.g. Microsoft, typically when there discussing GUI dialogues. As far as I know MS does not use this in their file system
Once again
- big endian: A > B > C, grandparent > parent > child
- little endian: C < B < A, child < parent < grandparent
At least > and < are not escape characters in C strings. Although unfortunately they're not accepted or handled klugily by many wikis.
E.g. the GitHub wiki does not allow slashes / in page names. It just converts them into blanks, or rather -s. You lose if you want a page name to have a slash in it, like 1/2. The GitHub wiki even deletes that from the page title, although most wikis like Confluence are smart enough to delete the unsafe characters in the URL encoding, but to provide the funky characters in the title somehow.
When /\ or <> are not accepted, I sometimes resort to kludges like := and =:.
As in A:=B:=C or C=:B=:A. Some other sort of directionality
:- / -: Do not survive the GitHub wiki
Patterns using parentheses to form "blunt arrows" looked too much like Smiley's A =) B =) C or C (= B (= A.
===
Anyway, when you start using big versus little endian paths, the possibility of mixing the two arises
Q: what does A/B\C mean? I.e. what are the binding strengths and associativity of these path separator operators? Should it be (A/B)/C => C/A/B or A/(B\C) => A/C/B. Punt! I will consider this in error until further notice, I until I figure out a pleasant way that does not surprise me.