@@ -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 unicode 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)
24+ > (char 97)
@@ -32,123 +31,185 @@ 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'
44 > `@ux`'foobar'
51 0x7261.626f.6f66
45 0x7261.626f.6f66
53 > `@`'urbit'
50 > `@`'urbit'
54 499.984.265.845
51 499.984.265.845
55 > (cord 499.984.265.845)
53 > (cord 499.984.265.845)
59+Aura `@t` designates a Unicode atom, little-endian: the first character
60+in the text is the least-significant byte.
62+[`trip`](../4b) converts from `cord` to `tape`, and [`crip`](../4b) converts
63+from `tape` to `cord`.
61### `++date`
68### `++date`
63Point in time
70Point in time
65−A boolean designating AD or BC, a year atom, a month
72+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.
73+which is a day atom and a time.
71− ++ date {{a/? y/@ud} m/@ud t/tarp} :: parsed date
75+#### Source
77+ ++ date [[a=? y=@ud] m=@ud t=tarp]
77−See also: `++year`, `++yore` `++stud`, `++dust`
80+#### Examples
79 > `date`(yore ~2014.6.6..21.09.15..0a16)
82 > `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]]]
83 [[a=%.y y=2.014] m=6 t=[d=6 h=21 m=9 s=15 f=~[0xa16]]]
86+ ~2018.5.25..17.55.15..9ad8
92+See also: [`year`](../3c), [`yore`](../3c) [`stud`](../2q), [`dust`](../2q)
99+An atom type that only permits ASCII characters.
84### `++tang`
113### `++tang`
86− ++ tang (list tank) :: general error
115+Generic print structure
117+A list of `tank`s. It's for printing types and bottom-up printing of stack
88−Unused XX
120+#### Source
126+ > (~(win re [%palm ["1" "2" "3" "4"] [%leaf "foobar"] [%leaf "bazbud"] [%leaf "zzzzzzqaaa"] ~]) 0 50)
127+ <<"23foobar1bazbud1zzzzzzqaaa4">>
129+ > (~(win re [%palm ["1" "2" "3" "4"] [%leaf "foobar"] [%leaf "bazbud"] [%leaf "zzzzzzqaaa"] ~]) 0 10)
130+ <<"2 foobar" " bazbud" "zzzzzzqaaa">>
132+ > (~(win re [%rose ["1" "2" "3"] [%leaf "foobar"] [%leaf "bazbud"] ~]) 0 20)
133+ <<"2foobar1bazbud3">>
135+ > (~(win re [%rose ["1" "2" "3"] [%leaf "foobar"] [%leaf "bazbud"] ~]) 0 10)
136+ <<"2 foobar" " bazbud" "3">>
93### `++tank`
140### `++tank`
95−Pretty-printing structure.
142+Pretty-printing structure
144+A `tank` is one of three cases: a `%leaf` is simply a string (a printed line);
145+ a `%palm` is list of `tank` delimited by the strings in `p`, with back-steps at
146+new lines; and a `%rose` is a list of `tank` delimited by the strings in `p`
147+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
152+ ++ tank $% [$leaf p=tape]
154+ p=[p=tape q=tape r=tape s=tape]
158+ p=[p=tape q=tape r=tape]
105− ++ tank $% {$leaf p/tape} :: printing formats
163+#### 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
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
166+ > (wash [0 80] >(bex 20) (bex 19)<) :: at 80 cols
122 <<"[1.048.576 524.288]">>
167 <<"[1.048.576 524.288]">>
123− > (wash [0 15] >(bex 20) (bex 19)<) :: at 15 cols (two lines)
169+ > (wash [0 15] >(bex 20) (bex 19)<) :: at 15 cols
124 <<"[ 1.048.576" " 524.288" "]">>
170 <<"[ 1.048.576" " 524.288" "]">>
126− > [(bex 150) (bex 151)] :: at 80 cols
172+ > [(bex 150) (bex 151)] :: at 80 cols
127 [ 1.427.247.692.705.959.881.058.285.969.449.495.136.382.746.624
173 [ 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
174 2.854.495.385.411.919.762.116.571.938.898.990.272.765.493.248
177+ > (wash [0 40] >(bex 150) (bex 151)<)
179+ "[ \\/1.427.247.692.705.959.881.058.285.\\/"
180+ " 969.449.495.136.382.746.624"
182+ " \\/2.854.495.385.411.919.762.116.571.\\/"
183+ " 938.898.990.272.765.493.248"
135### `++tape`
191### `++tape`
137−List of chars
193+List of characters
139−One of Hoon's two string types, the other being `++cord`. A tape is a
195+One of Hoon's two string types, the other being `++cord`. A tape is a list of
140−list of chars.
196+`char`.
142−Source
198+#### Source
145− ++ tape (list char) :: like a string
200+ ++ tape (list @tD)
147−Examples
202+#### Examples
150− > `(list char)`"foobar"
204+ > `tape`"foobar"
207+ >`(list @t)`"foobar"
210+ >`(list @tD)`"foobar"
152 > `(list @)`"foobar"
213 > `(list @)`"foobar"
153 ~[102 111 111 98 97 114]
214 ~[102 111 111 98 97 114]
@@ -156,26 +217,27 @@ Examples
157### `++tarp`
218### `++tarp`
159−Day through second
220+Parsed time
222+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
225+#### Source
162−of `@ux` for precision.
164−Source
227+ ++ tarp [d=@ud h=@ud m=@ud s=@ud f=(list @ux)]
167− ++ tarp {d/@ud h/@ud m/@ud s/@ud f/(list @ux)} :: parsed time
234+ [d=0 h=0 m=0 s=0 f=~]
174− > -<-
236+ > (yell now)
175− ~2014.9.20..00.43.33..b52a
237+ [d=106.751.991.821.625 h=22 m=58 s=10 f=~[0x44ff]]
176− > :: the time is always in your context at -<-
238+
177− > (yell -<-)
239+ > `tarp`(yell ~2014.6.6..21.09.15..0a16)
178− [d=106.751.991.820.278 h=0 m=43 s=39 f=~[0x54d1]]
240+ [d=106.751.991.820.172 h=21 m=9 s=15 f=~[0xa16]]
180 > (yell ~d20)
242 > (yell ~d20)
181 [d=20 h=0 m=0 s=0 f=~]
243 [d=20 h=0 m=0 s=0 f=~]
@@ -185,42 +247,48 @@ Examples
186### `++term`
248### `++term`
188−Hoon constants
250+Hoon constant
190A restricted text atom for Hoon constants. The only characters permitted are
252A 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
253+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 `%`.
254+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,
255+`%`. The empty `@tas` has a
194−`$`.
256+special syntax, `$`.
197−Source
259+#### Source
200− ++ term @tas :: Hoon ASCII subset
261+ ++ term @tas
202−Examples
263+#### Examples
208 > %dead-fish9
271 > %dead-fish9
209 %dead-fish9
272 %dead-fish9
210 > -:!>(%dead-fish9)
274 > -:!>(%dead-fish9)
211− [%cube p=271.101.667.197.767.630.546.276 q=[%atom p=%tas]]
275+ #t/$dead-fish9
216### `++wain`
280### `++wain`
218− ++ wain (list cord) :: text lines (no \n)
282+List of strings
220−A list of lines. A `++wain` is used instead of a single `++cord` with
284+A list of `cord`s. A `wain` is used instead of a single `cord` with `\n`.
223−See also: `++lore`, `++role`
286+
225 > `wain`/som/del/rok
293 > `wain`/som/del/rok
226 <|som del rok|>
294 <|som del rok|>
@@ -229,28 +297,29 @@ See also: `++lore`, `++role`
230### `++wall`
298### `++wall`
232−List of lines
300+List of list of characters
302+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
304+#### Source
238−Source
306+ ++ wall (list tape)
241− ++ wall (list tape) :: text lines (no \n)
308+#### Examples
248 > `wall`(wash [0 20] leaf+<(bex 256)>)
311 > `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"
313+ "\\/115.792.089.237.\\/"