3 title/'Irregular forms'
7## Irregular forms, a compilation
13*Original Fora post* [here](https://urbit.org/fora/posts/~2016.12.29..19.37.08..89d5~/).
17Headings contain runes, phonetics and tokens. Description contains a link to the docs and a short description of the rune. Both regular (R) and irregular (I) forms are given.
19Want to `Ctrl-f` to find out the meaning of something weird you saw? Search for `\symbol`. ie `\?` or `\=`. It'll show you to the irregular forms that uses that symbol.
23Anything Nock can do, Hoon can do also.
27[docs](../rune/dot/lus/) \\+
28`[%dtls p=atom]`: increment an atom with Nock 4.
35[docs](../rune/dot/tis/) \\=
36`[%dtls p=hoon q=hoon]`: test for equality with Nock 5.
43Miscellaneous useful macros.
47[docs](../rune/mic/col/) \\:
48`[%smcl p=hoon q=(list hoon)]`: call a binary function as an n-ary function.
59[docs](../rune/col/hep/) \\[\\]\\^\\+\\\`\\~
60`[%clhp p=hoon q=hoon]`: construct a cell (2-tuple).
77Flow hoons change the subject. All non-flow hoons (except cores) pass the subject down unchanged.
81[docs](../rune/tis/gal/) \\:
82`[%tsgl p=hoon q=hoon]`: compose two hoons, inverted.
89[docs](../rune/bar/) \\$
90Core hoons are flow hoon.
92Technically not irregular syntax, but worth mentioning.
99The above runes produce a core with a single arm, named `$` ("buc"). We can recompute this arm with changes, useful for recursion among other things. Commonly used with the irregular syntax for `%=`, `:make`, like so: `$()`.
103The invocation family of runes.
107[docs](../rune/cen/tis/) \\(\\)
108`[%cnts p=wing q=(list (pair wing hoon))]`: take a wing with changes.
115[docs](../rune/cen/sig/) \\~
116`[%cnsg p=wing q=hoon r=hoon]`: call with multi-armed door.
123[docs](../rune/cen/hep/) \\(\\)
124`[%cnhp p=hoon q=hoon]`: call a gate (function).
129Note: `(p)` becomes `$:p` (`=<($ p)`), which behaves as you would expect (func call w/o args).
133A mold is a gate (function) that helps us build simple and rigorous data structures.
137[docs](../rune/buc/wut/) \\?
138`[%bcwt p=(list model)]`: mold which normalizes a general union.
145[docs](../rune/buc/cab/) \\_
146`[%bccb p=value]`: mold which normalizes to an example.
153Hoon has the usual branches and logical tests.
157[docs](../rune/wut/zap/) \\!
158`[%wtzp p=hoon]`: logical not.
165[docs](../rune/wut/pam/) \\&
166`[%wtpm p=(list hoon)]`: logical and.
173[docs](../rune/wut/bar/) \\|
174`[%wtbr p=(list hoon)]`: logical or.
181Lets us adjust types without violating type constraints.
185[docs](../rune/ket/hep/) \\\`
186`[%kthp p=model q=value]`: typecast by mold.
193[docs](../rune/ket/tis/) \\=
194`[%ktts p=toga q=value]`: name a value.
218- `%a` constant `a`, where `a` can be an ((ir)regularly defined) atom or a symbol.
220See [%sand](../rune/constant/warm) for other irregular definitions of atoms.
224- `&n` nth element of a list.
225- `|n` tail of list after nth element (i.e. n is the head).
229[docs](../rune/limb/limb/) \\+\\.\\^
230`[%limb p=(each @ud [p=@ud q=@tas])]`: attribute of subject.
233- `.` is the whole subject (slot 1)
234- `^a` is the `a` "of a higher scope", i.e. "resolve variable a, ignoring the first one found".
235- `^^p` even higher, etc.
236- 'Lark' syntax for slots / tree addressing:
252[docs](../rune/limb/wing/)
253`[%wing p=(list limb)]`; a limb search path.
254`a.b` finds limb `a` within limb `b` ("var" `a` within "var" `b`).
258- `<a b c>` prints a [tape](../library/2q/#-tape).
259- `>a b c<` prints a [tank](../library/2q/#-tank).
263In our in-house examples throughout our documentation, we use irregular forms instead of regular for the sake of verbosity. But remember with irregular forms: everything is just runes! Like magic. In general, irregular forms (usually) read better, but of course regular forms provide more information about what you're doing by showing you the full rune. Of course, it's up to you, the Hoon programmer, as to whether or not you want to use these.
265##### If we missed any, or if you saw something weird that's not in here, feel free to comment below!
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list