urbit/pub/docs/dev/hoon/runes/cl.md
Galen Wolfe-Pauly bb495844be doc -> docs
2015-10-20 10:51:45 -07:00

953 B

col : %col

Tuples

The : runes construct tuples.

There is no natural : rune. Instead, all of them derive from the autocons property of ++twig, as show below.

++  twig  $&  [p=twig q=twig]

Namely, a cell of two twigs is a twig producing a cell of the results of the two original sub-twigs.

The : runes produce one of three categories of tuples

Tuples of determinate size:

:- Tuples of two elements, p and q. :_ Tuples of two reversed elements, q and p. Used to ensure vertical code flow.\

:+ Tuples of three elements p, q, and r. :^ Tuples of four elements p, q, r, and s.


Tuples of indeterminate size:

:* Tuples of n elements. :~ Null-terminated tuples of n elements.

Tuples used for interpolation:

:/ Tuple designed to be interpolated into an XML structure.