Cell Distribution Rule#
Syntax#
*[a [b c] d] [*[a b c] *[a d]]
Explanation#
When a formula’s head is a cell (not an atom/opcode), Nock treats both parts as separate formulas and returns a cell of their results.
If the formula is
[[b c] d]where[b c]is a cell.Evaluate
[b c]as a formula to produce a resultA.Evaluate
das a formula to produce a resultB.Return the cell
[A B].
This is equivalent to Lisp’s cons as an implicit operation. It’s recognizable by cell-headed formulas slots.
:subject 42
Subject set to: 42
Evaluate with two constants:
[[1 10] [1 20]]
[10 20]
Pair a slot and an increment:
[[0 1] [4 0 1]]
[42 43]
A more complex nested distribution:
[[[0 1] [0 1]] [4 0 1]]
[[42 42] 43]