Saturday, December 29, 2018

Then the prior discussion leads too...

A slight simplification of tokenizer.

The new rue is that a file name is recognized by a ./ or / with no left operand. Tokenizer then just flushes the filename to a token of its own, like a quote., but with a hidden char for an operator., or a doble like the ++ and <<. Someway to identify a selector function for later evaluation.  But I like the double slash:

// home /filename;  // works exactly like the other doubles in token terms

This form is great because the selector identified easily captured and held uniquely.  If I just picked the double slash right now, it removes about five lines of code, simply because all the rest, escaping and configuration, re required anyway.

And as a bonus, the double slash is recognized as top level by linux. So Default says, yes to any file name with the double forward slash. So I am going back to the original tokenizer, leave out escapes and configuration and just get file names through.

So, in the default cae, Default onlyaccepts the top level selector, it has no other methods, and the top level defaults to linux file directory.  This adds a few lines of code, I skip the rest and I am back to where I was, deferring the other work to later. And that is why I do the default.

So, three days wasted? No, the experiment resulted in a point of convergence, one way or the other // will have meaning. So why not just introduce the double ops,  and move on. Three days to discover the default selector syntax? Well worth it, Default is unlikely to be incompatible.

The other forms of selector would be ./ and ../; and linux pros can be able to live with that.  Doing so makes file names a first class variable via the selector syntax.

Done, the double slash filename selector works in Default
// It is a first class operator. Works in LoadModule but later Default will define something for this besides pass thru. Escaping strings left out. The dash flag -f flag, left out, but that becomes a first class operator, maybe, dunno.

Load //home/so/xchars;   // don't bother with extensions.

I can load Xchars and run Default, at the same time! Double ops token work, though not implemented in Default.

No comments: