Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define the look-up process for oFrugal binding resolution #61

Open
orcmid opened this issue Jul 30, 2022 · 1 comment
Open

Define the look-up process for oFrugal binding resolution #61

orcmid opened this issue Jul 30, 2022 · 1 comment
Assignees
Labels
documentation related to or providing documentation task An effort that needs to be identified and then carried out, staged as needed

Comments

@orcmid
Copy link
Owner

orcmid commented Jul 30, 2022

There needs to be a function for

  1. Inserting the bound ob for a binding name into a binding data structure (a list)

  2. 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.

@orcmid orcmid added task An effort that needs to be identified and then carried out, staged as needed documentation related to or providing documentation labels Jul 30, 2022
@orcmid orcmid self-assigned this Jul 30, 2022
@orcmid
Copy link
Owner Author

orcmid commented Jul 30, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation related to or providing documentation task An effort that needs to be identified and then carried out, staged as needed
Development

No branches or pull requests

1 participant