on e0c66bf help sign in
686 lines 13 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```
24---
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```
49---
51## `++base`
53Base type
55A base type that nouns are built from. A `++base` is either a noun, cell,
56boolean or null labelled with an aura.
58#### Source
60```hoon
61 ++ base ?([%atom p=aura] %noun %cell %bean %null) :: axils, @ * ^ ? ~
62```
64#### Examples
66```
67 > *base
68 %null
70 > (ream '=|(^ !!)')
71 [%tsbr p=[%axil p=%cell] q=[%zpzp ~]]
72 > :: p.p is a ++base
73 > (ream '=|(@t !!)')
74 [%tsbr p=[%axil p=[%atom p=~.t]] q=[%zpzp ~]]
75 > (ream '=|(? !!)')
76 [%tsbr p=[%axil p=%bean] q=[%zpzp ~]]
77```
79---
81## `++beer`
83Tape builder
85Used to build tapes internally.
87#### Source
89```hoon
90 ++ beer $|(@ [~ p=hoon]) :: simple embed
91```
93#### Examples
95```
96 > `beer`'as'
97 29.537
98 > `beer`[~ (ream 'lan')]
99 [~ p=[%cnzz p=~[%lan]]]
100```
102---
104## `++beet`
106XML interpolation cases
108Used internally.
110#### Source
112```hoon
113 ++ beet $| @ :: advanced embed
114 $% [%a p=hoon] :: take tape
115 [%b p=hoon] :: take manx
116 [%c p=hoon] :: take marl
117 [%d p=hoon] :: take $+(marl marl)
118 [%e p=hoon q=(list tuna)] :: element literal
119 == ::
120```
122---
124## `++chum`
126Jet hint information
128Jet hint information that must be present in the body of a `~/` or `~%`
129rune. A `++chum` can optionally contain a kelvin version, jet vendor,
130and `"{major}.{minor}"` version number.
132#### Source
134```hoon
135 ++ chum $? lef=term :: jet name
136 [std=term kel=@] :: kelvin version
137 [ven=term pro=term kel=@] :: vendor and product
138 [ven=term pro=term ver=@ kel=@] :: all of the above
139 == ::
140```
142#### Examples
144XX there's a ++chum in zuse that's politely causing this not to work
146```
147 > `chum`'hi'
148 lef=%hi
150 > (ream '~/(%lob.314 !!)')
151 [%sgfs p=[std=%lob kel=314] q=[%zpzp ~]]
152```
154---
156## `++coil`
158Tuple of core information
160Variance `p`, subject type `q`, and `q`: optional compiled nock, and arms. Used as an
161intermediate step within Section 2fB. Converted by `++core` to %core type.
163#### Source
165```hoon
166 ++ coil $: p=?(%gold %iron %lead %zinc) :: core type
167 q=type ::
168 r=[p=?(~ ^) q=(map term foot)] ::
169 == ::
170```
172---
174## `++foot`
176Cases of arms by variance model.
178`%ash` arms are `dry` and geometric.
180#### Source
182```hoon
183 ++ foot $% [%ash p=hoon] :: dry arm, geometric
184 [%elm p=hoon] :: wet arm, generic
185 [%oak ~] :: XX not used
186 [%yew p=(map term foot)] :: XX not used
187 == ::
188```
190#### Examples
192See also: `++ap`, `++ut`
194```
195 > *foot
196 [%yew p={}]
198 > (ream '|% ++ $ foo --')
199 [%brcn p={[p=%$ q=[%ash p=[%cnzz p=~[%foo]]]]}]
200 > +<+:(ream '|% ++ $ foo --')
201 t=~[%ash %cnzz %foo]
202 > (foot +<+:(ream '|% ++ $ foo --'))
203 [%ash p=[%cnzz p=~[%foo]]]
204 > (foot +<+:(ream '|% +- $ foo --'))
205 [%elm p=[%cnzz p=~[%foo]]]
206```
208---
210## `++limb`
212```hoon
213 ++ limb $|(term $%([%& p=axis] [%| p=@ud q=term])) ::
214```
216XX move to `++ut`
218Reference into subject by name/axis
220See also: section 2fC-2fD
222```hoon
223 > (ream '^^$')
224 [%cnzz p=~[[%.n p=2 q=%$]]]
225 > (limb &2:(ream '^^$'))
226 [%.n p=2 q=%$]
227 > (limb &2:(ream '^^^$'))
228 [%.n p=3 q=%$]
229```
231---
233## `++line`
235XX move to `++ut`
237#### Source
239```hoon
240 ++ line ,[p=[%leaf p=aura q=@] q=tile] :: %kelp case
241```
243#### Examples
245```
246 > (ream '$%([1 a] [%2 b])')
247 [ %bccm
248 p
249 [ %kelp
250 p
251 [ i=[p=[%leaf p=~.ud q=1] q=[%herb p=[%cnzz p=~[%a]]]]
252 t=~[[p=[%leaf p=~.ud q=2] q=[%herb p=[%cnzz p=~[%b]]]]]
253 ]
254 ]
255 ]
256 > &3:(ream '$%([1 a] [%2 b])')
257 p=[p=[%leaf p=%ud q=1] q=[%herb p=[%cnzz p=~[%a]]]]
258 > (line &3:(ream '$%([1 a] [%2 b])'))
259 [p=[%leaf p=~.ud q=1] q=[%herb p=[%cnzz p=~[%a]]]]
260```
262---
264## `++metl`
266```hoon
267 ++ metl ?(%gold %iron %zinc %lead) :: core variance
268```
270XX move to `++ut`
272See also: `++coil`
274---
276## `++nock`
278Virtual machine. See Nock.
280#### Source
282```hoon
283 ++ nock $& [p=nock q=nock] :: autocons
284 [%3 p=nock] :: cell test
285 [%4 p=nock] :: increment
286 [%5 p=nock q=nock] :: equality test
287 [%6 p=nock q=nock r=nock] :: if, then, else
288 [%7 p=nock q=nock] :: serial compose
289 [%8 p=nock q=nock] :: push onto subject
290 [%9 p=@ q=nock] :: select arm and fire
291 [%10 p=?(@ [p=@ q=nock]) q=nock] :: hint
292 [%11 p=nock] :: grab data from sky
293 == ::
294```
296#### Examples
298```
299 > !=([+(.) 20 -<])
300 [[4 0 1] [1 20] 0 4]
301 > (nock !=([+(.) 20]))
302 [p=[%4 p=[%0 p=1]] q=[%1 p=20]]
303```
305---
307## `++null`
309```hoon
310 ++ null ,~ :: null, nil, etc
311```
313Used nowhere XX
315```
316 > :type; *null
317 ~
318 %~
319```
321---
323## `++port`
325XX move to `++ut`
327Type and location of core-shaped thing? XX Compiler Internals
329#### Source
331```hoon
332 ++ port $: p=axis ::
333 $= q ::
334 $% [%& p=type] ::
335 [%| p=axis q=(list ,[p=type q=foot])] ::
336 == ::
337 == ::
338```
340#### Examples
342```
343 > *port
344 [p=0 q=[%.y p=%void]]
345```
347---
349## `++span`
351ASCII atom
353A restricted text atom for canonical atom syntaxes. The prefix is `~.`.
354There are no escape sequences except `~~`, which means `~`, and `~-`,
355which means `_`. `-` and `.` encode themselves. No other characters
356besides numbers and lowercase letters are permitted.
358#### Source
360```hoon
361 ++ span ,@ta :: text-atom (ASCII)
362```
364#### Examples
366```
367 > *span
368 ~.
370 > `@t`~.foo
371 'foo'
372 > `@t`~.foo.bar
373 'foo.bar'
374 > `@t`~.foo~~bar
375 'foo~bar'
376 > `@t`~.foo~-bar
377 'foo_bar'
378 > `@t`~.foo-bar
379 'foo-bar'
380```
382---
384## `++tiki`
386XX move to `++ut`
388#### Source
390```hoon
391 ++ tiki :: test case
392```
394#### Examples
396```
397A `++wing` or `++hoon`.
399 > (ream '=+ a=4 ?-(a @ ~)')
400 [ %tsls
401 p=[%ktts p=p=%a q=[%dtzy p=%ud q=4]]
402 q
403 [ %wthz
404 p=[%.y p=~ q=~[%a]]
405 q=~[[p=[%axil p=[%atom p=~.]] q=[%bczp p=%null]]]
406 ]
407 ]
408 > (ream '=+ a=4 ?-(4 @ ~)')
409 [ %tsls
410 p=[%ktts p=p=%a q=[%dtzy p=%ud q=4]]
411 q
412 [ %wthz
413 p=[%.n p=~ q=[%dtzy p=%ud q=4]]
414 q=~[[p=[%axil p=[%atom p=~.]] q=[%bczp p=%null]]]
415 ]
416 ]
417```
419---
421## `++toga`
423Tree of faces
425A face, or tree of faces. A `++toga` is applied to anything assigned
426using `^=`.
428XX move to `++ut` and rune doc (for \^= examples)
430#### Source
432```hoon
433 ++ toga :: face control
434 [2 p=toga q=toga] :: cell toga
435 == ::
436```
438#### Examples
440```
441 > a=1
442 a=1
443 > (ream 'a=1')
444 [%ktts p=p=%a q=[%dtzy p=%ud q=1]]
445 > [a b]=[1 2 3]
446 [a=1 b=[2 3]]
447 > (ream '[a b]=[1 2 3]')
448 [ %ktts
449 p=[%2 p=p=%a q=p=%b]
450 q=[%cltr p=~[[%dtzy p=%ud q=1] [%dtzy p=%ud q=2] [%dtzy p=%ud q=3]]]
451 ]
453 > [a ~]=[1 2 3]
454 [a=1 2 3]
455 > (ream '[a ~]=[1 2 3]')
456 [ %ktts
457 p=[%2 p=p=%a q=[%0 ~]]
458 q=[%cltr p=~[[%dtzy p=%ud q=1] [%dtzy p=%ud q=2] [%dtzy p=%ud q=3]]]
459 ]
460```
462---
464## `++tone`
466Intermediate Nock computation result
468Similar to `++toon`, but stack trace is not yet rendered.
470#### Source
472```hoon
473 ++ tone $% [%0 p=*] :: success
474```
476#### Examples
478```
479 > (mink [[20 21] 0 3] ,~)
480 [%0 p=21]
482 > (mink [[0] !=(.^(cy//=main/1))] ,~)
483 [%1 p=~[[31.075 1.685.027.454 1.852.399.981 49 0]]]
484 > (path [31.075 1.685.027.454 1.852.399.981 49 0])
485 /cy/~zod/main/1
487 > (mink [[1 2] !=(~|(%hi +(.)))] ,~)
488 [%2 p=~[[~.yelp 26.984]]]
489 > (mink [[1 2] !=(!:(+(.)))] ,~)
490 [ %2
491 p
492 ~[
493 [ ~.spot
494 [ [ 1.685.027.454
495 7.959.156
496 \/159.445.990.350.374.058.574.398.238.344.143.957.205.628.479.572.65\/
497 8.112.403.878.526
498 \/ \/
499 0
500 ]
501 [1 20]
502 1
503 24
504 ]
505 ]
506 ]
507 ]
508```
510---
512## `++tuna`
514XML template tree
516An XML template tree.
518#### Source
520```hoon
521 ++ tuna :: tagflow
522 [%d p=hoon] :: dynamic list
523 [%e p=hoon q=(list tuna)] :: element
524 [%f p=(list tuna)] :: subflow
525 == ::
526```
528#### Examples
530Leaf %a contains plain-text, %b an empty tag, %c a static list, %d a
531dynamic list, %e a full node element containing a hoon and a list of
532tuna, and %f is a empty node.
534See also: `++sail`
536---
538## `++tusk`
540List of expressions
542List of `++hoon`s. In `:*`, for example, your contents is
543a `++tusk`.
545#### Source
547```hoon
548 ++ tusk (list hoon) ::
549```
551#### Examples
553```
554 > (ream '[1 2 3]')
555 [%cltr p=~[[%dtzy p=%ud q=1] [%dtzy p=%ud q=2] [%dtzy p=%ud q=3]]]
556 > (tusk +:(ream '[1 2 3]'))
557 ~[[%dtzy p=%ud q=1] [%dtzy p=%ud q=2] [%dtzy p=%ud q=3]]
558```
560---
562## `++hoon`
564Expression
566An expression, or AST.
568See Rune section of Hoon reference
570---
572## `++tyke`
574List of 'maybe' hoons
576List of `++unit` `++hoon`, or gaps left to be inferred, in `++path`
577parsing. When you use a path such as `/=main=/pub/src/doc` the path is in fact
578a `++tyke`, where the `=` are inferred from your current path.
580#### Source
582```hoon
583 ++ tyke (list (unit hoon)) ::
584```
586#### Examples
588```
589 > (scan "/==as=" porc:vast)
590 [0 ~[~ ~ [~ [%dtzy p=%tas q=29.537]] ~]]
591 > `tyke`+:(scan "/==as=" porc:vast)
592 ~[~ ~ [~ [%dtzy p=%tas q=29.537]] ~]
593```
595---
597## `++typo`
599Pointer for `++type`
601Pointer for `++type`. `++typo` preserves the previous `++type` in your
602context when upating.
604#### Source
606```hoon
607 ++ typo type :: old type
608```
610#### Examples
612See also: `++seem`, `++vise`, `++type`
614---
616## `++tyre`
618List, term hoon
620Associative list of `++term` `++hoon`, used in jet hint processing.
622#### Source
624```hoon
625 ++ tyre (list ,[p=term q=hoon]) ::
626```
628---
630## `++vase`
632Typed data. A `++vase` is used wherever typed data is explicitly worked
633with.
635#### Source
637```hoon
638 ++ vase ,[p=type q=*] :: type-value pair
639```
641#### Examples
643```
644 > `vase`!>(~)
645 [p=[%cube p=0 q=[%atom p=%n]] q=0]
646```
648---
650## `++vise`
652Convert during reboot
654Used to convert from previously-typed data during reboot.
656#### Source
658```hoon
659 ++ vise ,[p=typo q=*] :: old vase
660```
662#### Examples
664See also: `++typo`, `++seer`
666---
668## `++wing`
670```hoon
671 ++ wing (list limb) ::
672```
674Address in subject. A `++wing` is a path to a value in the subject. A
675term alone is the trivial case of a `++wing`.
677See also: `++hoon`
679```
680 > (ream 'a.+.c')
681 [%cnzz p=~[%a [%.y p=3] %c]]
682 > (wing +:(ream 'a.+.c'))
683 ~[%a [%.y p=3] %c]
684```
686---