Names
A sequence evaluates its steps in their written order. A step with a name tag gives its result to the later steps under that name. A reference reads a name back. This is the scope of let*: each binding sees the bindings before it.
The glyphs so far: 11, 2 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 stepsnew3
- refA reference: a path from a root of the contextnewnamesa
Nothing started yet. Select Next or Play.
- 1addanumber1number2
- 2multiplybrefnamesanumber10
- 3▸logrefnamesb
The context grows
Section titled “The context grows”Select the steps one after the other, and look at the panel. Step 1 can read no name. Step 2 can read a. Step 3 can read a and b. The sequence makes the context larger after each named step. A reference to a later name gives #NAME?, because that name does not exist yet.
The evaluation of seq ends with the error #VALUE!: The value of ref is a path: a list that starts with a root, for example ["names", "a"].
- 1refno path#VALUE!
- 2numberlater1not evaluated
A name and a nesting are two forms of one thing
Section titled “A name and a nesting are two forms of one thing”A sequence with names is the same as nested bindings: let a = 1 + 2 in let b = a * 10 in log b. The sequence writes the nesting as a list, so that a person reads it from the top to the bottom.