on cd23ade help sign in
782 lines 14 kB history raw
1+++
2title = "4o: Molds"
3weight = 42
4template = "doc.html"
5+++
7### `++abel`
9Biblical names in hoon are primarily aliases for the compiler.
11#### Source
13```hoon
14 ++ abel typo :: original sin: type
15```
17#### Examples
19```
20 > *abel
21 %void
22```
25---
26### `++aura`
28'type' of atom
30By convention, a short name for a category of atom. `++aura` is
31circularly defined, with `@ta` being the `++aura` of the ASCII subset
32commonly used in urbit.
34#### Source
36```hoon
37 ++ aura ,@ta :: atom format
38```
40#### Examples
42See also: `++base`, aura reference
44```
45 > `aura`%ux
46 ~.ux
47```
50---
51### `++axis`
53Nock axis
55A Nock axis inside a noun. After the leading 1, in binary, a `1` signfies
56right and `0` left.
58#### Source
60```hoon
61 ++ axis ,@ :: tree address
62```
64#### Examples
66```
67 > *axis
68 0
70 > :: 0 is not actually a valid axis
71 > [[4 5] 6 7]
72 [[4 5] 6 7]
73 > `axis`0b110
74 6
75```
77---
79### `++base`
81Base type
83A base type that nouns are built from. A `++base` is either a noun, cell,
84boolean or null labelled with an aura.
86#### Source
88```hoon
89 ++ base ?([%atom p=aura] %noun %cell %bean %null) :: axils, @ * ^ ? ~
90```
92#### Examples
94```
95 > *base
96 %null
98 > (ream '=|(^ !!)')
99 [%tsbr p=[%axil p=%cell] q=[%zpzp ~]]
100 > :: p.p is a ++base
101 > (ream '=|(@t !!)')
102 [%tsbr p=[%axil p=[%atom p=~.t]] q=[%zpzp ~]]
103 > (ream '=|(? !!)')
104 [%tsbr p=[%axil p=%bean] q=[%zpzp ~]]
105```
107---
109### `++bean`
111Boolean
113`0`, `&`, or `%.y` are true, and `1`, `|`, and `%.n` are false.
115#### Source
117```hoon
118 ++ bean ,? :: 0=&=yes, 1=|=no
119```
121#### Examples
123```
124 > *bean
125 %.y
127 > `bean`&
128 %.y
129 > `bean`|
130 %.n
131```
134---
136### `++beer`
138Tape builder
140Used to build tapes internally.
142#### Source
144```hoon
145 ++ beer $|(@ [~ p=hoon]) :: simple embed
146```
148#### Examples
150```
151 > `beer`'as'
152 29.537
153 > `beer`[~ (ream 'lan')]
154 [~ p=[%cnzz p=~[%lan]]]
155```
157---
159### `++beet`
161XML interpolation cases
163Used internally.
165#### Source
167```hoon
168 ++ beet $| @ :: advanced embed
169 $% [%a p=hoon] :: take tape
170 [%b p=hoon] :: take manx
171 [%c p=hoon] :: take marl
172 [%d p=hoon] :: take $+(marl marl)
173 [%e p=hoon q=(list tuna)] :: element literal
174 == ::
175```
178---
179### `++chum`
181Jet hint information
183Jet hint information that must be present in the body of a `~/` or `~%`
184rune. A `++chum` can optionally contain a kelvin version, jet vendor,
185and `"{major}.{minor}"` version number.
187#### Source
189```hoon
190 ++ chum $? lef=term :: jet name
191 [std=term kel=@] :: kelvin version
192 [ven=term pro=term kel=@] :: vendor and product
193 [ven=term pro=term ver=@ kel=@] :: all of the above
194 == ::
195```
197#### Examples
199XX there's a ++chum in zuse that's politely causing this not to work
201```
202 > `chum`'hi'
203 lef=%hi
205 > (ream '~/(%lob.314 !!)')
206 [%sgfs p=[std=%lob kel=314] q=[%zpzp ~]]
207```
210---
212### `++coil`
214Tuple of core information
216Variance `p`, subject type `q`, and `q`: optional compiled nock, and arms. Used as an
217intermediate step within Section 2fB. Converted by `++core` to %core type.
219#### Source
221```hoon
222 ++ coil $: p=?(%gold %iron %lead %zinc) :: core type
223 q=type ::
224 r=[p=?(~ ^) q=(map term foot)] ::
225 == ::
226```
229---
230### `++foot`
232Cases of arms by variance model.
234`%ash` arms are `dry` and geometric.
236#### Source
238```hoon
239 ++ foot $% [%ash p=hoon] :: dry arm, geometric
240 [%elm p=hoon] :: wet arm, generic
241 [%oak ~] :: XX not used
242 [%yew p=(map term foot)] :: XX not used
243 == ::
244```
246#### Examples
248See also: `++ap`, `++ut`
250```
251 > *foot
252 [%yew p={}]
254 > (ream '|% ++ $ foo --')
255 [%brcn p={[p=%$ q=[%ash p=[%cnzz p=~[%foo]]]]}]
256 > +<+:(ream '|% ++ $ foo --')
257 t=~[%ash %cnzz %foo]
258 > (foot +<+:(ream '|% ++ $ foo --'))
259 [%ash p=[%cnzz p=~[%foo]]]
260 > (foot +<+:(ream '|% +- $ foo --'))
261 [%elm p=[%cnzz p=~[%foo]]]
262```
264---
266### `++limb`
268```hoon
269 ++ limb $|(term $%([%& p=axis] [%| p=@ud q=term])) ::
270```
272XX move to `++ut`
274Reference into subject by name/axis
276See also: section 2fC-2fD
278```hoon
279 > (ream '^^$')
280 [%cnzz p=~[[%.n p=2 q=%$]]]
281 > (limb &2:(ream '^^$'))
282 [%.n p=2 q=%$]
283 > (limb &2:(ream '^^^$'))
284 [%.n p=3 q=%$]
285```
288---
289### `++line`
291XX move to `++ut`
293#### Source
295```hoon
296 ++ line ,[p=[%leaf p=aura q=@] q=tile] :: %kelp case
297```
299#### Examples
301```
302 > (ream '$%([1 a] [%2 b])')
303 [ %bccm
304 p
305 [ %kelp
306 p
307 [ i=[p=[%leaf p=~.ud q=1] q=[%herb p=[%cnzz p=~[%a]]]]
308 t=~[[p=[%leaf p=~.ud q=2] q=[%herb p=[%cnzz p=~[%b]]]]]
309 ]
310 ]
311 ]
312 > &3:(ream '$%([1 a] [%2 b])')
313 p=[p=[%leaf p=%ud q=1] q=[%herb p=[%cnzz p=~[%a]]]]
314 > (line &3:(ream '$%([1 a] [%2 b])'))
315 [p=[%leaf p=~.ud q=1] q=[%herb p=[%cnzz p=~[%a]]]]
316```
318---
320### `++metl`
322```hoon
323 ++ metl ?(%gold %iron %zinc %lead) :: core variance
324```
326XX move to `++ut`
328See also: `++coil`
332---
334### `++nock`
336Virtual machine. See Nock.
339#### Source
341```hoon
342 ++ nock $& [p=nock q=nock] :: autocons
343 [%3 p=nock] :: cell test
344 [%4 p=nock] :: increment
345 [%5 p=nock q=nock] :: equality test
346 [%6 p=nock q=nock r=nock] :: if, then, else
347 [%7 p=nock q=nock] :: serial compose
348 [%8 p=nock q=nock] :: push onto subject
349 [%9 p=@ q=nock] :: select arm and fire
350 [%10 p=?(@ [p=@ q=nock]) q=nock] :: hint
351 [%11 p=nock] :: grab data from sky
352 == ::
353```
355#### Examples
357```
358 > !=([+(.) 20 -<])
359 [[4 0 1] [1 20] 0 4]
360 > (nock !=([+(.) 20]))
361 [p=[%4 p=[%0 p=1]] q=[%1 p=20]]
362```
365---
367### `++noun`
369```hoon
370 ++ noun ,* :: any noun
371```
373Used nowhere XX
375```
376 > `noun`~[1 2 3]
377 [1 2 3 0]
378```
381---
383### `++null`
385```hoon
386 ++ null ,~ :: null, nil, etc
387```
389Used nowhere XX
391```
392 > :type; *null
393 ~
394 %~
395```
398---
400### `++port`
402XX move to `++ut`
404Type and location of core-shaped thing? XX Compiler Internals
406#### Source
408```hoon
409 ++ port $: p=axis ::
410 $= q ::
411 $% [%& p=type] ::
412 [%| p=axis q=(list ,[p=type q=foot])] ::
413 == ::
414 == ::
415```
417#### Examples
419```
420 > *port
421 [p=0 q=[%.y p=%void]]
422```
425---
427### `++span`
429ASCII atom
431A restricted text atom for canonical atom syntaxes. The prefix is `~.`.
432There are no escape sequences except `~~`, which means `~`, and `~-`,
433which means `_`. `-` and `.` encode themselves. No other characters
434besides numbers and lowercase letters are permitted.
436#### Source
438```hoon
439 ++ span ,@ta :: text-atom (ASCII)
440```
443#### Examples
445```
446 > *span
447 ~.
449 > `@t`~.foo
450 'foo'
451 > `@t`~.foo.bar
452 'foo.bar'
453 > `@t`~.foo~~bar
454 'foo~bar'
455 > `@t`~.foo~-bar
456 'foo_bar'
457 > `@t`~.foo-bar
458 'foo-bar'
459```
462---
464### `++tiki`
466XX move to `++ut`
468#### Source
470```hoon
471 ++ tiki :: test case
472```
474#### Examples
476```
477A `++wing` or `++hoon`.
479 > (ream '=+ a=4 ?-(a @ ~)')
480 [ %tsls
481 p=[%ktts p=p=%a q=[%dtzy p=%ud q=4]]
482 q
483 [ %wthz
484 p=[%.y p=~ q=~[%a]]
485 q=~[[p=[%axil p=[%atom p=~.]] q=[%bczp p=%null]]]
486 ]
487 ]
488 > (ream '=+ a=4 ?-(4 @ ~)')
489 [ %tsls
490 p=[%ktts p=p=%a q=[%dtzy p=%ud q=4]]
491 q
492 [ %wthz
493 p=[%.n p=~ q=[%dtzy p=%ud q=4]]
494 q=~[[p=[%axil p=[%atom p=~.]] q=[%bczp p=%null]]]
495 ]
496 ]
497```
500---
502### `++toga`
504Tree of faces
506A face, or tree of faces. A `++toga` is applied to anything assigned
507using `^=`.
509XX move to `++ut` and rune doc (for \^= examples)
511#### Source
513```hoon
514 ++ toga :: face control
515 [2 p=toga q=toga] :: cell toga
516 == ::
517```
519#### Examples
521```
522 > a=1
523 a=1
524 > (ream 'a=1')
525 [%ktts p=p=%a q=[%dtzy p=%ud q=1]]
526 > [a b]=[1 2 3]
527 [a=1 b=[2 3]]
528 > (ream '[a b]=[1 2 3]')
529 [ %ktts
530 p=[%2 p=p=%a q=p=%b]
531 q=[%cltr p=~[[%dtzy p=%ud q=1] [%dtzy p=%ud q=2] [%dtzy p=%ud q=3]]]
532 ]
534 > [a ~]=[1 2 3]
535 [a=1 2 3]
536 > (ream '[a ~]=[1 2 3]')
537 [ %ktts
538 p=[%2 p=p=%a q=[%0 ~]]
539 q=[%cltr p=~[[%dtzy p=%ud q=1] [%dtzy p=%ud q=2] [%dtzy p=%ud q=3]]]
540 ]
541```
544---
546### `++tone`
548Intermediate Nock computation result
550Similar to `++toon`, but stack trace is not yet rendered.
552#### Source
554```hoon
555 ++ tone $% [%0 p=*] :: success
556```
558#### Examples
560```
561 > (mink [[20 21] 0 3] ,~)
562 [%0 p=21]
564 > (mink [[0] !=(.^(cy//=main/1))] ,~)
565 [%1 p=~[[31.075 1.685.027.454 1.852.399.981 49 0]]]
566 > (path [31.075 1.685.027.454 1.852.399.981 49 0])
567 /cy/~zod/main/1
569 > (mink [[1 2] !=(~|(%hi +(.)))] ,~)
570 [%2 p=~[[~.yelp 26.984]]]
571 > (mink [[1 2] !=(!:(+(.)))] ,~)
572 [ %2
573 p
574 ~[
575 [ ~.spot
576 [ [ 1.685.027.454
577 7.959.156
578 \/159.445.990.350.374.058.574.398.238.344.143.957.205.628.479.572.65\/
579 8.112.403.878.526
580 \/ \/
581 0
582 ]
583 [1 20]
584 1
585 24
586 ]
587 ]
588 ]
589 ]
590```
593---
595### `++tuna`
597XML template tree
599An XML template tree.
601#### Source
603```hoon
604 ++ tuna :: tagflow
605 [%d p=hoon] :: dynamic list
606 [%e p=hoon q=(list tuna)] :: element
607 [%f p=(list tuna)] :: subflow
608 == ::
609```
611#### Examples
613Leaf %a contains plain-text, %b an empty tag, %c a static list, %d a
614dynamic list, %e a full node element containing a hoon and a list of
615tuna, and %f is a empty node.
617See also: `++sail`
621---
623### `++tusk`
625List of expressions
627List of `++hoon`s. In `:*`, for example, your contents is
628a `++tusk`.
630#### Source
632```hoon
633 ++ tusk (list hoon) ::
634```
636#### Examples
638```
639 > (ream '[1 2 3]')
640 [%cltr p=~[[%dtzy p=%ud q=1] [%dtzy p=%ud q=2] [%dtzy p=%ud q=3]]]
641 > (tusk +:(ream '[1 2 3]'))
642 ~[[%dtzy p=%ud q=1] [%dtzy p=%ud q=2] [%dtzy p=%ud q=3]]
643```
646---
648### `++hoon`
650Expression
652An expression, or AST.
654See Rune section of Hoon reference
658---
660### `++tyke`
662List of 'maybe' hoons
664List of `++unit` `++hoon`, or gaps left to be inferred, in `++path`
665parsing. When you use a path such as `/=main=/pub/src/doc` the path is in fact
666a `++tyke`, where the `=` are inferred from your current path.
669#### Source
671```hoon
672 ++ tyke (list (unit hoon)) ::
673```
675#### Examples
677```
678 > (scan "/==as=" porc:vast)
679 [0 ~[~ ~ [~ [%dtzy p=%tas q=29.537]] ~]]
680 > `tyke`+:(scan "/==as=" porc:vast)
681 ~[~ ~ [~ [%dtzy p=%tas q=29.537]] ~]
682```
685---
687### `++typo`
689Pointer for `++type`
691Pointer for `++type`. `++typo` preserves the previous `++type` in your
692context when upating.
694#### Source
696```hoon
697 ++ typo type :: old type
698```
700#### Examples
702See also: `++seem`, `++vise`, `++type`
706---
708### `++tyre`
710List, term hoon
712Associative list of `++term` `++hoon`, used in jet hint processing.
714#### Source
716```hoon
717 ++ tyre (list ,[p=term q=hoon]) ::
718```
721---
723### `++vase`
725Typed data. A `++vase` is used wherever typed data is explicitly worked
726with.
728#### Source
730```hoon
731 ++ vase ,[p=type q=*] :: type-value pair
732```
734#### Examples
736```
737 > `vase`!>(~)
738 [p=[%cube p=0 q=[%atom p=%n]] q=0]
739```
742---
744### `++vise`
746Convert during reboot
748Used to convert from previously-typed data during reboot.
750#### Source
752```hoon
753 ++ vise ,[p=typo q=*] :: old vase
754```
756#### Examples
758See also: `++typo`, `++seer`
762---
764### `++wing`
766```hoon
767 ++ wing (list limb) ::
768```
770Address in subject. A `++wing` is a path to a value in the subject. A
771term alone is the trivial case of a `++wing`.
773See also: `++hoon`
775```
776 > (ream 'a.+.c')
777 [%cnzz p=~[%a [%.y p=3] %c]]
778 > (wing +:(ream 'a.+.c'))
779 ~[%a [%.y p=3] %c]
780```
782---