@@ -6,23 +6,22 @@ navhome: /docs/
6# 2q: molds and mold builders
6# 2q: molds and mold builders
7### `++char`
7### `++char`
11−A single character. odor `@tD` designates a single unicode byte. All
11+A single character. Aura `@tD` designates a single UTF-8 byte. All parsers
12−parsers consume `++tape`s, which are lists of `++char`.
12+consume `tape`s, which are lists of `char`.
18− ++ char @tD :: UTF-8 byte
17+ ++ char @tD
20−Examples
19+#### Examples
25− ~zod/try> (char 97)
23+
@@ -32,123 +31,201 @@ Examples
35−One of Hoon's two string types (the other being `++tape`). A cord is an
34+One of Hoon's two string types (the other being `tape`). A cord is an
36−atom of UTF-8 text. `++trip` and `++crip` convert between cord and
35+atom of UTF-8 text.
42− ++ cord @t :: text atom (UTF-8)
39+ ++ cord @t
44−Examples
41+#### Examples
47−Odor `@t` designates a Unicode atom, little-endian: the first character
48−in the text is the low byte.
50 > `@ux`'foobar'
47 > `@ux`'foobar'
51 0x7261.626f.6f66
48 0x7261.626f.6f66
53 > `@`'urbit'
53 > `@`'urbit'
54 499.984.265.845
54 499.984.265.845
55− > (cord 499.984.265.845)
56+ > `@t`499.984.265.845
62+Aura `@t` designates a Unicode atom, little-endian: the first character
63+in the text is the least-significant byte.
65+[`trip`](../4b) converts from `cord` to `tape`, and [`crip`](../4b) converts
66+from `tape` to `cord`.
61### `++date`
71### `++date`
63Point in time
73Point in time
65−A boolean designating AD or BC, a year atom, a month
75+A boolean designating AD or BC, a year atom, a month atom, and a `tarp`,
66−atom, and a `++tarp`, which is a day atom and a time.
76+which is a day atom and a time.
71− ++ date {{a/? y/@ud} m/@ud t/tarp} :: parsed date
80+ ++ date [[a=? y=@ud] m=@ud t=tarp]
74−Examples
83+#### Examples
77−See also: `++year`, `++yore` `++stud`, `++dust`
85+ > *date
86+ [[a=%.y y=0] m=0 t=[d=0 h=0 m=0 s=0 f=~]]
79 > `date`(yore ~2014.6.6..21.09.15..0a16)
88 > `date`(yore ~2014.6.6..21.09.15..0a16)
80 [[a=%.y y=2.014] m=6 t=[d=6 h=21 m=9 s=15 f=~[0xa16]]]
89 [[a=%.y y=2.014] m=6 t=[d=6 h=21 m=9 s=15 f=~[0xa16]]]
92+ ~2018.5.25..17.55.15..9ad8
98+See also: [`year`](../3c), [`yore`](../3c) [`stud`](../2q), [`dust`](../2q)
105+An atom type that only permits ASCII characters.
84### `++tang`
121### `++tang`
123+Generic print structure
125+A list of `tank`s. It's for printing types and bottom-up printing of stack
86− ++ tang (list tank) :: general error
130+++ tang (list tank)
88−Unused XX
132+#### Examples
137+ > (~(win re [%palm ["1" "2" "3" "4"] [%leaf "foobar"] [%leaf "bazbud"] [%leaf "zzzzzzqaaa"] ~]) 0 50)
138+ <<"23foobar1bazbud1zzzzzzqaaa4">>
140+ > (~(win re [%palm ["1" "2" "3" "4"] [%leaf "foobar"] [%leaf "bazbud"] [%leaf "zzzzzzqaaa"] ~]) 0 10)
141+ <<"2 foobar" " bazbud" "zzzzzzqaaa">>
143+ > (~(win re [%rose ["1" "2" "3"] [%leaf "foobar"] [%leaf "bazbud"] ~]) 0 20)
144+ <<"2foobar1bazbud3">>
146+ > (~(win re [%rose ["1" "2" "3"] [%leaf "foobar"] [%leaf "bazbud"] ~]) 0 10)
147+ <<"2 foobar" " bazbud" "3">>
93### `++tank`
151### `++tank`
95−Pretty-printing structure.
153+Pretty-printing structure
155+A `tank` is one of three cases: a `%leaf` is simply a string (a printed line);
156+ a `%palm` is list of `tank` delimited by the strings in `p`, with back-steps at
157+new lines; and a `%rose` is a list of `tank` delimited by the strings in `p`
158+without back-steps at new lines.
97−A `++tank` is one of three cases: a `%leaf`
98−is simply a string; a `%palm` is XX need more information; and a `%rose` is a
99−list of `++tank` delimted by the strings in `p`.
102−Source
163+ ++ tank $% [$leaf p=tape]
165+ p=[p=tape q=tape r=tape s=tape]
169+ p=[p=tape q=tape r=tape]
105− ++ tank $% {$leaf p/tape} :: printing formats
174+#### Examples
106− $: $palm :: backstep list
107− p/{p/tape q/tape r/tape s/tape} ::
110− $: $rose :: flat list
111− p/{p/tape q/tape r/tape} :: mid open close
117−--------
177+ [%rose p=[p="" q="" r=""] q=~]
119− > >(bex 20) (bex 19)<
120− [%rose p=[p=" " q="[" r="]"] q=~[[%leaf p="1.048.576"] [%leaf p="524.288"]]]
121− > (wash [0 80] >(bex 20) (bex 19)<) :: at 80 cols
179+ > (wash [0 80] >(bex 20) (bex 19)<) :: at 80 cols
122 <<"[1.048.576 524.288]">>
180 <<"[1.048.576 524.288]">>
123− > (wash [0 15] >(bex 20) (bex 19)<) :: at 15 cols (two lines)
182+ > (wash [0 15] >(bex 20) (bex 19)<) :: at 15 cols
124 <<"[ 1.048.576" " 524.288" "]">>
183 <<"[ 1.048.576" " 524.288" "]">>
126− > [(bex 150) (bex 151)] :: at 80 cols
185+ > [(bex 150) (bex 151)] :: at 80 cols
127 [ 1.427.247.692.705.959.881.058.285.969.449.495.136.382.746.624
186 [ 1.427.247.692.705.959.881.058.285.969.449.495.136.382.746.624
128 2.854.495.385.411.919.762.116.571.938.898.990.272.765.493.248
187 2.854.495.385.411.919.762.116.571.938.898.990.272.765.493.248
190+ > (wash [0 40] >(bex 150) (bex 151)<)
192+ "[ \\/1.427.247.692.705.959.881.058.285.\\/"
193+ " 969.449.495.136.382.746.624"
195+ " \\/2.854.495.385.411.919.762.116.571.\\/"
196+ " 938.898.990.272.765.493.248"
135### `++tape`
204### `++tape`
137−List of chars
206+List of characters
139−One of Hoon's two string types, the other being `++cord`. A tape is a
208+One of Hoon's two string types, the other being `++cord`. A tape is a list of
140−list of chars.
209+`char`.
142−Source
211+#### Source
145− ++ tape (list char) :: like a string
213+ ++ tape (list @tD)
147−Examples
223+ >`(list @t)`"foobar"
148−--------
224+ <|f o o b a r|>
150− > `(list char)`"foobar"
226+ >`(list @tD)`"foobar"
152 > `(list @)`"foobar"
229 > `(list @)`"foobar"
153 ~[102 111 111 98 97 114]
230 ~[102 111 111 98 97 114]
@@ -156,26 +233,27 @@ Examples
157### `++tarp`
234### `++tarp`
159−Day through second
236+Parsed time
238+The time component of a `date`: day, hour, minute, second and a list of `@ux`
161−The remaining part of a `++date`: day, hour, minute, second and a list
243+ ++ tarp [d=@ud h=@ud m=@ud s=@ud f=(list @ux)]
162−of `@ux` for precision.
167− ++ tarp {d/@ud h/@ud m/@ud s/@ud f/(list @ux)} :: parsed time
246+#### Examples
171−--------
250+ [d=0 h=0 m=0 s=0 f=~]
253+ [d=106.751.991.821.625 h=22 m=58 s=10 f=~[0x44ff]]
174− > -<-
255+ > `tarp`(yell ~2014.6.6..21.09.15..0a16)
175− ~2014.9.20..00.43.33..b52a
176− > :: the time is always in your context at -<-
178− [d=106.751.991.820.278 h=0 m=43 s=39 f=~[0x54d1]]
256+ [d=106.751.991.820.172 h=21 m=9 s=15 f=~[0xa16]]
180 > (yell ~d20)
258 > (yell ~d20)
181 [d=20 h=0 m=0 s=0 f=~]
259 [d=20 h=0 m=0 s=0 f=~]
@@ -185,42 +263,51 @@ Examples
186### `++term`
264### `++term`
188−Hoon constants
266+Hoon constant
190A restricted text atom for Hoon constants. The only characters permitted are
268A restricted text atom for Hoon constants. The only characters permitted are
191−lowercase ASCII, `-`, and `0-9`, the latter two of which can neither be the first or last
269+lowercase ASCII letters, `-`, and `0-9`, the latter two of which cannot be the
192−character. The syntax for `@tas` is the text itself, always preceded by `%`.
270+first character. The syntax for `@tas` is the text itself, always preceded by
193−This means a term is always cubical. The empty `@tas` has a special syntax,
271+`%`. The empty `@tas` has a
194−`$`.
272+special syntax, `$`.
197−Source
275+#### Source
200− ++ term @tas :: Hoon ASCII subset
277+ ++ term @tas
202−Examples
279+#### Examples
208 > %dead-fish9
287 > %dead-fish9
209 %dead-fish9
288 %dead-fish9
210 > -:!>(%dead-fish9)
290 > -:!>(%dead-fish9)
211− [%cube p=271.101.667.197.767.630.546.276 q=[%atom p=%tas]]
291+ #t/$dead-fish9
216### `++wain`
296### `++wain`
218− ++ wain (list cord) :: text lines (no \n)
298+List of strings
300+A list of `cord`s. A `wain` is used instead of a single `cord` with `\n`.
220−A list of lines. A `++wain` is used instead of a single `++cord` with
223−See also: `++lore`, `++role`
303+#### Source
225 > `wain`/som/del/rok
312 > `wain`/som/del/rok
226 <|som del rok|>
313 <|som del rok|>
@@ -229,28 +316,31 @@ See also: `++lore`, `++role`
230### `++wall`
317### `++wall`
232−List of lines
319+List of list of characters
321+A list of `tape`s. `wall` is used instead of a single `tape` with `\n`.
235−A `++wall` is used instead of a single `++tape` with
323+#### Source
238−Source
325+ ++ wall (list tape)
241− ++ wall (list tape) :: text lines (no \n)
243−Examples
327+#### Examples
248 > `wall`(wash [0 20] leaf+<(bex 256)>)
332 > `wall`(wash [0 20] leaf+<(bex 256)>)
250− "115.792.089.237.316.195.423.570.985.008.687.907.853.269.984.665.640.564.039.457.584.007.913.129.639.936"
334+ "\\/115.792.089.237.\\/"