on 140ac0e help sign in
723 lines 14 kB history raw
1# 4o: molds and mold builders
2### `++abel`
4Biblical names in hoon are primarily aliases for the compiler.
6Source
7------
9 ++ abel typo :: original sin: type
11Examples
12--------
14 > *abel
15 %void
19***
20### `++aura`
22'type' of atom
24By convention, a short name for a category of atom. `++aura` is
25circularly defined, with [`@ta`]() being the `++aura` of the ASCII subset
26commonly used in urbit.
28Source
29------
31 ++ aura ,@ta :: atom format
33Examples
34--------
36See also: [`++base`](), [aura reference]()
38 > `aura`%ux
39 ~.ux
43***
45### `++axis`
47Nock axis
49A Nock axis inside a [noun](). After the leading 1, in binary, a `1` signfies
50right and `0` left.
52Source
53------
55 ++ axis ,@ :: tree address
57Examples
58--------
60 > *axis
61 0
63 > :: 0 is not actually a valid axis
64 > [[4 5] 6 7]
65 [[4 5] 6 7]
66 > `axis`0b110
67 6
70***
72### `++base`
74Base type
76A base type that [noun]()s are built from. A `++base` is either a noun, cell, boolean or
77null labelled with an [odor]().
79Source
80------
82 ++ base ?([%atom p=odor] %noun %cell %bean %null) :: axils, @ * ^ ? ~
84Examples
85--------
87 > *base
88 %null
90 > (ream '=|(^ !!)')
91 [%tsbr p=[%axil p=%cell] q=[%zpzp ~]]
92 > :: p.p is a ++base
93 > (ream '=|(@t !!)')
94 [%tsbr p=[%axil p=[%atom p=~.t]] q=[%zpzp ~]]
95 > (ream '=|(? !!)')
96 [%tsbr p=[%axil p=%bean] q=[%zpzp ~]]
99***
100### `++bean`
102Boolean
104`0`, `&`, or `%.y` are true, and `1`, `|`, and `%.n` are false.
106Source
107------
109 ++ bean ,? :: 0=&=yes, 1=|=no
111Examples
112--------
114 > *bean
115 %.y
117 > `bean`&
118 %.y
119 > `bean`|
120 %.n
124***
125### `++beer`
127Tape builder
129Used to build [tape]()s internally.
131Source
132------
134 ++ beer $|(@ [~ p=twig]) :: simple embed
136Examples
137--------
139 > `beer`'as'
140 29.537
141 > `beer`[~ (ream 'lan')]
142 [~ p=[%cnzz p=~[%lan]]]
145***
146### `++beet`
148XML interpolation cases
150Used internally.
152Source
153------
155 ++ beet $| @ :: advanced embed
156 $% [%a p=twig] :: take tape
157 [%b p=twig] :: take manx
158 [%c p=twig] :: take marl
159 [%d p=twig] :: take $+(marl marl)
160 [%e p=twig q=(list tuna)] :: element literal
161 == ::
165***
166### `++chum`
168Jet hint information
170Jet hint information that must be present in the body of a `~/` or `~%`
171rune. A `++chum` can optionally contain a kelvin version, jet vendor,
172and "{major}.{minor}" version number.
174Source
175------
177 ++ chum $? lef=term :: jet name
178 [std=term kel=@] :: kelvin version
179 [ven=term pro=term kel=@] :: vendor and product
180 [ven=term pro=term ver=@ kel=@] :: all of the above
181 == ::
183Examples
184--------
186XX there's a ++chum in zuse that's politely causing this not to work
188 > `chum`'hi'
189 lef=%hi
191 > (ream '~/(%lob.314 !!)')
192 [%sgfs p=[std=%lob kel=314] q=[%zpzp ~]]
196***
197### `++coil`
199Tuple of core information
201Variance `p`, subject type `q`, and `q`: optional compiled nock, and arms. Used as an
202intermediate step within Section 2fB. Converted by `++core` to %core type.
204Source
205------
207 ++ coil $: p=?(%gold %iron %lead %zinc) :: core type
208 q=type ::
209 r=[p=?(~ ^) q=(map term foot)] ::
210 == ::
214***
215### `++foot`
217Cases of arms by variance model.
219`%ash` arms are [`dry`]() and [geometric]().
221Source
222------
224 ++ foot $% [%ash p=twig] :: dry arm, geometric
225 [%elm p=twig] :: wet arm, generic
226 [%oak ~] :: XX not used
227 [%yew p=(map term foot)] :: XX not used
228 == ::
230Examples
231--------
233See also: [`++ap`](), [`++ut`]()
235 > *foot
236 [%yew p={}]
238 > (ream '|% ++ $ foo --')
239 [%brcn p={[p=%$ q=[%ash p=[%cnzz p=~[%foo]]]]}]
240 > +<+:(ream '|% ++ $ foo --')
241 t=~[%ash %cnzz %foo]
242 > (foot +<+:(ream '|% ++ $ foo --'))
243 [%ash p=[%cnzz p=~[%foo]]]
244 > (foot +<+:(ream '|% +- $ foo --'))
245 [%elm p=[%cnzz p=~[%foo]]]
247***
248### `++limb`
250 ++ limb $|(term $%([%& p=axis] [%| p=@ud q=term])) ::
252XX move to `++ut`
254Reference into subject by name/axis
256See also: section 2fC-2fD
258 > (ream '^^$')
259 [%cnzz p=~[[%.n p=2 q=%$]]]
260 > (limb &2:(ream '^^$'))
261 [%.n p=2 q=%$]
262 > (limb &2:(ream '^^^$'))
263 [%.n p=3 q=%$]
267***
268### `++line`
270XX move to `++ut`
272Source
273------
275 ++ line ,[p=[%leaf p=odor q=@] q=tile] :: %kelp case
278Examples
279--------
281 > (ream '$%([1 a] [%2 b])')
282 [ %bccm
283 p
284 [ %kelp
285 p
286 [ i=[p=[%leaf p=~.ud q=1] q=[%herb p=[%cnzz p=~[%a]]]]
287 t=~[[p=[%leaf p=~.ud q=2] q=[%herb p=[%cnzz p=~[%b]]]]]
288 ]
289 ]
290 ]
291 > &3:(ream '$%([1 a] [%2 b])')
292 p=[p=[%leaf p=%ud q=1] q=[%herb p=[%cnzz p=~[%a]]]]
293 > (line &3:(ream '$%([1 a] [%2 b])'))
294 [p=[%leaf p=~.ud q=1] q=[%herb p=[%cnzz p=~[%a]]]]
297***
298### `++metl`
300 ++ metl ?(%gold %iron %zinc %lead) :: core variance
302XX move to `++ut`
304See also: [`++coil`]()
308***
309### `++nock`
311Virtual machine. See [Nock doc]().
314Source
315------
317 ++ nock $& [p=nock q=nock] :: autocons
318 [%3 p=nock] :: cell test
319 [%4 p=nock] :: increment
320 [%5 p=nock q=nock] :: equality test
321 [%6 p=nock q=nock r=nock] :: if, then, else
322 [%7 p=nock q=nock] :: serial compose
323 [%8 p=nock q=nock] :: push onto subject
324 [%9 p=@ q=nock] :: select arm and fire
325 [%10 p=?(@ [p=@ q=nock]) q=nock] :: hint
326 [%11 p=nock] :: grab data from sky
327 == ::
329Examples
330--------
332 > !=([+(.) 20 -<])
333 [[4 0 1] [1 20] 0 4]
334 > (nock !=([+(.) 20]))
335 [p=[%4 p=[%0 p=1]] q=[%1 p=20]]
339***
340### `++noun`
342 ++ noun ,* :: any noun
344Used nowhere XX
346 > `noun`~[1 2 3]
347 [1 2 3 0]
351***
352### `++null`
354 ++ null ,~ :: null, nil, etc
356Used nowhere XX
358 > :type; *null
359 ~
360 %~
364***
365### `++port`
367XX move to `++ut`
369Type and location of core-shaped thing? XX Compiler Internals
371Source
372------
374 ++ port $: p=axis ::
375 $= q ::
376 $% [%& p=type] ::
377 [%| p=axis q=(list ,[p=type q=foot])] ::
378 == ::
379 == ::
381Examples
382--------
384 > *port
385 [p=0 q=[%.y p=%void]]
389***
390### `++span`
392ASCII atom
394A restricted text atom for canonical atom syntaxes. The prefix is `~.`.
395There are no escape sequences except `~~`, which means `~`, and `~-`,
396which means `_`. `-` and `.` encode themselves. No other characters
397besides numbers and lowercase letters are permitted.
399Source
400------
402 ++ span ,@ta :: text-atom (ASCII)
403Examples
404--------
405 > *span
406 ~.
408 > `@t`~.foo
409 'foo'
410 > `@t`~.foo.bar
411 'foo.bar'
412 > `@t`~.foo~~bar
413 'foo~bar'
414 > `@t`~.foo~-bar
415 'foo_bar'
416 > `@t`~.foo-bar
417 'foo-bar'
421***
422### `++tiki`
424XX move to `++ut`
426Source
427------
429 ++ tiki :: test case
431Examples
432--------
434A `++wing` or `++twig`.
436 > (ream '=+ a=4 ?-(a @ ~)')
437 [ %tsls
438 p=[%ktts p=p=%a q=[%dtzy p=%ud q=4]]
439 q
440 [ %wthz
441 p=[%.y p=~ q=~[%a]]
442 q=~[[p=[%axil p=[%atom p=~.]] q=[%bczp p=%null]]]
443 ]
444 ]
445 > (ream '=+ a=4 ?-(4 @ ~)')
446 [ %tsls
447 p=[%ktts p=p=%a q=[%dtzy p=%ud q=4]]
448 q
449 [ %wthz
450 p=[%.n p=~ q=[%dtzy p=%ud q=4]]
451 q=~[[p=[%axil p=[%atom p=~.]] q=[%bczp p=%null]]]
452 ]
453 ]
457***
458### `++toga`
460Tree of faces
462A [face](), or tree of faces. A `++toga` is applied to anything assigned
463using [`^=`]().
465XX move to `++ut` and rune doc (for \^= examples)
467Source
468------
470 ++ toga :: face control
471 [2 p=toga q=toga] :: cell toga
472 == ::
474Examples
475--------
477 > a=1
478 a=1
479 > (ream 'a=1')
480 [%ktts p=p=%a q=[%dtzy p=%ud q=1]]
481 > [a b]=[1 2 3]
482 [a=1 b=[2 3]]
483 > (ream '[a b]=[1 2 3]')
484 [ %ktts
485 p=[%2 p=p=%a q=p=%b]
486 q=[%cltr p=~[[%dtzy p=%ud q=1] [%dtzy p=%ud q=2] [%dtzy p=%ud q=3]]]
487 ]
489 > [a ~]=[1 2 3]
490 [a=1 2 3]
491 > (ream '[a ~]=[1 2 3]')
492 [ %ktts
493 p=[%2 p=p=%a q=[%0 ~]]
494 q=[%cltr p=~[[%dtzy p=%ud q=1] [%dtzy p=%ud q=2] [%dtzy p=%ud q=3]]]
495 ]
499***
500### `++tone`
502Intermediate Nock computation result
504Similar to [`++toon`](), but stack trace is not yet rendered.
506Source
507------
509 ++ tone $% [%0 p=*] :: success
511Examples
512--------
514 > (mink [[20 21] 0 3] ,~)
515 [%0 p=21]
517 > (mink [[0] !=(.^(cy//=main/1))] ,~)
518 [%1 p=~[[31.075 1.685.027.454 1.852.399.981 49 0]]]
519 > (path [31.075 1.685.027.454 1.852.399.981 49 0])
520 /cy/~zod/main/1
522 > (mink [[1 2] !=(~|(%hi +(.)))] ,~)
523 [%2 p=~[[~.yelp 26.984]]]
524 > (mink [[1 2] !=(!:(+(.)))] ,~)
525 [ %2
526 p
527 ~[
528 [ ~.spot
529 [ [ 1.685.027.454
530 7.959.156
531 \/159.445.990.350.374.058.574.398.238.344.143.957.205.628.479.572.65\/
532 8.112.403.878.526
533 \/ \/
534 0
535 ]
536 [1 20]
537 1
538 24
539 ]
540 ]
541 ]
542 ]
546***
547### `++tuna`
549XML template tree
551An XML template tree.
553Source
554------
556 ++ tuna :: tagflow
557 [%d p=twig] :: dynamic list
558 [%e p=twig q=(list tuna)] :: element
559 [%f p=(list tuna)] :: subflow
560 == ::
562Examples
563--------
565Leaf %a contains plain-text, %b an empty tag, %c a static list, %d a
566dynamic list, %e a full node element containing a twig and a list of
567tuna, and %f is a empty node.
569See also: [`++sail`]()
573***
574### `++tusk`
576List of expressions
578List of [`++twig`]()s. In [`:*`](), for example, your contents is
579a `++tusk`.
581Source
582------
584 ++ tusk (list twig) ::
586Examples
587--------
589 > (ream '[1 2 3]')
590 [%cltr p=~[[%dtzy p=%ud q=1] [%dtzy p=%ud q=2] [%dtzy p=%ud q=3]]]
591 > (tusk +:(ream '[1 2 3]'))
592 ~[[%dtzy p=%ud q=1] [%dtzy p=%ud q=2] [%dtzy p=%ud q=3]]
596***
597### `++twig`
599Expression
601An expression, or AST.
603See Twig section of Hoon reference
607***
608### `++tyke`
610List of 'maybe' twigs
612List of [`++unit`]() [`++twig`](), or gaps left to be inferred, in [`++path`]()
613parsing. When you use a path such as `/=main=/pub/src/doc` the path is in fact
614a `++tyke`, where the `=` are inferred from your current path.
617Source
618------
620 ++ tyke (list (unit twig)) ::
622Examples
623--------
625 > (scan "/==as=" porc:vast)
626 [0 ~[~ ~ [~ [%dtzy p=%tas q=29.537]] ~]]
627 > `tyke`+:(scan "/==as=" porc:vast)
628 ~[~ ~ [~ [%dtzy p=%tas q=29.537]] ~]
632***
633### `++typo`
635Pointer for `++type`
637Pointer for [`++type`](). `++typo` preserves the previous `++type` in your
638context when upating.
640Source
641------
643 ++ typo type :: old type
645Examples
646--------
648See also: `++seem`, `++vise`, `++type`
652***
653### `++tyre`
655List, term to twig
657Associative list of [++term]() [`++twig`](), used in [jet]() hint processing.
659Source
660------
662 ++ tyre (list ,[p=term q=twig]) ::
666***
667### `++vase`
669Typed data. A `++vase` is used wherever typed data is explicitly worked
670with.
673Source
674------
676 ++ vase ,[p=type q=*] :: type-value pair
678Examples
679--------
680See `%arvo` doc
682 > `vase`!>(~)
683 [p=[%cube p=0 q=[%atom p=%n]] q=0]
687***
688### `++vise`
690Convert during reboot
692Used to convert from previously-typed data during reboot.
694Source
695------
697 ++ vise ,[p=typo q=*] :: old vase
699Examples
700--------
702See also: [`++typo`](), [`++seer`]()
706***
707### `++wing`
709 ++ wing (list limb) ::
711Address in subject. A `++wing` is a path to a value in the subject. A
712term alone is the trivial case of a `++wing`.
714See also: `++twig`
716 > (ream 'a.+.c')
717 [%cnzz p=~[%a [%.y p=3] %c]]
718 > (wing +:(ream 'a.+.c'))
719 ~[%a [%.y p=3] %c]
723***