on b93c19b help sign in
781 lines 14 kB history raw
1+++
2title = "4o: Molds"
3weight = 42
4template = "doc.html"
5+++
6### `++abel`
8Biblical names in hoon are primarily aliases for the compiler.
10#### Source
12```
13 ++ abel typo :: original sin: type
14```
16#### Examples
18```
19 > *abel
20 %void
21```
24---
25### `++aura`
27'type' of atom
29By convention, a short name for a category of atom. `++aura` is
30circularly defined, with `@ta` being the `++aura` of the ASCII subset
31commonly used in urbit.
33#### Source
35```
36 ++ aura ,@ta :: atom format
37```
39#### Examples
41See also: `++base`, aura reference
43```
44 > `aura`%ux
45 ~.ux
46```
49---
50### `++axis`
52Nock axis
54A Nock axis inside a noun. After the leading 1, in binary, a `1` signfies
55right and `0` left.
57#### Source
59```
60 ++ axis ,@ :: tree address
61```
63#### Examples
65```
66 > *axis
67 0
69 > :: 0 is not actually a valid axis
70 > [[4 5] 6 7]
71 [[4 5] 6 7]
72 > `axis`0b110
73 6
74```
76---
78### `++base`
80Base type
82A base type that nouns are built from. A `++base` is either a noun, cell,
83boolean or null labelled with an odor.
85#### Source
87```
88 ++ base ?([%atom p=odor] %noun %cell %bean %null) :: axils, @ * ^ ? ~
89```
91#### Examples
93```
94 > *base
95 %null
97 > (ream '=|(^ !!)')
98 [%tsbr p=[%axil p=%cell] q=[%zpzp ~]]
99 > :: p.p is a ++base
100 > (ream '=|(@t !!)')
101 [%tsbr p=[%axil p=[%atom p=~.t]] q=[%zpzp ~]]
102 > (ream '=|(? !!)')
103 [%tsbr p=[%axil p=%bean] q=[%zpzp ~]]
104```
106---
108### `++bean`
110Boolean
112`0`, `&`, or `%.y` are true, and `1`, `|`, and `%.n` are false.
114#### Source
116```
117 ++ bean ,? :: 0=&=yes, 1=|=no
118```
120#### Examples
122```
123 > *bean
124 %.y
126 > `bean`&
127 %.y
128 > `bean`|
129 %.n
130```
133---
135### `++beer`
137Tape builder
139Used to build tapes internally.
141#### Source
143```
144 ++ beer $|(@ [~ p=hoon]) :: simple embed
145```
147#### Examples
149```
150 > `beer`'as'
151 29.537
152 > `beer`[~ (ream 'lan')]
153 [~ p=[%cnzz p=~[%lan]]]
154```
156---
158### `++beet`
160XML interpolation cases
162Used internally.
164#### Source
166```
167 ++ beet $| @ :: advanced embed
168 $% [%a p=hoon] :: take tape
169 [%b p=hoon] :: take manx
170 [%c p=hoon] :: take marl
171 [%d p=hoon] :: take $+(marl marl)
172 [%e p=hoon q=(list tuna)] :: element literal
173 == ::
174```
177---
178### `++chum`
180Jet hint information
182Jet hint information that must be present in the body of a `~/` or `~%`
183rune. A `++chum` can optionally contain a kelvin version, jet vendor,
184and `"{major}.{minor}"` version number.
186#### Source
188```
189 ++ chum $? lef=term :: jet name
190 [std=term kel=@] :: kelvin version
191 [ven=term pro=term kel=@] :: vendor and product
192 [ven=term pro=term ver=@ kel=@] :: all of the above
193 == ::
194```
196#### Examples
198XX there's a ++chum in zuse that's politely causing this not to work
200```
201 > `chum`'hi'
202 lef=%hi
204 > (ream '~/(%lob.314 !!)')
205 [%sgfs p=[std=%lob kel=314] q=[%zpzp ~]]
206```
209---
211### `++coil`
213Tuple of core information
215Variance `p`, subject type `q`, and `q`: optional compiled nock, and arms. Used as an
216intermediate step within Section 2fB. Converted by `++core` to %core type.
218#### Source
220```
221 ++ coil $: p=?(%gold %iron %lead %zinc) :: core type
222 q=type ::
223 r=[p=?(~ ^) q=(map term foot)] ::
224 == ::
225```
228---
229### `++foot`
231Cases of arms by variance model.
233`%ash` arms are `dry` and geometric.
235#### Source
237```
238 ++ foot $% [%ash p=hoon] :: dry arm, geometric
239 [%elm p=hoon] :: wet arm, generic
240 [%oak ~] :: XX not used
241 [%yew p=(map term foot)] :: XX not used
242 == ::
243```
245#### Examples
247See also: `++ap`, `++ut`
249```
250 > *foot
251 [%yew p={}]
253 > (ream '|% ++ $ foo --')
254 [%brcn p={[p=%$ q=[%ash p=[%cnzz p=~[%foo]]]]}]
255 > +<+:(ream '|% ++ $ foo --')
256 t=~[%ash %cnzz %foo]
257 > (foot +<+:(ream '|% ++ $ foo --'))
258 [%ash p=[%cnzz p=~[%foo]]]
259 > (foot +<+:(ream '|% +- $ foo --'))
260 [%elm p=[%cnzz p=~[%foo]]]
261```
263---
265### `++limb`
267```
268 ++ limb $|(term $%([%& p=axis] [%| p=@ud q=term])) ::
269```
271XX move to `++ut`
273Reference into subject by name/axis
275See also: section 2fC-2fD
277```
278 > (ream '^^$')
279 [%cnzz p=~[[%.n p=2 q=%$]]]
280 > (limb &2:(ream '^^$'))
281 [%.n p=2 q=%$]
282 > (limb &2:(ream '^^^$'))
283 [%.n p=3 q=%$]
284```
287---
288### `++line`
290XX move to `++ut`
292#### Source
294```
295 ++ line ,[p=[%leaf p=odor q=@] q=tile] :: %kelp case
296```
298#### Examples
300```
301 > (ream '$%([1 a] [%2 b])')
302 [ %bccm
303 p
304 [ %kelp
305 p
306 [ i=[p=[%leaf p=~.ud q=1] q=[%herb p=[%cnzz p=~[%a]]]]
307 t=~[[p=[%leaf p=~.ud q=2] q=[%herb p=[%cnzz p=~[%b]]]]]
308 ]
309 ]
310 ]
311 > &3:(ream '$%([1 a] [%2 b])')
312 p=[p=[%leaf p=%ud q=1] q=[%herb p=[%cnzz p=~[%a]]]]
313 > (line &3:(ream '$%([1 a] [%2 b])'))
314 [p=[%leaf p=~.ud q=1] q=[%herb p=[%cnzz p=~[%a]]]]
315```
317---
319### `++metl`
321```
322 ++ metl ?(%gold %iron %zinc %lead) :: core variance
323```
325XX move to `++ut`
327See also: `++coil`
331---
333### `++nock`
335Virtual machine. See Nock.
338#### Source
340```
341 ++ nock $& [p=nock q=nock] :: autocons
342 [%3 p=nock] :: cell test
343 [%4 p=nock] :: increment
344 [%5 p=nock q=nock] :: equality test
345 [%6 p=nock q=nock r=nock] :: if, then, else
346 [%7 p=nock q=nock] :: serial compose
347 [%8 p=nock q=nock] :: push onto subject
348 [%9 p=@ q=nock] :: select arm and fire
349 [%10 p=?(@ [p=@ q=nock]) q=nock] :: hint
350 [%11 p=nock] :: grab data from sky
351 == ::
352```
354#### Examples
356```
357 > !=([+(.) 20 -<])
358 [[4 0 1] [1 20] 0 4]
359 > (nock !=([+(.) 20]))
360 [p=[%4 p=[%0 p=1]] q=[%1 p=20]]
361```
364---
366### `++noun`
368```
369 ++ noun ,* :: any noun
370```
372Used nowhere XX
374```
375 > `noun`~[1 2 3]
376 [1 2 3 0]
377```
380---
382### `++null`
384```
385 ++ null ,~ :: null, nil, etc
386```
388Used nowhere XX
390```
391 > :type; *null
392 ~
393 %~
394```
397---
399### `++port`
401XX move to `++ut`
403Type and location of core-shaped thing? XX Compiler Internals
405#### Source
407```
408 ++ port $: p=axis ::
409 $= q ::
410 $% [%& p=type] ::
411 [%| p=axis q=(list ,[p=type q=foot])] ::
412 == ::
413 == ::
414```
416#### Examples
418```
419 > *port
420 [p=0 q=[%.y p=%void]]
421```
424---
426### `++span`
428ASCII atom
430A restricted text atom for canonical atom syntaxes. The prefix is `~.`.
431There are no escape sequences except `~~`, which means `~`, and `~-`,
432which means `_`. `-` and `.` encode themselves. No other characters
433besides numbers and lowercase letters are permitted.
435#### Source
437```
438 ++ span ,@ta :: text-atom (ASCII)
439```
442#### Examples
444```
445 > *span
446 ~.
448 > `@t`~.foo
449 'foo'
450 > `@t`~.foo.bar
451 'foo.bar'
452 > `@t`~.foo~~bar
453 'foo~bar'
454 > `@t`~.foo~-bar
455 'foo_bar'
456 > `@t`~.foo-bar
457 'foo-bar'
458```
461---
463### `++tiki`
465XX move to `++ut`
467#### Source
469```
470 ++ tiki :: test case
471```
473#### Examples
475```
476A `++wing` or `++hoon`.
478 > (ream '=+ a=4 ?-(a @ ~)')
479 [ %tsls
480 p=[%ktts p=p=%a q=[%dtzy p=%ud q=4]]
481 q
482 [ %wthz
483 p=[%.y p=~ q=~[%a]]
484 q=~[[p=[%axil p=[%atom p=~.]] q=[%bczp p=%null]]]
485 ]
486 ]
487 > (ream '=+ a=4 ?-(4 @ ~)')
488 [ %tsls
489 p=[%ktts p=p=%a q=[%dtzy p=%ud q=4]]
490 q
491 [ %wthz
492 p=[%.n p=~ q=[%dtzy p=%ud q=4]]
493 q=~[[p=[%axil p=[%atom p=~.]] q=[%bczp p=%null]]]
494 ]
495 ]
496```
499---
501### `++toga`
503Tree of faces
505A face, or tree of faces. A `++toga` is applied to anything assigned
506using `^=`.
508XX move to `++ut` and rune doc (for \^= examples)
510#### Source
512```
513 ++ toga :: face control
514 [2 p=toga q=toga] :: cell toga
515 == ::
516```
518#### Examples
520```
521 > a=1
522 a=1
523 > (ream 'a=1')
524 [%ktts p=p=%a q=[%dtzy p=%ud q=1]]
525 > [a b]=[1 2 3]
526 [a=1 b=[2 3]]
527 > (ream '[a b]=[1 2 3]')
528 [ %ktts
529 p=[%2 p=p=%a q=p=%b]
530 q=[%cltr p=~[[%dtzy p=%ud q=1] [%dtzy p=%ud q=2] [%dtzy p=%ud q=3]]]
531 ]
533 > [a ~]=[1 2 3]
534 [a=1 2 3]
535 > (ream '[a ~]=[1 2 3]')
536 [ %ktts
537 p=[%2 p=p=%a q=[%0 ~]]
538 q=[%cltr p=~[[%dtzy p=%ud q=1] [%dtzy p=%ud q=2] [%dtzy p=%ud q=3]]]
539 ]
540```
543---
545### `++tone`
547Intermediate Nock computation result
549Similar to `++toon`, but stack trace is not yet rendered.
551#### Source
553```
554 ++ tone $% [%0 p=*] :: success
555```
557#### Examples
559```
560 > (mink [[20 21] 0 3] ,~)
561 [%0 p=21]
563 > (mink [[0] !=(.^(cy//=main/1))] ,~)
564 [%1 p=~[[31.075 1.685.027.454 1.852.399.981 49 0]]]
565 > (path [31.075 1.685.027.454 1.852.399.981 49 0])
566 /cy/~zod/main/1
568 > (mink [[1 2] !=(~|(%hi +(.)))] ,~)
569 [%2 p=~[[~.yelp 26.984]]]
570 > (mink [[1 2] !=(!:(+(.)))] ,~)
571 [ %2
572 p
573 ~[
574 [ ~.spot
575 [ [ 1.685.027.454
576 7.959.156
577 \/159.445.990.350.374.058.574.398.238.344.143.957.205.628.479.572.65\/
578 8.112.403.878.526
579 \/ \/
580 0
581 ]
582 [1 20]
583 1
584 24
585 ]
586 ]
587 ]
588 ]
589```
592---
594### `++tuna`
596XML template tree
598An XML template tree.
600#### Source
602```
603 ++ tuna :: tagflow
604 [%d p=hoon] :: dynamic list
605 [%e p=hoon q=(list tuna)] :: element
606 [%f p=(list tuna)] :: subflow
607 == ::
608```
610#### Examples
612Leaf %a contains plain-text, %b an empty tag, %c a static list, %d a
613dynamic list, %e a full node element containing a hoon and a list of
614tuna, and %f is a empty node.
616See also: `++sail`
620---
622### `++tusk`
624List of expressions
626List of `++hoon`s. In `:*`, for example, your contents is
627a `++tusk`.
629#### Source
631```
632 ++ tusk (list hoon) ::
633```
635#### Examples
637```
638 > (ream '[1 2 3]')
639 [%cltr p=~[[%dtzy p=%ud q=1] [%dtzy p=%ud q=2] [%dtzy p=%ud q=3]]]
640 > (tusk +:(ream '[1 2 3]'))
641 ~[[%dtzy p=%ud q=1] [%dtzy p=%ud q=2] [%dtzy p=%ud q=3]]
642```
645---
647### `++hoon`
649Expression
651An expression, or AST.
653See Rune section of Hoon reference
657---
659### `++tyke`
661List of 'maybe' hoons
663List of `++unit` `++hoon`, or gaps left to be inferred, in `++path`
664parsing. When you use a path such as `/=main=/pub/src/doc` the path is in fact
665a `++tyke`, where the `=` are inferred from your current path.
668#### Source
670```
671 ++ tyke (list (unit hoon)) ::
672```
674#### Examples
676```
677 > (scan "/==as=" porc:vast)
678 [0 ~[~ ~ [~ [%dtzy p=%tas q=29.537]] ~]]
679 > `tyke`+:(scan "/==as=" porc:vast)
680 ~[~ ~ [~ [%dtzy p=%tas q=29.537]] ~]
681```
684---
686### `++typo`
688Pointer for `++type`
690Pointer for `++type`. `++typo` preserves the previous `++type` in your
691context when upating.
693#### Source
695```
696 ++ typo type :: old type
697```
699#### Examples
701See also: `++seem`, `++vise`, `++type`
705---
707### `++tyre`
709List, term hoon
711Associative list of `++term` `++hoon`, used in jet hint processing.
713#### Source
715```
716 ++ tyre (list ,[p=term q=hoon]) ::
717```
720---
722### `++vase`
724Typed data. A `++vase` is used wherever typed data is explicitly worked
725with.
727#### Source
729```
730 ++ vase ,[p=type q=*] :: type-value pair
731```
733#### Examples
735```
736 > `vase`!>(~)
737 [p=[%cube p=0 q=[%atom p=%n]] q=0]
738```
741---
743### `++vise`
745Convert during reboot
747Used to convert from previously-typed data during reboot.
749#### Source
751```
752 ++ vise ,[p=typo q=*] :: old vase
753```
755#### Examples
757See also: `++typo`, `++seer`
761---
763### `++wing`
765```
766 ++ wing (list limb) ::
767```
769Address in subject. A `++wing` is a path to a value in the subject. A
770term alone is the trivial case of a `++wing`.
772See also: `++hoon`
774```
775 > (ream 'a.+.c')
776 [%cnzz p=~[%a [%.y p=3] %c]]
777 > (wing +:(ream 'a.+.c'))
778 ~[%a [%.y p=3] %c]
779```
781---