@@ -0,0 +1,1786 @@
1+volume 1, Hoon Structures
2+=========================
4+------------------------------------------------------------------------
8+ ++ abel typo :: original sin: type
10+Biblical names in hoon are primarily aliases for the compiler.
17+------------------------------------------------------------------------
21+ ++ axis ,@ :: tree address
23+A Nock axis inside a noun. After the leading 1, in binary, a 1 signfies
26+See also: `++clue`, `++limb`, `++slot`, `++peg`, and Section 2fC
31+ ~zod/try=> :: 0 is not actually a valid axis
32+ ~zod/try=> [[4 5] 6 7]
34+ ~zod/try=> `axis`0b110
37+------------------------------------------------------------------------
41+ ++ also ,[p=term q=wing r=type] :: alias
45+------------------------------------------------------------------------
49+ ++ base ?([%atom p=odor] %noun %cell %bean %null) :: axils, @ * ^ ? ~
51+A base type that nouns are built from. Either a noun, a cell, loobean or
52+null labelled with an odor.
54+See also: `++tile`, `++twig`
59+ ~zod/try=> (ream '=|(^ !!)')
60+ [%tsbr p=[%axil p=%cell] q=[%zpzp ~]]
61+ ~zod/try=> :: p.p is a ++base
62+ ~zod/try=> (ream '=|(@t !!)')
63+ [%tsbr p=[%axil p=[%atom p=~.t]] q=[%zpzp ~]]
64+ ~zod/try=> (ream '=|(? !!)')
65+ [%tsbr p=[%axil p=%bean] q=[%zpzp ~]]
67+------------------------------------------------------------------------
71+ ++ bean ,? :: 0=&=yes, 1=|=no
73+The Urbit version of a boolean, which we call a loobean. 0 or & is
74+"yes", 1 or | is "no".
84+------------------------------------------------------------------------
88+ ++ beer $|(@ [~ p=twig]) :: simple embed
90+Used to build tapes internally.
92+See also: `++phax`, `++scat`, section 2fD
94+ ~zod/try=> `beer`'as'
96+ ~zod/try=> `beer`[~ (ream 'lan')]
97+ [~ p=[%cnzz p=~[%lan]]]
99+------------------------------------------------------------------------
103+ ++ beet $| @ :: advanced embed
104+ $% [%a p=twig] :: take tape
105+ [%b p=twig] :: take manx
106+ [%c p=twig] :: take marl
107+ [%d p=twig] :: take $+(marl marl)
108+ [%e p=twig q=(list tuna)] :: element literal
111+Cases for XML interpolation. Used internally.
113+See also: `++sail`, section 2fD
115+------------------------------------------------------------------------
119+ ++ bloq ,@ :: blockclass
121+Atom representing a blocksize, by convention expressed as a power of 2.
123+See also: section 2cA
125+ ~zod/try=> :: ++met measures how many bloqs long an atom is
126+ ~zod/try=> (met 3 256)
128+ ~zod/try=> :: 256 is 2 bloqs of 2^3
130+------------------------------------------------------------------------
134+ ++ calf ,[p=(map ,@ud wine) q=wine] ::
136+Encodes cyclical backreferences in types. Used in pretty printing.
138+See also: `++wine`, `++dole`, `++doge`, `++dish`, section 2fC
140+ ~zod/try=> `calf`[~ %atom %ta]
141+ [p={} q=[%atom p=%ta]]
143+ ~zod/try=> `calf`~(dole ut p:!>(*^))
144+ [p={} q=[%plot p=~[%noun %noun]]]
146+ ~zod/try=> `calf`~(dole ut p:!>($:|-(?(~ [* $]))))
147+ [ p={[p=1 q=[%pick p=~[[%pear p=%n q=0] [%plot p=~[%noun [%stop p=1]]]]]]}
151+------------------------------------------------------------------------
155+ ++ char ,@tD :: UTF-8 byte
157+A single character. Odor `@tD` designates a single Unicode byte. All
158+parsers consume `++tape` (a list of `++char`).
160+See also: `++tape`, `++lust`, `++just`, `++mask`, chapter 2f
165+ ~zod/try=> (char 97)
168+------------------------------------------------------------------------
172+ ++ chub :: registered battery
173+ $: p=(pair chum tyre) :: definition
175+ r=(unit (pair axis chub)) :: parent
178+Used by the compiler (implicitly by `%sgcn`) to attach jets.
180+See also: Section 2fB.
182+------------------------------------------------------------------------
186+ ++ chum $? lef=term :: jet name
187+ [std=term kel=@] :: kelvin version
188+ [ven=term pro=term kel=@] :: vendor and product
189+ [ven=term pro=term ver=@ kel=@] :: all of the above
192+Jet hint information that must be present in the body of a \~/ or \~%
193+rune. A `++chum` can optionally contain a kelvin version, jet vendor,
194+and major.minor version number.
196+XX there's a ++chum in zuse that's politely causing this not to work
198+See also: `++twig`, `++clue`
200+ ~zod/try=> `chum`'hi'
203+ ~zod/try=> (ream '~/(%lob.314 !!)')
204+ [%sgfs p=[std=%lob kel=314] q=[%zpzp ~]]
206+------------------------------------------------------------------------
210+ ++ clue ,[p=axis q=chum r=tyre] :: battery definition
212+Used by compiler to attach jets.
214+XX implementation does not currenlty match docs
216+See also: section 2fB
218+------------------------------------------------------------------------
222+ ++ coil $: p=?(%gold %iron %lead %zinc) :: core type
224+ r=[p=?(~ ^) q=(map term foot)] ::
227+Core information tuple: variance, subject type, optional compiled nock,
228+and arms. Used as an intermediate step within Section 2fB. Converted by
229+`++core` to %core type.
231+See also: `++core`, Section 2fB
233+------------------------------------------------------------------------
237+ ++ coin $% [%$ p=dime] ::
239+ [%many p=(list coin)] ::
242+Noun literal syntax cases: atoms, jammed nouns, and nestable tuples.
243+Parsed and printed using `++so` and `++co` cores in Section 2eL
246+See also: `++so`, `++co`, Section 2eL, `++dime`
248+ ~zod/try=> `coin`(need (slay '~s1'))
249+ [%$ p=[p=~.dr q=18.446.744.073.709.551.616]]
250+ ~zod/try=> `coin`(need (slay '0x2b59'))
251+ [%$ p=[p=~.ux q=11.097]]
253+ ~zod/try=> ~(rend co [%many ~[[%$ %ud 1] [%$ %tas 'a'] [%$ %s -2]]])
255+ ~zod/try=> ._1_a_-2__
258+ ~zod/try=> `@uv`(jam [3 4])
260+ ~zod/try=> (slay '~02cd1')
265+------------------------------------------------------------------------
269+ ++ cord ,@t :: text atom (UTF-8)
271+One of Hoon's two string types (the other being `++tape`). A cord is an
272+atom of UTF-8 text. `++trip` and `++crip` convert between cord and
275+Odor `@t` designates a Unicode atom, little-endian: the first character
276+in the text is the low byte.
278+See also: `++trip`, `++crip`, Section 2eJ
280+ ~zod/try=> `@ux`'foobar'
283+ ~zod/try=> `@`'urbit'
285+ ~zod/try=> (cord 499.984.265.845)
288+------------------------------------------------------------------------
292+ ++ date ,[[a=? y=@ud] m=@ud t=tarp] :: parsed date
294+A point in time. A loobean designating AD or BC, a year atom, a month
295+atom, and a `++tarp`, which is a day atom and a time.
297+See also: `++year`, `++yore`, Section 2cH, `++stud`, `++dust`, Section
300+ ~zod/try=> `date`(yore ~2014.6.6..21.09.15..0a16)
301+ [[a=%.y y=2.014] m=6 t=[d=6 h=21 m=9 s=15 f=~[0xa16]]]
303+------------------------------------------------------------------------
307+ ++ dime ,[p=@ta q=@] ::
309+Odor-atom pair, used in `++coin`.
311+Convenience methods `++scot` and `++scow` (in Section 2eL) print dimes
312+as cords/tapes, `++slat`, `++slav`, and `++slaw` are used to parse atoms
315+See also: `++so`, `++co`, Section 2eL, `++coin`
317+ ~zod/try=> +>:(slay '0x123')
320+------------------------------------------------------------------------
324+ ++ dram $% [| p=(map ,@tas dram)] :: simple unix dir
328+The structure of a unix filesystem tree. A `++dram` is one of two cases:
329+`|` a directory - a map of names to deeper tree structures, `&` a file -
330+a numbered atom of data.
334+------------------------------------------------------------------------
338+ ++ each |*([a=$+(* *) b=$+(* *)] $%([& p=a] [| p=b])) :: either a or b
340+Tile generator: produces a discriminated fork between two types.
342+ ~zod/try=> :type; *(each cord time)
344+ {[%.y p=@t] [%.n p=@da]}
346+------------------------------------------------------------------------
350+ ++ edge ,[p=hair q=(unit ,[p=* q=nail])] :: parsing output
352+Parsing location metadata: optional result and parsing continuation.
354+See also: Section 2eD, `++rule`
358+ ~zod/try=> (tall:vast [1 1] "a b")
359+ [p=[p=1 q=2] q=[~ [p=[%cnzz p=~[%a]] q=[p=[p=1 q=2] q=" b"]]]]
361+------------------------------------------------------------------------
365+ ++ foot $% [%ash p=twig] :: dry arm, geometric
366+ [%elm p=twig] :: wet arm, generic
367+ [%oak ~] :: XX not used
368+ [%yew p=(map term foot)] :: XX not used
371+Cases of arms by variance model.
373+See also: `++ap`, `++ut`, Section 2fB, Section 2fC
378+ ~zod/try=> (ream '|% ++ $ foo --')
379+ [%brcn p={[p=%$ q=[%ash p=[%cnzz p=~[%foo]]]]}]
380+ ~zod/try=> +<+:(ream '|% ++ $ foo --')
381+ t=~[%ash %cnzz %foo]
382+ ~zod/try=> (foot +<+:(ream '|% ++ $ foo --'))
383+ [%ash p=[%cnzz p=~[%foo]]]
384+ ~zod/try=> (foot +<+:(ream '|% +- $ foo --'))
385+ [%elm p=[%cnzz p=~[%foo]]]
387+------------------------------------------------------------------------
391+ ++ gate $+(* *) :: general gate
393+An core with one arm, `$`, which transforms a sample noun into a product
394+noun. If used dryly as a type, subject must have a sample type of `*`.
396+See also: `++lift`, `++cork`, Core Language Doc
399+ <1|mws [* <101.jzo 1.ypj %164>]>
400+ ~zod/try=> `gate`|=(* 0)
401+ <1|mws [* <101.jzo 1.ypj %164>]>
403+ ~zod/try=> (|=(a=* [a 'b']) 'c')
405+ ~zod/try=> (`gate`|=(a=* [a 'b']) 'c')
408+------------------------------------------------------------------------
412+ ++ hair ,[p=@ud q=@ud] :: parsing trace
414+A pair of two `@ud` used in parsing indicating line and column number.
416+See also: `++last`, Section 2eB
421+ ~zod/try=> `hair`[1 1] :: parsing starts at [1 1] as a convention.
423+ ~zod/try=> ((plus ace) [1 1] " --")
424+ [p=[p=1 q=4] q=[~ u=[p=[~~. " "] q=[p=[p=1 q=4] q="--"]]]]
425+ ~zod/try=> `hair`p:((plus ace) [1 1] " --")
428+------------------------------------------------------------------------
432+ ++ like |* a=_,* :: generic edge
433+ |= b=_`*`[(hair) ~] ::
438+ u=[p=(a +>-.b) q=[p=(hair -.b) q=(tape +.b)]] ::
440+Tile generator for an `++edge`. `++like` generates an `++edge` with a
441+parsed result set to a specific type.
443+See also: `++easy`, `++just`/`++jest`, `++knee`, `++mask`, `++shim`,
444+`++stir`, `++stun`, Section 2eC
446+ ~zod/try=> *(like char)
449+ ~zod/try=> (ace [1 1] " a")
450+ [p=[p=1 q=2] q=[~ [p=~~. q=[p=[p=1 q=2] q="a"]]]]
451+ ~zod/try=> `(like char)`(ace [1 1] " a")
452+ [p=[p=1 q=2] q=[~ [p=~~. q=[p=[p=1 q=2] q="a"]]]]
453+ ~zod/try=> `(like ,@)`(ace [1 1] " a")
454+ [p=[p=1 q=2] q=[~ [p=32 q=[p=[p=1 q=2] q="a"]]]]
456+------------------------------------------------------------------------
460+ ++ limb $|(term $%([%& p=axis] [%| p=@ud q=term])) ::
464+Reference into subject by name/axis
466+See also: section 2fC-2fD
468+ ~zod/try=> (ream '^^$')
469+ [%cnzz p=~[[%.n p=2 q=%$]]]
470+ ~zod/try=> (limb &2:(ream '^^$'))
472+ ~zod/try=> (limb &2:(ream '^^^$'))
475+------------------------------------------------------------------------
479+ ++ line ,[p=[%leaf p=odor q=@] q=tile] :: %kelp case
483+Dicriminated union unionee XX
485+Used in compilation and grammar, section 2fC-2fD
487+ ~zod/try=> (ream '$%([1 a] [%2 b])')
492+ [ i=[p=[%leaf p=~.ud q=1] q=[%herb p=[%cnzz p=~[%a]]]]
493+ t=~[[p=[%leaf p=~.ud q=2] q=[%herb p=[%cnzz p=~[%b]]]]]
497+ ~zod/try=> &3:(ream '$%([1 a] [%2 b])')
498+ p=[p=[%leaf p=%ud q=1] q=[%herb p=[%cnzz p=~[%a]]]]
499+ ~zod/try=> (line &3:(ream '$%([1 a] [%2 b])'))
500+ [p=[%leaf p=~.ud q=1] q=[%herb p=[%cnzz p=~[%a]]]]
502+------------------------------------------------------------------------
506+ ++ list |* a=_,* :: null-term list
507+ $|(~ [i=a t=(list a)]) ::
509+Tile generator. `++list` generates a tile of a null-terminated list of
512+See also: `++turn`, `++snag`, section 2bB.
516+ ~zod/try=> `(list ,@)`"abc"
518+ ~zod/try=> (snag 0 "abc")
521+------------------------------------------------------------------------
525+ ++ lone |*(a=$+(* *) ,p=a) :: just one thing
529+Tile generator. `++lone` puts face of `p` on something.
531+------------------------------------------------------------------------
535+ ++ mane $|(@tas [@tas @tas]) :: XML name/space
537+An XML name (tag name or attribute name) with an optional namespace.
538+Parsed by `++name`:poxa, rendered by `++name`:poxo.
540+See also: `++sail` doc, Section 3bD
545+ ~zod/try=> `mane`n.g:`manx`;div:namespace;
547+ ~zod/try=> `mane`n.g:`manx`;div_namespace;
550+------------------------------------------------------------------------
554+ ++ manx ,[g=marx c=marl] :: XML node
558+Parsed by `++apex`:poxa, rendered by `++poxo`, section 3bD
560+See also: `++sail` doc, Section 3bD
562+------------------------------------------------------------------------
566+ ++ marl (list manx) :: XML node list
570+Parsed within `++apex`:poxa, rendered by `++many`:poxo, section 3bD
572+See also: `++sail` doc
574+------------------------------------------------------------------------
578+ ++ mars ,[t=[n=%$ a=[i=[n=%$ v=tape] t=~]] c=~] :: XML cdata
580+XML CDATA. Implicitly produced by `++chrd`:poxa
582+See also: `++sail` doc
584+------------------------------------------------------------------------
588+ ++ mart (list ,[n=mane v=tape]) :: XML attributes
590+List of XML attributes. Each `++mart` is a list of pairs of `++mane` and
593+Parsed by `++attr`:poxa, rendered by `++attr`:poxo, section 3bD
595+See also: `++sail` doc
597+------------------------------------------------------------------------
601+ ++ marx ,[n=mane a=mart] :: XML tag
603+XML tag. A `++marx` is a pair of a tag name, `++mane` and a list of
604+attributes, `++mart`.
606+Parsed by `++head`:poxa, rendered within `++poxo`, section 3bD
608+See also: `++sail` doc
610+------------------------------------------------------------------------
614+ ++ metl ?(%gold %iron %zinc %lead) :: core variance
620+------------------------------------------------------------------------
624+ ++ noun ,* :: any noun
628+ ~zod/try=> `noun`~[1 2 3]
631+------------------------------------------------------------------------
635+ ++ null ,~ :: null, nil, etc
639+ ~zod/try=> :type; *null
643+------------------------------------------------------------------------
647+ ++ odor ,@ta :: atom format
649+By convetion, a short name for a category of atom. `++odor` is
650+circularly defined, `@ta` being the `++odor` of the ASCII subset
651+commonly used in urbit.
653+See also: `++base`, odor reference
655+ ~zod/try=> `odor`%ux
658+------------------------------------------------------------------------
662+ ++ tarp ,[d=@ud h=@ud m=@ud s=@ud f=(list ,@ux)] :: parsed time
664+The remaining part of a `++date`: day, hour, minute, second and a list
665+of `@ux` for precision.
667+See also: `++date`, `++yell`/`++yule`, Section 2cH
670+ ~2014.9.20..00.43.33..b52a
671+ ~zod/try=> :: the time is always in your context at -<-
672+ ~zod/try=> (yell -<-)
673+ [d=106.751.991.820.278 h=0 m=43 s=39 f=~[0x54d1]]
675+ ~zod/try=> (yell ~d20)
676+ [d=20 h=0 m=0 s=0 f=~]
678+------------------------------------------------------------------------
682+ ++ time ,@da :: galactic time
684+The `@da` odor designates an absolute date atom.
686+See also: `++date`, odor reference
688+ ~zod/try=> `time`-<-
689+ ~2014.9.25..20.01.47..eeac
690+ ~zod/try=> :: the time is always in your context at -<-
691+ ~zod/try=> `time`~2014.1.1
694+------------------------------------------------------------------------
698+ ++ tree |* a=_,* :: binary tree
699+ $|(~ [n=a l=(tree a) r=(tree a)]) ::
701+Tile generator. A `++tree` can be empty, or contain a node of a type and
702+left/right sub `++tree`s of the same type. Pretty-printed with `{}`.
704+ ~zod/try=> `(tree ,[@ tape])`[[1 "hi"] [[2 "bye"] ~ ~] ~]
705+ {[2 "bye"] [1 "hi"]}
707+------------------------------------------------------------------------
711+ ++ nail ,[p=hair q=tape] :: parsing input
713+Location in parsed text, and remainder of it. Indicates parsing position
714+and remaining text to be parsed.
718+ ~zod/try=> +<:;~(plug cab cab)
719+ c=tub=[p=[p=0 q=0] q=""]
720+ ~zod/try=> :: tub is a ++nail
722+------------------------------------------------------------------------
726+ ++ numb ,@ :: just a number
730+------------------------------------------------------------------------
734+ ++ pair |*([a=$+(* *) b=$+(* *)] ,[p=a q=b]) :: just a pair
736+Tile generator. Produces a tuple of two of the types passed in.
738+ ~zod/try=> *(pair bean cord)
741+------------------------------------------------------------------------
745+ ++ pass ,@ :: public key
747+Atom alias. Used primarily in crypto.
749+See also: `++acru`, `++crua`, `++crub`
751+------------------------------------------------------------------------
755+ ++ path (list span) :: filesys location
757+A filesystem path. A `++path` is a list of `++span`, `@ta`. Used in
758+`%clay` and `%eyre` extensively.
760+ ~zod/try=> `path`"abc"
763+------------------------------------------------------------------------
767+ ++ pint ,[p=[p=@ q=@] q=[p=@ q=@]] :: line/column range
769+A parsing range, mostly used for stacktraces. A `++pint` is a pair of
770+hairs indicating from - to.
773+ ! /~zod/try/~2014.9.20..01.22.04..52e3/:<[1 4].[1 6]>
774+ ~zod/try=> :: !! always produces a crash
775+ ~zod/try=> `pint`[[1 4] [1 6]]
776+ [p=[p=1 q=4] q=[p=1 q=6]]
778+------------------------------------------------------------------------
782+ ++ pole |* a=_,* :: nameless list
783+ $|(~ [a (pole a)]) ::
785+A `++list` without the faces. A `++pole` is a null-terminated tuple
786+without the `i=` and `t=`.
788+ ~zod/try=> `(pole char)`"asdf"
789+ [~~a [~~s [~~d [~~f ~]]]]
791+------------------------------------------------------------------------
795+ ++ port $: p=axis ::
798+ [%| p=axis q=(list ,[p=type q=foot])] ::
804+Type and location of core-shaped thing? XX Compiler Internals
807+ [p=0 q=[%.y p=%void]]
809+------------------------------------------------------------------------
813+ ++ post $: p=axis ::
816+ [1 p=axis q=(list ,[p=type q=foot])] ::
817+ [2 p=twin q=type] ::
823+Type and location of possibly core-shaped thing? XX Compiler Internals
826+ [p=0 q=[%0 p=%void]]
828+------------------------------------------------------------------------
832+ ++ prop $: p=axis ::
834+ [p=?(~ axis) q=(list ,[p=type q=foot])] ::
839+Verified core-shaped thing? XX Compiler Internals
844+------------------------------------------------------------------------
848+ ++ qual |* [a=$+(* *) b=$+(* *) c=$+(* *) d=$+(* *)] :: just a quadruple
849+ ,[p=a q=b r=c s=d] ::
851+Tile generator. A `++qual` is a tuple of four of the types passed in..
853+ ~zod/try=> *(qual date time tape cord)
854+ [p=[[a=%.y y=0] m=0 t=[d=0 h=0 m=0 s=0 f=~]] q=~292277024401-.1.1 r="" s='']
856+------------------------------------------------------------------------
860+ ++ rege $| ?(%dote %ende %sart %empt %boun %bout) :: parsed regex
861+ $% [%lite p=char] :: literal
862+ [%pair p=rege q=rege] :: ordering
863+ [%capt p=rege q=@u] :: capture group
864+ [%brac p=@] :: p is 256 bitmask
865+ [%eith p=rege q=rege] :: either
866+ [%mant p=rege] :: greedy 0 or more
867+ [%plls p=rege] :: greedy 1 or more
868+ [%betw p=rege q=@u r=@u] :: between q and r
869+ [%bint p=rege q=@u] :: min q
870+ [%bant p=rege q=@u] :: exactly q
871+ [%manl p=rege] :: lazy 0 or more
872+ [%plll p=rege] :: lazy 1 or more
873+ [%betl p=rege q=@u r=@u] :: between q and r lazy
874+ [%binl p=rege q=@u] :: min q lazy
877+Regular expressions. `++rege` defines the cases of a regex.
879+See also: `++rexp`, `++repg`, `++pars`
881+ ~zod/try=> (pars "[a-z]")
882+ [~ [%brac p=10.633.823.807.823.001.954.701.781.295.154.855.936]]
883+ ~zod/try=> (rexp "[a-z]" "abc1")
884+ [~ [~ {[p=0 q="a"]}]]
886+------------------------------------------------------------------------
890+ ++ ring ,@ :: private key
892+Atom alias, used primarily in crypto.
894+See also: `++acru`, `++crua`, `++crub`.
896+------------------------------------------------------------------------
900+ ++ rule |=(tub=nail `edge`[p.tub ~ ~ tub]) :: parsing rule
902+Parsing rule. `++rule` is an empty parsing rule, but it is used to check
903+that parsing rules match this with `_`.
905+See also: `++cold`, Section 2eC
908+ [p=[p=0 q=0] q=[~ [p=0 q=[p=[p=0 q=0] q=""]]]]
910+ ~zod/try=> ^+(rule [|=(a=nail [p.a ~])]:|6)
911+ <1.dww [tub=[p=[p=@ud q=@ud] q=""] <101.jzo 1.ypj %164>]>
912+ ~zod/try=> (^+(rule [|=(a=nail [p.a ~ u=['a' a]])]:|6) [1 1] "hi")
913+ [p=[p=1 q=1] q=[~ [p=97 q=[p=[p=1 q=1] q="hi"]]]]
914+ ~zod/try=> ([|=(a=nail [p.a ~ u=['a' a]])]:|6 [1 1] "hi")
915+ [[p=1 q=1] ~ u=['a' p=[p=1 q=1] q="hi"]]
917+------------------------------------------------------------------------
921+ ++ span ,@ta :: text-atom (ASCII)
923+A restricted text atom for canonical atom syntaxes. The prefix is `~.`.
924+There are no escape sequences except `~~`, which means `~`, and `~-`,
925+which means `_`. `-` and `.` encode themselves. No other characters
926+besides numbers and lowercase letters are permitted.
931+ ~zod/try=> `@t`~.foo
933+ ~zod/try=> `@t`~.foo.bar
935+ ~zod/try=> `@t`~.foo~~bar
937+ ~zod/try=> `@t`~.foo~-bar
939+ ~zod/try=> `@t`~.foo-bar
942+------------------------------------------------------------------------
946+ ++ spot ,[p=path q=pint] :: range in file
948+Stack trace line. A `++spot` is what we print after crashing.
952+ ~zod/try=> :into /=main=/bin/fail/hoon '!: !!'
953+ + /~zod/main/359/bin/fail/hoon
955+ ! /~zod/main/~2014.9.22..18.40.56..ef04/bin/fail/:<[1 5].[1 7]>
958+------------------------------------------------------------------------
962+ ++ tang (list tank) :: general error
966+------------------------------------------------------------------------
970+ ++ tank $% [%leaf p=tape] :: printing formats
972+ p=[p=tape q=tape r=tape s=tape] ::
975+ $: %rose :: delimeted list
976+ p=[p=tape q=tape r=tape] :: mid open close
981+Pretty-printing structure. A `++tank` is one of three cases. A `%leaf`
982+is just a string. A `%palm` is XX need more information. A `%rose` is a
983+list of `++tank` delimted by the strings in `p`.
985+ ~zod/try=> >(bex 20) (bex 19)<
986+ [%rose p=[p=" " q="[" r="]"] q=~[[%leaf p="1.048.576"] [%leaf p="524.288"]]]
987+ ~zod/try=> (wash [0 80] >(bex 20) (bex 19)<) :: at 80 cols
988+ <<"[1.048.576 524.288]">>
989+ ~zod/try=> (wash [0 15] >(bex 20) (bex 19)<) :: at 15 cols (two lines)
990+ <<"[ 1.048.576" " 524.288" "]">>
992+ ~zod/try=> [(bex 150) (bex 151)] :: at 80 cols
993+ [ 1.427.247.692.705.959.881.058.285.969.449.495.136.382.746.624
994+ 2.854.495.385.411.919.762.116.571.938.898.990.272.765.493.248
997+------------------------------------------------------------------------
1001+ ++ tape (list char) :: like a string
1003+One of Hoon's two string types, the other being `++cord`. A tape is a
1006+ ~zod/try=> `(list ,char)`"foobar"
1008+ ~zod/try=> `(list ,@)`"foobar"
1009+ ~[102 111 111 98 97 114]
1011+------------------------------------------------------------------------
1015+ ++ term ,@tas :: Hoon ASCII subset
1017+A restricted text atom for Hoon constants. The only characters permitted
1018+are lowercase ASCII, - except as the first or last character, and 0-9
1019+except as the first character. The syntax for `@tas` is the text itself,
1020+always preceded by `%`. This means a term is always cubical. The empty
1021+`@tas` has a special syntax, `$`:
1026+ ~zod/try=> %dead-fish9
1028+ ~zod/try=> -:!>(%dead-fish9)
1029+ [%cube p=271.101.667.197.767.630.546.276 q=[%atom p=%tas]]
1031+------------------------------------------------------------------------
1035+ ++ tiki :: test case
1036+ $% [& p=(unit term) q=wing] :: simple wing
1037+ [| p=(unit term) q=twig] :: named wing
1042+A `++wing` or `++twig`.
1044+ ~zod/try=> (ream '=+ a=4 ?-(a @ ~)')
1046+ p=[%ktts p=p=%a q=[%dtzy p=%ud q=4]]
1049+ p=[%.y p=~ q=~[%a]]
1050+ q=~[[p=[%axil p=[%atom p=~.]] q=[%bczp p=%null]]]
1053+ ~zod/try=> (ream '=+ a=4 ?-(4 @ ~)')
1055+ p=[%ktts p=p=%a q=[%dtzy p=%ud q=4]]
1058+ p=[%.n p=~ q=[%dtzy p=%ud q=4]]
1059+ q=~[[p=[%axil p=[%atom p=~.]] q=[%bczp p=%null]]]
1063+------------------------------------------------------------------------
1067+See the Tile section of the Hoon Reference.
1069+------------------------------------------------------------------------
1073+ ++ toga :: face control
1074+ $| p=term :: two togas
1075+ $% [0 ~] :: no toga
1076+ [1 p=term q=toga] :: deep toga
1077+ [2 p=toga q=toga] :: cell toga
1080+XX move to `++ut` and rune doc (for \^= examples)
1082+A face, or tree of faces. A `++toga` is applied to anything assigned
1087+ ~zod/try=> (ream 'a=1')
1088+ [%ktts p=p=%a q=[%dtzy p=%ud q=1]]
1089+ ~zod/try=> [a b]=[1 2 3]
1091+ ~zod/try=> (ream '[a b]=[1 2 3]')
1093+ p=[%2 p=p=%a q=p=%b]
1094+ q=[%cltr p=~[[%dtzy p=%ud q=1] [%dtzy p=%ud q=2] [%dtzy p=%ud q=3]]]
1097+ ~zod/try=> [a ~]=[1 2 3]
1099+ ~zod/try=> (ream '[a ~]=[1 2 3]')
1101+ p=[%2 p=p=%a q=[%0 ~]]
1102+ q=[%cltr p=~[[%dtzy p=%ud q=1] [%dtzy p=%ud q=2] [%dtzy p=%ud q=3]]]
1105+------------------------------------------------------------------------
1109+ ++ trap ,_|.(_*) :: makes perfect sense
1111+A trap is a core with one arm `++$`.
1116+ <1.mws 101.jzo 1.ypj %164>
1119+ ~zod/try=> (|.(42))
1122+------------------------------------------------------------------------
1126+ ++ trel |* [a=$+(* *) b=$+(* *) c=$+(* *)] :: just a triple
1129+Tile generator. `++trel` is a tuple of three of the types passed in.
1131+ ~zod/try=> *(trel ,@ud ,@t ,@s)
1134+------------------------------------------------------------------------
1139+ $% [%a p=twig] :: plain text
1140+ [%b p=twig] :: single tag
1141+ [%c p=twig] :: simple list
1142+ [%d p=twig] :: dynamic list
1143+ [%e p=twig q=(list tuna)] :: element
1144+ [%f p=(list tuna)] :: subflow
1147+An XML template tree.
1149+Leaf %a contains plain-text, %b an empty tag, %c a static list, %d a
1150+dynamic list, %e a full node element containing a twig and a list of
1151+tuna, and %f is a empty node.
1155+------------------------------------------------------------------------
1159+See Twig section of Hoon reference
1161+------------------------------------------------------------------------
1165+ ++ tine (list ,[p=tile q=twig]) ::
1167+Switch statement cases. In `?-`, for example, your list of cases is a
1172+ ~zod/try=> (ream '?-(!! @ |, ^ &)')
1174+ p=[%.n p=~ q=[%zpzp ~]]
1177+ [p=[%axil p=[%atom p=~.]] q=[%dtzy p=%f q=1]]
1178+ [p=[%axil p=%cell] q=[%dtzy p=%f q=0]]
1181+ ~zod/try=> (tine |2:(ream '?-(!! @ |, ^ &)'))
1183+ [p=[%axil p=[%atom p=~.]] q=[%dtzy p=%f q=1]]
1184+ [p=[%axil p=%cell] q=[%dtzy p=%f q=0]]
1187+------------------------------------------------------------------------
1191+ ++ tusk (list twig) ::
1193+Variable-arity expression list. In `:*`, for example, your contents are
1198+ ~zod/try=> (ream '[1 2 3]')
1199+ [%cltr p=~[[%dtzy p=%ud q=1] [%dtzy p=%ud q=2] [%dtzy p=%ud q=3]]]
1200+ ~zod/try=> (tusk +:(ream '[1 2 3]'))
1201+ ~[[%dtzy p=%ud q=1] [%dtzy p=%ud q=2] [%dtzy p=%ud q=3]]
1203+------------------------------------------------------------------------
1207+ ++ tyre (list ,[p=term q=twig]) ::
1209+Associative list of term to twig, used in jet hint processing.
1213+------------------------------------------------------------------------
1217+ ++ tyke (list (unit twig)) ::
1219+List of twigs, or gaps left to be inferred, in path parsing. When you
1220+use a path such as `/=main=/pub/src/doc` the path is in fact a `++tyke`,
1221+where the `=` are inferred from your current path.
1223+ ~zod/try=> (scan "/==as=" porc:vast)
1224+ [0 ~[~ ~ [~ [%dtzy p=%tas q=29.537]] ~]]
1225+ ~zod/try=> `tyke`+:(scan "/==as=" porc:vast)
1226+ ~[~ ~ [~ [%dtzy p=%tas q=29.537]] ~]
1228+------------------------------------------------------------------------
1232+ ++ tram (list ,[p=wing q=twig]) ::
1234+List of changes by location in context. When using `%=`, for example,
1235+the list of changes is a `++tram`.
1239+ ~zod/try=> (ream '$(a 1, b 2)')
1242+ q=~[[p=~[%a] q=[%dtzy p=%ud q=1]] [p=~[%b] q=[%dtzy p=%ud q=2]]]
1244+ ~zod/try=> (tram +:(ream '$(a 1, b 2)'))
1245+ ~[[p=~ q=[% p=0]] [p=~[%a] q=[%dtzy p=%ud q=1]] [p=~[%b] q=[%dtzy p=%ud q=2]]]
1247+------------------------------------------------------------------------
1251+ ++ nock $& [p=nock q=nock] :: autocons
1252+ $% [%0 p=@] :: axis select
1253+ [%1 p=*] :: constant
1254+ [%2 p=nock q=nock] :: compose
1255+ [%3 p=nock] :: cell test
1256+ [%4 p=nock] :: increment
1257+ [%5 p=nock q=nock] :: equality test
1258+ [%6 p=nock q=nock r=nock] :: if, then, else
1259+ [%7 p=nock q=nock] :: serial compose
1260+ [%8 p=nock q=nock] :: push onto subject
1261+ [%9 p=@ q=nock] :: select arm and fire
1262+ [%10 p=?(@ [p=@ q=nock]) q=nock] :: hint
1263+ [%11 p=nock] :: grab data from sky
1268+ ~zod/try=> !=([+(.) 20 -<])
1269+ [[4 0 1] [1 20] 0 4]
1270+ ~zod/try=> (nock !=([+(.) 20]))
1271+ [p=[%4 p=[%0 p=1]] q=[%1 p=20]]
1273+------------------------------------------------------------------------
1277+ ++ tone $% [%0 p=*] :: success
1278+ [%1 p=(list)] :: blocks
1279+ [%2 p=(list ,[@ta *])] :: error ~_s
1282+Intermediate Nock computation result. Similar to `++toon`, but stack
1283+trace is not yet rendered.
1285+ ~zod/try=> (mink [[20 21] 0 3] ,~)
1288+ ~zod/try=> (mink [[0] !=(.^(cy//=main/1))] ,~)
1289+ [%1 p=~[[31.075 1.685.027.454 1.852.399.981 49 0]]]
1290+ ~zod/try=> (path [31.075 1.685.027.454 1.852.399.981 49 0])
1293+ ~zod/try=> (mink [[1 2] !=(~|(%hi +(.)))] ,~)
1294+ [%2 p=~[[~.yelp 26.984]]]
1295+ ~zod/try=> (mink [[1 2] !=(!:(+(.)))] ,~)
1302+ \/159.445.990.350.374.058.574.398.238.344.143.957.205.628.479.572.65\/
1315+------------------------------------------------------------------------
1319+ ++ toon $% [%0 p=*] :: success
1320+ [%1 p=(list)] :: blocks
1321+ [%2 p=(list tank)] :: stack trace
1324+Nock computation result. Either success (`%0`), a block with list of
1325+requests blocked on (`%1`), or failure with stack trace (`%2`).
1327+ ~zod/try=> (mock [[20 21] 0 3] ,~)
1330+ ~zod/try=> (mock [[0] !=(.^(cy//=main/1))] ,~)
1331+ [%1 p=~[[31.075 1.685.027.454 1.852.399.981 49 0]]]
1332+ ~zod/try=> (path [31.075 1.685.027.454 1.852.399.981 49 0])
1335+ ~zod/try=> (mock [[1 2] !=(!:(+(.)))] ,~)
1336+ [%2 p=~[[%leaf p="/~zod/try/~2014.9.23..18.34.32..d3c5/:<[1 20].[1 24]>"]]]
1338+------------------------------------------------------------------------
1342+ ++ tune $% [%0 p=vase] ::
1344+ [%2 p=(list ,[@ta *])] ::
1349+Probably typed `tone`?
1351+------------------------------------------------------------------------
1355+ ++ twin ,[p=term q=wing r=axis s=type] :: alias info
1357+Aliasing. Used in `%bull` `++type` to typecheck aliased faces.
1359+ ~zod/try=> (~(busk ut %cell %noun [%atom %ud]) %fal [%& 3]~)
1361+ p=[p=%fal q=~[[%.y p=3]] r=3 s=[%atom p=%ud]]
1362+ q=[%cell p=%noun q=[%atom p=%ud]]
1364+ ~zod/try=> &2:(~(busk ut %cell %noun [%atom %ud]) %fal [%& 3]~)
1365+ p=[p=%fal q=~[[%.y p=3]] r=3 s=[%atom p=%ud]]
1366+ ~zod/try=> (twin &2:(~(busk ut %cell %noun [%atom %ud]) %fal [%& 3]~))
1367+ [p=%fal q=~[[%.y p=3]] r=3 s=[%atom p=%ud]]
1369+------------------------------------------------------------------------
1373+See Type section of Hoon reference
1375+------------------------------------------------------------------------
1379+ ++ typo type :: old type
1381+Pointer for `++type`. `++typo` preserves the previous `++type` in your
1382+context when upating.
1384+See also: `++seem`, `++vise`, `++type`
1386+------------------------------------------------------------------------
1390+ ++ udal :: atomic change (%b)
1391+ $: p=@ud :: blockwidth
1392+ q=(list ,[p=@ud q=(unit ,[p=@ q=@])]) :: indels
1397+------------------------------------------------------------------------
1401+ ++ udon :: abstract delta
1402+ $: p=umph :: preprocessor
1404+ $% [%a p=* q=*] :: trivial replace
1405+ [%b p=udal] :: atomic indel
1406+ [%c p=(urge)] :: list indel
1407+ [%d p=upas q=upas] :: tree edit
1413+------------------------------------------------------------------------
1417+ ++ umph :: change filter
1418+ $| $? %a :: no filter
1422+ $% [%d p=@ud] :: blocklist
1427+------------------------------------------------------------------------
1431+ ++ unce |* a=_,* :: change part
1432+ $% [%& p=@ud] :: skip[copy]
1433+ [%| p=(list a) q=(list a)] :: p -> q[chunk]
1438+------------------------------------------------------------------------
1442+ ++ unit |* a=_,* :: maybe
1445+Tile generator. A `++unit` is either `~` or `[~ u=a]` where `a` is the
1446+type that was passed in.
1448+See also: `++bind`, Section 2bA
1450+ ~zod/try=> :type; *(unit time)
1453+ ~zod/try=> `(unit time)`[~ -<-]
1454+ [~ ~2014.9.24..19.25.10..7dd5]
1456+------------------------------------------------------------------------
1460+ ++ upas :: tree change (%d)
1461+ $& [p=upas q=upas] :: cell
1462+ $% [%0 p=axis] :: copy old
1463+ [%1 p=*] :: insert new
1464+ [%2 p=axis q=udon] :: mutate!
1469+------------------------------------------------------------------------
1473+ ++ urge |*(a=_,* (list (unce a))) :: list change
1477+------------------------------------------------------------------------
1481+ ++ vase ,[p=type q=*] :: type-value pair
1483+Typed data. A `++vase` is used wherever typed data is explicitly worked
1488+ ~zod/try=> `vase`!>(~)
1489+ [p=[%cube p=0 q=[%atom p=%n]] q=0]
1491+------------------------------------------------------------------------
1495+ ++ vise ,[p=typo q=*] :: old vase
1497+Used to convert from previously-typed data during reboot.
1499+See `++typo`, `++seer`
1501+------------------------------------------------------------------------
1505+ ++ wall (list tape) :: text lines (no \n)
1507+A list of lines. A `++wall` is used instead of a single `++tape` with
1512+ ~zod/try=> `wall`(wash [0 20] leaf/<(bex 256)>)
1514+ "\/115.792.089.237.\/"
1515+ " 316.195.423.570."
1516+ " 985.008.687.907."
1517+ " 853.269.984.665."
1518+ " 640.564.039.457."
1519+ " 584.007.913.129."
1524+------------------------------------------------------------------------
1528+ ++ wain (list cord) :: text lines (no \n)
1530+A list of lines. A `++wain` is used instead of a single `++cord` with
1533+See also: `++lore`, `++role`
1535+ ~zod/try=> `wain`/som/del/rok
1537+ ~zod/try=> `wain`(lore ^:@t/=main=/bin/tree/hoon)
1540+ :: /===/bin/tree/hoon
1542+ |= [pax=path fla=$|(~ [%full ~])]
1545+ =+ rend=?~(fla |=(a=path +:(spud (slag len a))) spud)
1547+ =+ ark=;;(arch .^(cy/pax))
1549+ [(crip (rend pax)) -]
1551+ %- turn :_ |=(a=@t ^$(pax (weld pax `path`/[a])))
1553+ %- turn :_ |=([a=@t ~] a)
1557+------------------------------------------------------------------------
1561+ ++ wing (list limb) ::
1563+Address in subject. A `++wing` is a path to a value in the subject. A
1564+term alone is the trivial case of a `++wing`.
1568+ ~zod/try=> (ream 'a.+.c')
1569+ [%cnzz p=~[%a [%.y p=3] %c]]
1570+ ~zod/try=> (wing +:(ream 'a.+.c'))
1573+------------------------------------------------------------------------
1577+ ++ wine $| ?(%noun %path %tank %void %wall %wool %yarn)
1578+ $% [%atom p=term] ::
1579+ [%core p=(list ,@ta) q=wine] ::
1580+ [%face p=term q=wine] ::
1581+ [%list p=term q=wine] ::
1582+ [%pear p=term q=@] ::
1583+ [%pick p=(list wine)] ::
1584+ [%plot p=(list wine)] ::
1586+ [%tree p=term q=wine] ::
1587+ [%unit p=term q=wine] ::
1590+Printable type. `++wine` is used for pretty printing.
1594+ ~zod/try=> ~(dole ut p:!>(*@tas))
1595+ [p={} q=[%atom p=%tas]]
1596+ ~zod/try=> `wine`q:~(dole ut p:!>(*@tas))
1599+ ~zod/try=> ~(dole ut p:!>(*path))
1607+ [%plot p=~[[%face p=%i q=[%atom p=%ta]] [%face p=%t q=[%stop p=1]]]]
1614+ ~zod/try=> `wine`q:~(dole ut p:!>(*path))
1617+ ~zod/try=> ~(dole ut p:!>(*(map time cord)))
1632+ p=~[[%face p=%p q=[%atom p=%da]] [%face p=%q q=[%atom p=%t]]]
1635+ [%face p=%l q=[%stop p=1]]
1636+ [%face p=%r q=[%stop p=1]]
1646+ q=[%plot p=~[[%face p=%p q=[%atom p=%da]] [%face p=%q q=[%atom p=%t]]]]
1649+ ~zod/try=> `wine`q:~(dole ut p:!>(*(map time cord)))
1652+ q=[%plot p=~[[%face p=%p q=[%atom p=%da]] [%face p=%q q=[%atom p=%t]]]]
1655+------------------------------------------------------------------------
1659+ ++ wonk |*(veq=edge ?~(q.veq !! p.u.q.veq)) ::
1665+ ++ wonk |*(veq=edge ?~(q.veq !! p.u.q.veq)) ::
1667+Pull result out of a `++edge`, or crash if there's no result.
1669+See also: `++edge`, Section 2eC
1671+ ~zod/try=> (wide:vast [1 1] "(add 2 2)")
1675+ [ p=[%cnhp p=[%cnzz p=~[%add]] q=~[[%dtzy p=%ud q=2] [%dtzy p=%ud q=2]]]
1676+ q=[p=[p=1 q=10] q=""]
1680+ ~zod/try=> (wonk (wide:vast [1 1] "(add 2 2)"))
1681+ [%cnhp p=[%cnzz p=~[%add]] q=~[[%dtzy p=%ud q=2] [%dtzy p=%ud q=2]]]
1683+------------------------------------------------------------------------
1687+ ++ map |* [a=_,* b=_,*] :: associative tree
1688+ $|(~ [n=[p=a q=b] l=(map a b) r=(map a b)]) ::
1690+Tile generator. A `++map` is a
1691+[treap](http://en.wikipedia.org/wiki/Treap) of key, value pairs.
1695+ ~zod/try=> :type; *(map ,@t ,@u)
1698+ ~zod/try=> `(map ,@ta ,@ud)`(mo (limo a/1 b/2 ~))
1699+ {[p=~.a q=1] [p=~.b q=2]}
1701+------------------------------------------------------------------------
1705+ ++ qeu |* a=_,* :: queue
1706+ $|(~ [n=a l=(qeu a) r=(qeu a)]) ::
1708+Tile generator. A `++qeu` is an ordered
1709+[treap](http://en.wikipedia.org/wiki/Treap) of items.
1713+ ~zod/try=> (qeu time)
1714+ <1.qyo [* <1.sxx [a=<1.ebd [* <101.jzo 1.ypj %164>]> <101.jzo 1.ypj %164>]>]>
1715+ ~zod/try=> (~(gas to *(qeu time)) [~2014.1.1 ~2014.1.2 ~])
1716+ {~2014.1.2 ~2014.1.1}
1718+------------------------------------------------------------------------
1722+ ++ set |* a=_,* :: set
1723+ $|(~ [n=a l=(set a) r=(set a)]) ::
1725+Tile generator. A `++set` is a
1726+[treap](http://en.wikipedia.org/wiki/Treap) with unique values.
1730+ ~zod/try=> (sa "abc")
1732+ ~zod/try=> (~(put in (sa "abc")) %d)
1734+ ~zod/try=> (~(put in (sa "abc")) %a)
1737+------------------------------------------------------------------------
1741+ ++ jar |*([a=_,* b=_,*] (map a (list b))) :: map of lists
1743+Tile generator. A `++jar` is a `++map` of `++list`.
1745+See also: `++ja`, `++by`, `++map`, `++list`
1747+ ~zod/try=> =a (limo [1 2 ~])
1750+ ~zod/try=> =b (limo [3 4 ~])
1753+ ~zod/try=> =c (mo (limo [[%a a] [%b b] ~]))
1755+ {[p=%a q=[i=1 t=[i=2 t=~]]] [p=%b q=[i=3 t=[i=4 t=~]]]}
1756+ ~zod/try=> (~(get ja c) %a)
1758+ ~zod/try=> (~(get ja c) %c)
1761+------------------------------------------------------------------------
1765+ ++ jug |*([a=_,* b=_,*] (map a (set b))) :: map of sets
1767+Tile generator. Similar to `++jar`, but with `++set`. A `++jug` is a
1770+See also: `++ju`, `++by`, `++map`, `++set`
1772+ ~zod/try=> =a (sa (limo [1 2 ~]))
1775+ ~zod/try=> =b (sa (limo [3 4 ~]))
1778+ ~zod/try=> =c (mo (limo [[%a a] [%b b] ~]))
1780+ {[p=%a q={1 2}] [p=%b q={4 3}]}
1781+ ~zod/try=> (~(get ju c) %b)
1783+ ~zod/try=> (~(put ju c) [%b 5])
1784+ {[p=%a q={1 2}] [p=%b q={5 4 3}]}
1786+------------------------------------------------------------------------