Thursday, January 24, 2019

Namespace is a language, a command line language

It has a left to right ordering from general to specific. I can do call structures, consider:

bind stacks keyval key val;

Key val means value at the pointed key.  That should work the same as:

bind stacks val;

Where val is known.

The various handlers of commons can determine the argument ordering and restructure args list as the sequence unfolds. So the syntax has call structure, macro expansion, named variables, simple expressions, and only the six most commonly accepted punctuation forms. Otherwise, this is a functional language, Turing complete, self contained variable definitions. It is driven by the commons, a sort of specialized and flexible assembly code. The commons is designed to evolve. Front end symbol table, variable typedefing and 64 bits make it happen.
Enterprise managers with their python engines compile the company semantics and load symbol tables everywhere. They like the commons, great idea they say.

Rules on args transforms

Same rule, general to specific. So it the command call type specified two arguments on output, count from the end point backwards and pick off the two args, move them up to replace the command. This is like adjusting the stack back after call. Zero arguments, leave args alone, this is default or full duplex.  The built ins can have a arg count in the symbol table, part of their type classification.

But we do not want to pollute the syntax with special ' call set up and pointer' forms, the preferred method is to mke the built in you want, or make a macro expansion that is specialized, somehow. Make a particular macro definition that has a argument count variable always, and macros of this type knows how to handle that arg on return. That means adding arguments to macro expansion:

macro(); this is what I do, nothingmore

But if we have call structure, then we have stuff inside the parenthesis. And that means the command format gets ties to a specific syntax engine, and due to simplicity, that engine becomes default.

There is a compromise.  Provide a key built in that is optional in macro expansion, but it defines the output format on return. The format specifier is good until the bracket end, and it reverts.  But the operator will be in most macro expansions an requires and extra step.  Simple to do., and such a built in is still a functional language component. If anything, I would like to remove the parenthesis on the while loop, dump that punctuation entirely.

While var < 1 var = var + 1 stacks pop mystack myresult;

This is a good, functional form, obeys left to right, has namespace. At the end of the sequence, myresult, as a symbol entry, has the def field filled by the while loop expression macro.  We eliminate the two step process while(){}. pop is a common form, it obeys argument hierarchy.

The simplest method:
ll arguments are kept until the new line, or until the semi colon.. So any snippet is, by default, operating in full dulex mode, the args list retains the original structure.  The snipes, then, have the responsibility of looking at sequence. A destination snippet that needs value has to understand keyvaue,whether it is there or not. I keep the simple method for now.

No comments: