Wednesday, January 2, 2019

Persistence in console loop

Syntax engines like persistent objects, Default handles this by keeping the source code in buffer until cntrl c exits the syntax. It makes no attempt to move source code symbols, string and integer constants remain as pointers to source.

But, Console is currently keep fixed size buffers (a lab technique) ans this will change. Soright now, Default has a built in maximum source length, and I had n plans to exceed that anyway.  Default, about a minimal as one can get and still do recursive loops.

But, when theuser exits syntax mode, then is the source erased?No, the symbol tables remain accurate, pointing to the proper macros and variables in source. So the console loop preserves objects y preserving source, and its ability to repair syntax errors is nill. The syntax engine will likely need its own error recovery, at some point in the future; otherwise the persistent source code will cause repeated errors.

Logic flow, what is re-enrtent; all this changing a bit as I accommodate a flexible Default macro system, makinf it robust and follow a predictable rule.

It is the design philosophy, Default does only default things within its own memory space, just enough to set things up for another syntax engine. The management of source implies that Console loop will need configurable  settings telling it exactly what to do with source and args list. The default actions here will definitely not apply to all engines.

This also means multi-level aborts for the user, one abort keeps the source but exits the engine, all symbols work. The other abort clears source and deletes symbols, a more complete exit.  Syntax engines need to tell console loop how to handle aborts.

Not handling this correctly is why my macros had inconsistent behavior.  A lot of my discoveries are about the hand off between syntax and command line and dealing with tokenizer induced spaghetti. But that is more important than making Default completely functional.

Tokenizer strings, identification of charater markers to make tokens will change if syntax want to..  I am going to set aside space on args list, the list of special character strings will be there, just set the pointers is fine.  The new syntax engine isd in console loop memory space, the args list is universal, use it for configuration, include a control code for console loop. 

No comments: