Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- “Assuming that `get` exists, and has ‘nothingness-result’ implementation (i.e. it never re-stages
- the caller if it has no result.)”
- {
- getter <- {
- association <- infrastructure unaffix() (infrastructure execution get.locals() ())
- callee <- infrastructure branch() (infrastructure get)
- “First off, we have ownership from the outer caller on the association. We’re going to
- transfer that to the callee that may return nothingness.”
- infrastructure own() (callee) (association)
- “Now we create an empty list, and try to get a member of that list that doesn’t exist.”
- a.list <- infrastructure empty create()
- return.value <- callee() (a.list) (1)
- “We will only be called-back by the callee *if* it has a result; no return value represents a
- nothingness-result. If we have a result from the callee, we set it on the
- variable-association we share with the outer-caller.”
- infrastructure set() (association) (2) (return.value)
- “FIXME: If the callee re-stages the getter, and then immediately terminates, the ownership
- will *leak* to the outer caller! This is because the outer caller is in the queue *before*
- the re-staging of the getter, which will allow it to grab ownership first.”
- “Finally, we never do anything else with the ownership on the association, as our own
- realization-to-completion will ensure we throw away that ownership, and the same applies to
- our callee.”
- }
- “Create a new association, storing a default value; then inject that association into the
- getter’s namespace such that the variable is shared with our namespace (psuedo-scoping.)
- Immediately after storing the value, we pop it off of our scope (storing the association itself
- in a new association — ‘storing the variable in a variable’), and then push it back onto our
- scope *and* the getter’s scope.”
- result <- “default value”
- association <- infrastructure unaffix() (infrastructure execution get.locals() ())
- infrastructure affix() (infrastructure execution get.locals() () ) (association)
- infrastructure affix() (infrastructure execution get.locals() (getter)) (association)
- “We own the variable (to give us the rights to give it away,) then share our ownership with the
- getter, finally disowning it ourselves (to ensure we have contention against the getter until it
- implicitly gives up the variable) before staging the getter. This leaves us running (as we used
- an explicit stage, instead of the call-pattern staging,) and then we immediately contend that
- variable again.”
- infrastructure execution own() () (association)
- infrastructure execution own() (getter) (association)
- infrastructure execution disown() () (association)
- infrastructure execution stage() (getter) ;“First time we actually stage the getter.”
- infrastructure execution own() () (association)
- debuggingPrint() (result)
- }
Add Comment
Please, Sign In to add comment