Saturday, February 26, 2000
Tumblers tumbling
I'm updating my code on tumblers. Tumblers are a crucial portion of Xanadu, the hypertext system designed by Ted Nelson and still being worked on (only 40 years later).
My tumblers work differently than the Xanalogical mode. There they are true numbers on which certain operations like addition and subtraction can be applied to address nodes (and all the nodes contained therein) whereas mine are not numerical at at and the operations that are performed on them do not have mathematical relationships. At least not in the Xanalogical sense.
Both systems (mine and Ted's) do allow ranges to be specified, but the mechanics differ. I'm not going to go into how Xanalogical tumblers work since that's described elsewhere. But I am going to describe what I'm working on.
Basically, my tumblers (for lack of a better term, that's why I'm using it
currently) is just a list of node identifiers, with those listed first
higher up than those below it, much like USENET
groups. You have
comp
that contain all the computer related discussion groups, and
below that you have comp.lang,
which contain all the articles
pertaining to computer languages to finally having comp.lang.forth,
dealing with a
particular computer language. And you are not limited to just the period
for separating nodes—I also use slash and colon (for several reasons I
won't get into right now).
But another aspect is describing ranges. A range specifier consists of left and right sides separated by a dash. The left side specifies the starting node, while the right side specifies the ending node, relative to the starting node. So that:
A.b.1-3
would specify the nodes A.b.1, A.b.2
and A.b.3
. Notice
that there are three node segments on the left side and only one on the
right. That's important. The missing segments on the right side are
inherited from the left. This inheritance only takes place if the right
side has fewer segments than the left side. If the right side is longer
than the left, it is assumed that the right side is a full specifier, like
the left side is.
And so far, the code I have in mod_litbook handles those cases (dealing with the King James Bible for now). What it doesn't handle are separate but related ranges.
For instance,
A.b.1,5
The interpretation I use would return nodes A.b.1
and
A.b.5
but nothing else in between. In this case, the comma is used
to specify to independant nodes, but with the same relationship rules used
in ranges. So far so good, but I want to be able to handle something like:
1.2.3,4,1.5.3-5,3.8-4.1,1.2.3.4,6,9
Which is a complex specification for:
1.2.3 1.2.4 1.5.3 through 1.5.5 1.3.8 through 1.4.1 1.2.3.4 1.2.3.6 1.2.3.9
I'm close to getting the parsing done.