Open orcmid opened 2 years ago
The basic function is this, there may be different lists, such as one for primitives and one for plain lindies.
The entries in the list are pairs where the b-path is the text of a string and the a-path is the value. The list of entries bottoms out on a singleton, usually NIL.
We draw the lists as [value::string, value::string, ..., value::string] and we assume a string-equality check.
The basic search is
let binding(s, List)
= if is-singleton(List)
then mklindy( prefix("?", s) )
else if .b .a List = s)
then .a .a List
else binding(s, .b List);
the insertion of a binding onto the list is
let update(List, s, ob)
= (ob :: s) :: List;
there is no removal process. The most-recent for given s is the one that will be found.
There needs to be a function for
Inserting the bound ob for a binding name into a binding data structure (a list)
Checking to see if a binding name has a bound ob and returning that, returning a ?-prefixed lindy when there is no bound ob for that name.
The data structure is passed forward into subsequent oFrugal statements, so that all syntactically-valid oFrugal REPL always have a successful interpretation.