Skip to content

Direction

The direction of data is the direction of the references that a construct permits. Three shapes cover the languages that coeval serves.

The glyphs so far: 23, 3 new on this page
  • 42Data: a value without a type
  • number
    42
    A document: the tab is its type
  • number
    42
    A dashed tab: the container declares the type
  • add
    number
    1
    number
    2
    Parts: a card inside a card
  • 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
  • numbera
    3
    A name tag: a binding for later steps
  • ref
    namesa
    A reference: a path from a root of the context
  • A dashed blue arrow: from a reference back to the step with its name
  • if
    test
    bool
    true
    true
    then
    text
    “yes”
    “yes”
    else
    text
    “no”
    not evaluated
    “yes”
    Not evaluated: a part that its parent did not need
  • ▸log
    text
    “hi”
    “hi”
    “hi”
    The run side: a magenta edge, and an effect
  • 1log“hi”An effect: a numbered ticket in the world
  • logA capability: an effect that a term can cause
  • selfnamesThe five roots of a context: each path starts at one
  • ref
    self
    nearest
    type“panel”
    width
    A computed step: a document with its own kind
  • A solid slate arrow: one move of a path, with the text of its step
  • collapseA dashed rung: the walk follows a reference to its target (collapse)
  • An orange solid arrow: data and the box go down a treenew
  • A teal dotted arrow: a size or an event goes up a treenew
  • A fuchsia dashed arrow: a reference goes sideways, to another branchnew
seq
  1. 1
    adda
    number
    1
    1
    number
    2
    2
    3
  2. 2
    multiplyb
    ref
    namesa
    3
    number
    10
    10
    30
  3. 3
    ▸log
    ref
    namesb
    30
    30
  4. 4
    addc
    ref
    namesa
    3
    ref
    namesb
    30
    33
33

What step 4 can name

It can name a, b. No named step comes after it.

Select a step. Each dashed arrow goes back from a reference to the step that gives its name.

In a sequence, a step reads back. It can name each earlier step, and it cannot name a later step.

A step of a sequence can name each earlier step. It cannot name a later step. This is the scope of let*: each binding sees the bindings before it.

A formula over a structure reads by position. It starts at a focus and moves: to the parent, to the children, or to the nearest node of a kind. A spreadsheet reads cells in the same way. The diagram builds the tree as documents, and the kernel resolves each path from self. The kernel has no step for all of the siblings, the ancestors or the descendants yet.

In a tree of components, data and the box of a parent go down. The size of a child and its events go up. A reference goes sideways, to another branch. The theory of attribute grammars names these inherited, synthesized and reference attributes.

In coeval, a node of a tree (panel or box) is a decorated tree. Each field of a node is an attribute:

  • The structure comes first. The parent, the children and the siblings exist before any attribute evaluates.
  • An attribute evaluates when something reads it, one time in each evaluation. A memo keeps its result.
  • A child reads its parent with ["self", "parent", "width"], and a sibling with ["self", "parent", "children", 0, "width"].
  • An attribute that reads itself, also through other attributes, gives #CYCLE!. The reason gives the chain of attributes.
  • A failed attribute keeps its own error. A reference to it gives the same code, reason and place.
  • An attribute causes no effect, because the order of the reads is not the order of the document.

Select a tree. The model evaluates it, and the diagram numbers each attribute in the order of its evaluation.

Tree
panelbox, the child 01width3003002heightchildren[0].height + 20604widthparent.width − 202803height4040

The attribute width of box at [children, 0]

{
  "type": "add",
  "value": [
    {
      "type": "ref",
      "value": ["self", "parent", "width"]
    },
    -20
  ]
}

It evaluated as number 4, one time.

280
The root gives the JSON of the tree: {"width":300,"height":60,"children":[{"width":280,"height":40}]}
A number is the order of evaluation. An arrow goes from an attribute to the attribute that reads it. Red marks an error value and the chain of a cycle. The width goes down: the box reads the width of its parent. The height goes up: the panel reads the height of its child. The height of the box evaluates before its width, because the panel asks for it first.

A name is also a position. A variable is a path up the program to the place of its binding. The previous step is a path to the sibling before. Thus one grammar of paths can name all three shapes. A path is a list of moves from the place of the reference.