Runes Flashcards
.+
Increment an atom.
e.g. .+(1) produces 2
.=
Test for equality. If equal, produces %.y; otherwise %.n.
e.g. .=(1 1) produces %.y
.?
Test for cell or atom. Produces %.y if p is a cell; otherwise %.n.
?>
Positive assertion. If p = q then return %.y; otherwise force crash.
?:
Branch on a boolean test. If p produces yes, %.y, then q. If p produces no, %.n, then r.
?.
Branch on a boolean test, inverted. For when yes-case is much taller / wider than the no-case; aesthetic.
?[gal]
Negative assertion. If %.y, force crash.
?&
Boolean AND.
?=
Test type. Returns %.y or %.n.
?!
Boolean NOT
|=
Create a gate (aka a function)
e.g. |= end=@
Creates function, specifying it takes one argument, which we named “end”, and “@” specifies the input is an atom.
=/
Store a value with a name and a specified type
e.g. =/ count=@ 1
count=@ (the first child) stores 1 (the second child) as count and specifies that it has the @ type
This is as close as you’ll get to a variable
|-
Produce a trap (a core with one arm $) and evaluate it. Can be thought of as a ‘recursion point’ or a ‘loop starting point’.
^-
Use in a gate to constrain output to a certain type
e.g. ^- (list @)
Specifies that our gate’s output must be (list @) — that is, a list of atoms
:-
Create a cell.