Context
A term is not alone. A formula reads its parent, a step reads an earlier step, and a handler reads its event. Each of these reads goes through one door, the context. A context has five parts.
The glyphs so far: 15, 3 new on this page
- 42Data: a value without a type
- numberA document: the tab is its type42
- numberA dashed tab: the container declares the type42
- addParts: a card inside a cardnumber1number2
- kindA kind: a document of type kind
- OKDA rung: own, kind or default
- 3A port: the result of a document
- 0A sealed part: an evaluator cannot read it
- #NAME?An error value, in a red port
- numberaA name tag: a binding for later steps3
- refA reference: a path from a root of the contextnamesa
- ifNot evaluated: a part that its parent did not need“yes”testbooltruetruethentext“yes”“yes”elsetext“no”not evaluated
- ▸logThe run side: a magenta edge, and an effectnew“hi”text“hi”“hi”
- 1log“hi”An effect: a numbered ticket in the worldnew
- logA capability: an effect that a term can causenew
| Part | What a reference through it reaches |
|---|---|
| Names | A value that a binding gives: a let, a parameter or the result of an earlier step |
| Focus | A position in a structure: the node itself, its parent, its children or its siblings |
| World | A stored document or collection, by an absolute ID or by a query |
| Event | The trigger of a run, and its values |
| Capabilities | The effects that the term can cause |
The languages differ here
Section titled “The languages differ here”Most declarative languages have the same core: a literal, a reference, a call, a binding, a condition and a loop. They differ in the context. Select a construct to see how it uses each part.
run: effects in order A list of steps. A step can read the result of each earlier step by its name.
{
"type": "seq",
"value": [
{
"type": "store.find",
"value": {
"match": { "board": "b1" }
},
"name": "cards"
},
{
"type": "store.patch",
"value": {
"ids": {
"type": "ref",
"value": "cards.ids"
},
"set": { "done": true }
}
}
]
}All six constructs. Select a row to see it above.
| Construct | Side | Names | Focus | World | Event | Capabilities |
|---|---|---|---|---|---|---|
| Formula | derive | reads, gives more names | reads, gives new position | not used | not used | not used |
| Sequence | run | reads, gives more names | not used | reads, gives same | passes, gives same | reads, gives smaller |
| Tree node | derive | reads, gives more names | reads, gives new position | reads, gives same | not used | not used |
| Layout rule | derive | reads, gives nothing | reads, gives nothing | not used | not used | not used |
| Event handler | run | reads, gives same | reads, gives same | reads, gives same | reads, gives new value | reads, gives smaller |
| Query | derive | reads, gives nothing | not used | reads, gives nothing | not used | not used |
What a construct gives its body
Section titled “What a construct gives its body”Each construct reads some parts, and it gives the parts of its body a context. It can give the same value, more names, a new position, a smaller set of capabilities or a new value. A pure construct gives its body no capability. A run gives its body the same capabilities or fewer, and not more at any time.