@@ -5,6 +5,21 @@ section 3bD, JSON and XML
55
66Mime type to `++cord`
77
8+Renders a [mime](http://en.wikipedia.org/wiki/MIME) type path with infix
9+`/` to a [`++cord`]().
10+Accepts
11+-------
12+
13+`myn` is a ++[`mite`](), a [`++list`]() of [`@ta`]().
14+
15+Produces
16+--------
17+
18+A `++cord`.
19+
20+Source
21+------
22+
823 ++ moon :: mime type to text
924 |= myn=mite
1025 %+ rap
@@ -15,10 +30,8 @@ Mime type to `++cord`
1530 (weld (trip i.myn) `tape`['/' $(myn t.myn)])
1631 ::
1732
18−Renders a [mime](http://en.wikipedia.org/wiki/MIME) type path with infix
19−`/` to a [cord]().
20−
21−`myn` is a ++[mite](), a list of [@ta]().
33+Examples
34+--------
2235
2336 ~zod/try=> `@t`(moon /image/png)
2437 'image/png'
@@ -31,29 +44,43 @@ Renders a [mime](http://en.wikipedia.org/wiki/MIME) type path with infix
3144
3245Parse cube with fork
3346
34− ++ perk :: parse cube with fork
35− |* a=(pole ,@tas)
36− ?~ a fail
37− ;~ pose
38− (cold -.a (jest -.a))
39− $(a +.a)
40− ==
41− ::
42−
4347Parser generator. Produces a parser that succeeds upon encountering one
4448of the [`++term`]()s in a faceless list `a`.
4549
46−A- perk is an arm used to parse one of a finite set of options, formally
47−a choice between terms: if you want to match "true" or "false", and
50+A perk is an arm used to parse one of a finite set of options, formally
51+a choice between [`++term`]()s: if you want to match "true" or "false", and
4852nothing else, (perk \~[%true %false]) produces the relevant parser,
4953whose result type is `?(%true %false)`. For more complicated
50−transformations, a combintation of ++sear and map ++get is recommended,
54+transformations, a combintation of ++[`++sear`]() and map ++[`++get`]() is recommended,
5155e.g. `(sear ~(get by (mo ~[[%true &] [%false |]]))) sym)` will have a
52−similar effect but produce `?(& |)` ,a loobean. However, constructions
56+similar effect but produce `?(& |)` , a [boolean](). However, constructions
5357such as `(sear (flit ~(has in (sa %true %false %other ~))) sym)` are
5458needlessly unwieldy.
5559
56−`a` is a [`++pole`](), which is a [`++list`]() without [`%face`]()s
60+Accepts
61+-------
62+
63+`a` is a [`++pole`](), which is a [`++list`]() without [`%face`]()s.
64+
65+Produces
66+--------
67+
68+XX
69+
70+Source
71+------
72+
73+ ++ perk :: parse cube with fork
74+ |* a=(pole ,@tas)
75+ ?~ a fail
76+ ;~ pose
77+ (cold -.a (jest -.a))
78+ $(a +.a)
79+ ==
80+ ::
81+
82+Examples
83+--------
5784
5885 ~zod/try=> (scan "ham" (perk %sam %ham %lam ~))
5986 %ham
@@ -65,14 +92,29 @@ needlessly unwieldy.
6592
6693JSON parser core
6794
95+JSON parser core: parses a [`++cord`]() `a` to the hoon structure for JSON,
96+a [`++json`]().
97+
98+Accepts
99+-------
100+
101+`a` is [`++cord`]().
102+
103+Produces
104+--------
105+
106+
107+A `(like json)`.
108+
109+Source
110+------
111+
68112 ++ poja :: JSON parser core
69113 =< |=(a=cord (rush a apex))
70114 |%
71115
72−JSON parser core: parses a `++cord` `a` to the hoon structure for JSON,
73−a [`++json`]().
74−
75−`a` is [`++cord`]().
116+Examples
117+--------
76118
77119 ~zod/try=> (poja '[1,2,3]')
78120 [~ [%a p=~[[%n p=~.1] [%n p=~.2] [%n p=~.3]]]]
@@ -81,19 +123,30 @@ a [`++json`]().
81123 ~zod/try=> (poja 'invalid{json')
82124 ~
83125
84−### `++apex`
126+### `++tops`
85127
86128Parse object
87129
88− ++ apex ;~(pose abox obox) :: JSON object
89−
90−Top level parsing rule. Parses either a single JSON object, or an array
130+Top level parsing [`++rule`](). Parses either a single JSON object, or an array
91131of JSON objects to a [`++json`](). See also: [`++abox`](), [`++obox`]().
92132
93−A- this is now called ++tops, and ++apex is the old ++valu, which
94−apparently didn't make its way into the docs. Apologies for the
95−confusion, many things have been restructured in ++shell inconsistently
96−with current test:urbit.git
133+Accepts
134+-------
135+
136+A [`++nail`]().
137+
138+Produces
139+--------
140+
141+A `(like json)`.
142+
143+Source
144+------
145+
146+ ++ apex ;~(pose abox obox) :: JSON object
147+
148+Examples
149+--------
97150
98151 ~zod/try=> (rash '[1,2]' apex:poja)
99152 [%a p=~[[%n p=~.1] [%n p=~.2]]]
@@ -103,10 +156,25 @@ with current test:urbit.git
103156 ! {1 1}
104157 ! exit
105158
106−### `++valu`
159+### `++apex`
107160
108161Parse value
109162
163+Parsing [`++rule`](). Parses JSON values to [`++json`]().
164+
165+Accepts
166+-------
167+
168+A [`++nail`]().
169+
170+Produces
171+--------
172+
173+A `(like json)`.
174+
175+Source
176+------
177+
110178 ++ valu :: JSON value
111179 %+ knee *json |. ~+
112180 ;~ pfix spac
@@ -120,7 +188,8 @@ Parse value
120188 ==
121189 ==
122190
123−Parsing rule. Parses JSON values to [`++json`]().
191+Examples
192+--------
124193
125194 ~zod/try=> (rash '[1,2]' valu:poja)
126195 [%a p=~[[%n p=~.1] [%n p=~.2]]]
@@ -139,11 +208,27 @@ Parsing rule. Parses JSON values to [`++json`]().
139208
140209Parse array
141210
142− ++ abox (stag %a (ifix [sel (ws ser)] (more (ws com) valu)))
143−
144211Parsing rule. Parses a JSON array with values enclosed within `[]` and
145212delimited by a `,`.
146213
214+Accepts
215+-------
216+
217+A [`++nail`]().
218+
219+Produces
220+--------
221+
222+A `(like json)`.
223+
224+Source
225+------
226+
227+ ++ abox (stag %a (ifix [sel (ws ser)] (more (ws com) valu)))
228+
229+Examples
230+--------
231+
147232 ~zod/try=> (rash '[1, 2,4]' abox:poja)
148233 [[%n p=~.1] ~[[%n p=~.2] [%n p=~.4]]]
149234
@@ -154,11 +239,27 @@ JSON Objects
154239
155240Parse key value pair
156241
157− ++ pair ;~(plug ;~(sfix (ws stri) (ws col)) valu)
158−
159242Parsing rule. Parses a [`++json`]() from a JSON key-value pair of a
160243string and value delimited by `:`.
161244
245+Accepts
246+-------
247+
248+A [`++nail`]().
249+
250+Produces
251+--------
252+
253+A `(like json)`.
254+
255+Source
256+------
257+
258+ ++ pair ;~(plug ;~(sfix (ws stri) (ws col)) valu)
259+
260+Examples
261+--------
262+
162263 ~zod/try=> (rash '"ham": 2' pair:poja)
163264 ['ham' [%n p=~.2]]
164265
@@ -166,11 +267,27 @@ string and value delimited by `:`.
166267
167268Parse array of objects
168269
169− ++ obje (ifix [(ws kel) (ws ker)] (more (ws com) pair))
170−
171270Parsing rule. Parses a [`++json`]() from an array of JSON object
172271key-value pairs that are enclosed within `{}` and separated by `,`.
173272
273+Accepts
274+-------
275+
276+A [`++nail`]().
277+
278+Produces
279+--------
280+
281+A `(like ,[%o p=(map ,@t json)])`
282+
283+Source
284+------
285+
286+ ++ obje (ifix [(ws kel) (ws ker)] (more (ws com) pair))
287+
288+Examples
289+--------
290+
174291 ~zod/try=> (rash '{"ham": 2, "lam":true}' obje:poja)
175292 [['ham' [%n p=~.2]] ~[['lam' [%b p=%.y]]]]
176293
@@ -178,10 +295,25 @@ key-value pairs that are enclosed within `{}` and separated by `,`.
178295
179296Parse boxed object
180297
298+Parsing rule. Parses an array of JSON objects to an object of [`++json`](). See also: [`++json`]().
299+
300+Accepts
301+-------
302+
303+A [`++nail`]().
304+
305+Produces
306+--------
307+
308+A `(like ,[%o p=(map ,@t json)])`
309+
310+Source
311+------
312+
181313 ++ obox (stag %o (cook mo obje))
182314
183−Parsing rule. Parses an array of JSON objects to a [`++json`]() map with
184−a tag of `%o`. See also: [`++json`]().
315+Examples
316+--------
185317
186318 ~zod/try=> (rash '{"ham": 2, "lam":true}' obox:poja)
187319 [%o {[p='lam' q=[%b p=%.y]] [p='ham' q=[%n p=~.2]]}]
@@ -193,11 +325,29 @@ JSON Booleans
193325
194326Parse boolean
195327
196− ++ bool ;~(pose (cold & (jest 'true')) (cold | (jest 'false')))
197−
198328Parsing rule. Parses a string of either `true` or `false` to a
199329[`++json`]() boolean.
200330
331+
332+Accepts
333+-------
334+
335+A [`++nail`]().
336+
337+Produces
338+--------
339+
340+
341+A `(like ,[%b p=?])`
342+
343+Source
344+------
345+
346+ ++ bool ;~(pose (cold & (jest 'true')) (cold | (jest 'false')))
347+
348+Examples
349+--------
350+
201351 ~zod/try=> (rash 'true' bool:poja)
202352 %.y
203353 ~zod/try=> (rash 'false' bool:poja)
@@ -213,13 +363,29 @@ JSON strings
213363
214364Parse string
215365
216− ++ stri
217− (cook crip (ifix [doq doq] (star jcha)))
218−
219366Parsing rule. Parse a string to a [`++cord`](). A JSON string is a list
220367of characters enclosed in double quotes along with escaping `\`s, to a
221368[`++cord`](). See also [`++jcha`]().
222369
370+Accepts
371+-------
372+
373+A [`++nail`]().
374+
375+Produces
376+--------
377+
378+A `(like ,[%s p=@t])`.
379+
380+Source
381+------
382+
383+ ++ stri
384+ (cook crip (ifix [doq doq] (star jcha)))
385+
386+Examples
387+--------
388+
223389 ~zod/try=> (rash '"ham"' stri:poja)
224390 'ham'
225391 ~zod/try=> (rash '"h\\nam"' stri:poja)
@@ -232,11 +398,28 @@ of characters enclosed in double quotes along with escaping `\`s, to a
232398
233399Parse char from string
234400
235− ++ jcha ;~(pose ;~(less doq bas prn) esca) :: character in string
236−
237401Parsing rule. Parses either a literal or escaped character from a JSON
238402string to a [`++cord`]().
239403
404+
405+Accepts
406+-------
407+
408+A [`++nail`]().
409+
410+Produces
411+--------
412+
413+A `(like cord)`.
414+
415+Source
416+------
417+
418+ ++ jcha ;~(pose ;~(less doq bas prn) esca) :: character in string
419+
420+Examples
421+--------
422+
240423 ~zod/try=> (rash 'a' jcha:poja)
241424 'a'.
242425 ~zod/try=> (rash '!' jcha:poja)
@@ -253,6 +436,23 @@ string to a [`++cord`]().
253436
254437Parse escaped char
255438
439+Parsing rule. Parses a backslash-escaped special character, low ASCII,
440+or UTF16 codepoint, to a [`++cord`]().
441+
442+
443+Accepts
444+-------
445+
446+A [`++nail`]().
447+
448+Produces
449+--------
450+
451+A `(like cord)`.
452+
453+Source
454+------
455+
256456 ++ esca :: Escaped character
257457 ;~ pfix bas
258458 ;~ pose
@@ -261,8 +461,8 @@ Parse escaped char
261461 ;~(pfix (just 'u') (cook tuft qix:ab)) :: 4-digit hex to UTF-8
262462 ==
263463
264−Parsing rule. Parses a backslash-escaped special character, low ASCII,
265−or UTF16 codepoint, to a [`++cord`]().
464+Examples
465+--------
266466
267467 ~zod/try=> (rash 'b' esca:poja)
268468 ! {1 1}
@@ -282,7 +482,7 @@ or UTF16 codepoint, to a [`++cord`]().
282482JSON numbers
283483------------
284484
285−A- JSON numbers are stored as cords internally in lieu of full float
485+A JSON numbers are stored as cords internally in lieu of full float
286486support, so ++numb and subarms are really more *validators* than parsers
287487per se.
288488
@@ -290,6 +490,22 @@ per se.
290490
291491Parse number
292492
493+Parsing rule. Parses decimal numbers with an optional `-`, fractional
494+part, or exponent part, to a [`++tape`]().
495+
496+Accepts
497+-------
498+
499+A [`++nail`]().
500+
501+Produces
502+--------
503+
504+An [`++edge`]() of a [`++tape`]().
505+
506+Source
507+------
508+
293509 ++ numb
294510 ;~ (comp twel)
295511 (mayb (piec hep))
@@ -301,8 +517,8 @@ Parse number
301517 (mayb expo)
302518 ==
303519
304−Parsing rule. Parses decimal numbers with an optional `-`, fractional
305−part, or exponent part, to a [`++cord`]().
520+Examples
521+--------
306522
307523 ~zod/try=> (rash '0' numb:poja)
308524 ~[~~0]
@@ -322,9 +538,25 @@ part, or exponent part, to a [`++cord`]().
322538
323539Parse 1-9
324540
541+Parsing rule. Parses digits `0` through `9` to a [`++tape`]().
542+
543+Accepts
544+-------
545+
546+A [`++nail`]().
547+
548+Produces
549+--------
550+
551+The [`++edge`]() of a `++tape`.
552+
553+Source
554+------
555+
325556 ++ digs (star (shim '0' '9'))
326557
327−Parsing rule. Parses digits `0` through `9` to a [`++tape`]().
558+Examples
559+--------
328560
329561 ~zod/try=> (rash '' digs:poja)
330562 ""
@@ -339,6 +571,22 @@ Parsing rule. Parses digits `0` through `9` to a [`++tape`]().
339571
340572Parse exponent part
341573
574+Parsing rule. Parses an exponent to a [`++tape`]() .An exponent is an
575+`e` or 'E', followed by an optional `+` or `-`, and then by digits.
576+
577+Accepts
578+-------
579+
580+A [`++nail`]().
581+
582+Produces
583+--------
584+
585+The [`++edge`]() of a `++tape`.
586+
587+Source
588+------
589+
342590 ++ expo :: Exponent part
343591 ;~ (comp twel)
344592 (piec (mask "eE"))
@@ -346,8 +594,8 @@ Parse exponent part
346594 digs
347595 ==
348596
349−Parsing rule. Parses an exponent to a [`++cord`](). An exponent is an
350−`e`, followed by an optional `+` or `-`, followed by digits.
597+Examples
598+--------
351599
352600 ~zod/try=> `tape`(rash 'e7' expo:poja)
353601 "e7"
@@ -360,9 +608,25 @@ Parsing rule. Parses an exponent to a [`++cord`](). An exponent is an
360608
361609Fractional part
362610
611+Parsing rule. Parses a dot followed by digits to a [`++cord`]().
612+
613+Accepts
614+-------
615+
616+A `++nail`.
617+
618+Produces
619+--------
620+
621+The [`++edge`]() of a `++tape`.
622+
623+Source
624+------
625+
363626 ++ frac ;~(plug dot digs) :: Fractional part
364627
365−Parsing rule. Parses a dot followed by digits to a [`++cord`]().
628+Examples
629+--------
366630
367631 ~zod/try=> (rash '.25' frac:poja)
368632 [~~~. "25"]
@@ -378,9 +642,25 @@ whitespace
378642
379643Parse whitespace
380644
645+Parsing rule. Parses a whitespace to a [`++tape`]().
646+
647+Accepts
648+-------
649+
650+A [`++nail`]().
651+
652+Produces
653+--------
654+
655+A `(like tape)`.
656+
657+Source
658+------
659+
381660 ++ spac (star (mask [`@`9 `@`10 `@`13 ' ' ~]))
382661
383−Parsing rule. Parses a whitespace to a [`++tape`]().
662+Examples
663+--------
384664
385665 ~zod/try=> (scan "" spac:poja)
386666 ""
@@ -396,13 +676,27 @@ Parsing rule. Parses a whitespace to a [`++tape`]().
396676
397677Allow prefix whitespace
398678
399− ++ ws |*(sef=_rule ;~(pfix spac sef))
400−
401679Parser modifier. Produces a rule that allows for a whitespace before
402680applying `sef`.
403681
682+Accepts
683+-------
684+
404685`sef` is a [`++rule`]().
405686
687+Produces
688+--------
689+
690+A `++rule`.
691+
692+Source
693+------
694+
695+ ++ ws |*(sef=_rule ;~(pfix spac sef))
696+
697+Examples
698+--------
699+
406700 ~zod/try=> (rash ' 4' digs:poja)
407701 ! {1 1}
408702 ! exit
@@ -421,9 +715,25 @@ Plumbing
421715
422716Maybe parse
423717
718+Parser modifier. Need to document, an example showing failure.
719+
720+Accepts
721+-------
722+
723+XX
724+
725+Produces
726+--------
727+
728+XX
729+
730+Source
731+------
732+
424733 ++ mayb |*(bus=_rule ;~(pose bus (easy "")))
425734
426−Parser modifier. Need to document, an example showing failure.
735+Examples
736+--------
427737
428738 ~zod/try=> (abox:poja 1^1 "not-an-array")
429739 [p=[p=1 q=1] q=~]
@@ -434,14 +744,28 @@ Parser modifier. Need to document, an example showing failure.
434744
435745Weld two tapes
436746
437− ++ twel |=([a=tape b=tape] (weld a b))
747+Concatenates two tapes, `a` and `b`, producing a [`++tape`]().
438748
439−Concatenates two tapes, `a` and `b`, producing a `++tape`.
749+Accepts
750+-------
440751
441752`a` is a [`++tape`]().
442753
443754`b` is a [`++tape`]().
444755
756+Produces
757+--------
758+
759+The [`++edge`]() of a `++tape`.
760+
761+Source
762+------
763+
764+ ++ twel |=([a=tape b=tape] (weld a b))
765+
766+Examples
767+--------
768+
445769 ~zod/try=> (twel "sam" "hok"):poja
446770 ~[~~s ~~a ~~m ~~h ~~o ~~k]
447771 ~zod/try=> (twel "kre" ""):poja
@@ -451,23 +775,52 @@ Concatenates two tapes, `a` and `b`, producing a `++tape`.
451775
452776Parse char to list
453777
778+Parser modifer. Parses an atom with `bus` and then wraps it in a
779+[`++list`]().
780+
781+Accepts
782+-------
783+
784+`bus` is a [`++rule`]().
785+
786+Produces
787+--------
788+
789+A `++rule`.
790+
791+Source
792+------
793+
454794 ++ piec
455795 |* bus=_rule
456796 (cook |=(a=@ [a ~]) bus)
457797 ::
458798
459−Parser modifer. Parses an atom with `bus` and then wraps it in a
460−[`++list`]().
461−
462−`bus` is a [`++rule`]().
799+Examples
800+--------
463801
464− ~zod/try=> (scan "4" (piec:poja dem:ag))
802+ d~zod/try=> (scan "4" (piec:poja dem:ag))
465803 [4 ~]
466804
467805### `++pojo`
468806
469807Print JSON
470808
809+Renders a [`++json`]() `val` as a [`++tape`]().
810+
811+Accepts
812+-------
813+
814+`val` is a [`json`]().
815+
816+Produces
817+--------
818+
819+A `++tape`.
820+
821+Source
822+------
823+
471824 ++ pojo :: print json
472825 |= val=json
473826 ^- tape
@@ -510,9 +863,8 @@ Print JSON
510863 ==
511864 ::
512865
513−Renders a `++json` `val` as a [`++tape`]().
514−
515−`val` is a [`json`]().
866+Examples
867+--------
516868
517869 ~zod/try=> (pojo [%n '12.6'])
518870 "12.6"
@@ -531,13 +883,27 @@ Renders a `++json` `val` as a [`++tape`]().
531883
532884Print XML
533885
886+Renders a `++manx` `a` as a [`++tape`]().
887+
888+Accepts
889+-------
890+
891+`a` is a [`++manx`]().
892+
893+Produces
894+--------
895+
896+A `++tape`.
897+
898+Source
899+------
900+
534901 ++ poxo :: node to tape
535902 =< |=(a=manx `tape`(apex a ~))
536903 |_ unq=? :: unq
537904
538−Renders a `++manx` `a` as a [`++tape`]().
539−
540−`a` is a [`++manx`]().
905+Examples
906+--------
541907
542908 ~zod/try=> (poxo ;div;)
543909 "<div></div>"
@@ -550,6 +916,23 @@ Renders a `++manx` `a` as a [`++tape`]().
550916
551917Inner XML printer
552918
919+Renders a [`++manx`]() as a [`++tape`](), appending a suffix `rez`.
920+
921+XX is `rez/` a typo or is the `/` intentional
922+
923+Accepts
924+-------
925+
926+`rez` is a [`++tape`]().
927+
928+Produces
929+--------
930+
931+A `++tape`.
932+
933+Source
934+------
935+
553936 ++ apex :: top level
554937 |= [mex=manx rez=tape]
555938 ^- tape
@@ -566,9 +949,8 @@ Inner XML printer
566949 ?~(att rez [' ' (attr att rez)])
567950 ::
568951
569−Renders a `++manx` as a [`++tape`](), appending a suffix `rez\`.
570−
571−`rez` is a [`++tape`]().
952+Examples
953+--------
572954
573955 ~zod/try=> (apex:poxo ;div; "")
574956 "<div></div>"
@@ -585,6 +967,23 @@ Renders a `++manx` as a [`++tape`](), appending a suffix `rez\`.
585967
586968Print attributes
587969
970+Render XML attributes as a [`++tape`]().
971+
972+Accepts
973+-------
974+
975+`tat` is a [`++mart`]().
976+
977+`rez` is a `++tape`.
978+
979+Produces
980+--------
981+
982+A `++tape`.
983+
984+Source
985+------
986+
588987 ++ attr :: attributes to tape
589988 |= [tat=mart rez=tape]
590989 ^- tape
@@ -596,11 +995,8 @@ Print attributes
596995 (escp(unq |) v.i.tat '"' ?~(t.tat rez [' ' rez]))
597996 ==
598997
599−Render XML attributes as a [`++tape`]().
600−
601−`tat` is a [`++mart`]().
602−
603−`rez` is a [`++tape`]().
998+Examples
999+--------
6041000
6051001 ~zod/try=> (attr:poxo ~ "")
6061002 ""
@@ -613,6 +1009,23 @@ Render XML attributes as a [`++tape`]().
6131009
6141010Escape XML
6151011
1012+Escapes the XML special characters `"`, `&`, `'`, `<`, `>`.
1013+
1014+Accepts
1015+-------
1016+
1017+`tex`is a [`++tape`]().
1018+
1019+`rez` is a `++tape`.
1020+
1021+Produces
1022+--------
1023+
1024+`++tape`.
1025+
1026+Source
1027+------
1028+
6161029 ++ escp :: escape for xml
6171030 |= [tex=tape rez=tape]
6181031 ?: unq
@@ -633,11 +1046,8 @@ Escape XML
6331046 ==
6341047 ::
6351048
636−Escapes the XML special characters `"`, `&`, `'`, `<`, `>`.
637−
638−`tex`is a [`++tape`]().
639−
640−`rez` is a [`++tape`]().
1049+Examples
1050+--------
6411051
6421052 ~zod/try=> (escp:poxo "astra" ~)
6431053 ~[~~a ~~s ~~t ~~r ~~a]
@@ -652,15 +1062,29 @@ Escapes the XML special characters `"`, `&`, `'`, `<`, `>`.
6521062
6531063Print name
6541064
1065+Renders a [`++mane`]() as a [`++tape`]().
1066+
1067+Accepts
1068+-------
1069+
1070+`man` is a `++mane`.
1071+
1072+Produces
1073+--------
1074+
1075+A `++tape`.
1076+
1077+Source
1078+------
1079+
6551080 ++ name :: name to tape
6561081 |= man=mane ^- tape
6571082 ?@ man (trip man)
6581083 (weld (trip -.man) `tape`[':' (trip +.man)])
6591084 ::
6601085
661−Renders a `++mane` as a `++tape`.
662−
663−`man` is a [`++mane`]().
1086+Examples
1087+--------
6641088
6651089 ~zod/try=> (name:poxo %$)
6661090 ""
@@ -673,6 +1097,23 @@ Renders a `++mane` as a `++tape`.
6731097
6741098Print node list
6751099
1100+Renders multiple XML nodes as a [`++tape`]().
1101+
1102+Accepts
1103+-------
1104+
1105+`lix` is a [`++list`]() of [`++manx`]().
1106+
1107+`rez` is a `++tape`.
1108+
1109+Produces
1110+--------
1111+
1112+A `++tape`.
1113+
1114+Source
1115+------
1116+
6761117 ++ many :: nodelist to tape
6771118 |= [lix=(list manx) rez=tape]
6781119 |- ^- tape
@@ -680,11 +1121,8 @@ Print node list
6801121 (apex i.lix $(lix t.lix))
6811122 ::
6821123
683−Renders multiple XML nodes as a [`++tape`]()
684−
685−`lix` is a [`++list`]() of [`++manx`]().
686−
687−`rez` is a [`++tape`]().
1124+Examples
1125+--------
6881126
6891127 ~zod/try=> (many:poxo ~ "")
6901128 ""
@@ -701,13 +1139,27 @@ Renders multiple XML nodes as a [`++tape`]()
7011139
7021140Parse XML
7031141
1142+Parses an XML node from a [`++cord`](), producing a [`++unit`]() [`++manx`]().
1143+
1144+Accepts
1145+-------
1146+
1147+`a` is a [`++cord`]().
1148+
1149+Produces
1150+--------
1151+
1152+A `(unit manx)`.
1153+
1154+Source
1155+------
1156+
7041157 ++ poxa :: xml parser
7051158 =< |=(a=cord (rush a apex))
7061159 |%
7071160
708−Parses an XML node from a [`++cord`](), producing a unit [`++manx`]().
709−
710−`a` is a [`++cord`]().
1161+Examples
1162+--------
7111163
7121164 ~zod/try=> (poxa '<div />')
7131165 [~ [g=[n=%div a=~] c=~]]
@@ -722,6 +1174,21 @@ Parses an XML node from a [`++cord`](), producing a unit [`++manx`]().
7221174
7231175Top level parser
7241176
1177+Parses a node of XML, type [`++manx`]().
1178+
1179+Accepts
1180+-------
1181+
1182+A [`++nail`]().
1183+
1184+Produces
1185+--------
1186+
1187+A `++manx`.
1188+
1189+Source
1190+------
1191+
7251192 ++ apex
7261193 =+ spa=;~(pose comt whit)
7271194 %+ knee *manx |. ~+
@@ -733,21 +1200,38 @@ Top level parser
7331200 ==
7341201 ::
7351202
736−Parses a node of XML, type [`++manx`]().
1203+Examples
1204+--------
7371205
738− ~zod/try=> (rash '<div />' apex:xmlp)
1206+ ~zod/try=> (rash '<div />' apex:poxa)
7391207 [g=[n=%div a=~] c=~]
740− ~zod/try=> (rash '<html><head/> <body/></html>' apex:xmlp)
1208+ ~zod/try=> (rash '<html><head/> <body/></html>' apex:poxa)
7411209 [g=[n=%html a=~] c=~[[g=[n=%head a=~] c=~] [g=[n=%body a=~] c=~]]]
742− ~zod/try=> (rash '<script src="/gep/hart.js"/>' apex:xmlp)
1210+ ~zod/try=> (rash '<script src="/gep/hart.js"/>' apex:poxa)
7431211 [g=[n=%script a=~[[n=%src v="/gep/hart.js"]]] c=~]
744− ~zod/try=> (rash '<<<<' apex:xmlp)
1212+ ~zod/try=> (rash '<<<<' apex:poxa)
7451213 ! {1 2}
7461214 ! exit
7471215
748−### `++attr`
1216+### `++attr`
1217+
1218+Parse XML attributes
1219+
1220+Parses the list of attributes inside the opening XML tag, which is zero
1221+or more space-prefixed name to string values.
1222+
1223+Accepts
1224+-------
7491225
750−Parse XML attributes
1226+A [`++nail`]().
1227+
1228+Produces
1229+--------
1230+
1231+A [`++mart`]().
1232+
1233+Source
1234+------
7511235
7521236 ++ attr :: attributes
7531237 %+ knee *mart |. ~+
@@ -761,23 +1245,23 @@ Parse XML attributes
7611245 ==
7621246 ::
7631247
764−Parses the list of attributes inside the opening XML tag, which is zero
765−or more space-prefixed name to string values. Result type [`++mart`]()
1248+Examples
1249+--------
7661250
767− ~zod/try=> (rash '' attr:xmlp)
1251+ ~zod/try=> (rash '' attr:poxa)
7681252 ~
769− ~zod/try=> (rash 'sam=""' attr:xmlp)
1253+ ~zod/try=> (rash 'sam=""' attr:poxa)
7701254 ! {1 1}
7711255 ! exit
772− ~zod/try=> (rash ' sam=""' attr:xmlp)
1256+ ~zod/try=> (rash ' sam=""' attr:poxa)
7731257 ~[[n=%sam v=""]]
774− ~zod/try=> (rash ' sam="hek"' attr:xmlp)
1258+ ~zod/try=> (rash ' sam="hek"' attr:poxa)
7751259 ~[[n=%sam v="hek"]]
776− ~zod/try=> (rash ' sam="hek" res="actor"' attr:xmlp)
1260+ ~zod/try=> (rash ' sam="hek" res="actor"' attr:poxa)
7771261 ~[[n=%sam v="hek"] [n=%res v="actor"]]
778− ~zod/try=> (rash ' sam=\'hek\' res="actor"' attr:xmlp)
1262+ ~zod/try=> (rash ' sam=\'hek\' res="actor"' attr:poxa)
7791263 ~[[n=%sam v="hek"] [n=%res v="actor"]]
780− ~zod/try=> (rash ' sam=\'hek" res="actor"' attr:xmlp)
1264+ ~zod/try=> (rash ' sam=\'hek" res="actor"' attr:poxa)
7811265 ! {1 23}
7821266 ! exit
7831267
@@ -785,18 +1269,34 @@ or more space-prefixed name to string values. Result type [`++mart`]()
7851269
7861270Parse character data
7871271
1272+Parsing rule. Parses XML character data.
1273+
1274+Accepts
1275+-------
1276+
1277+A [`++nail`]().
1278+
1279+Produces
1280+--------
1281+
1282+A [`++mars`]().
1283+
1284+Source
1285+------
1286+
7881287 ++ chrd :: character data
7891288 %+ cook |=(a=tape ^-(mars :/(a)))
7901289 (plus ;~(less soq doq ;~(pose (just `@`10) escp)))
7911290 ::
7921291
793−Parsing rule. Parses XML character data. Result type [`++mars`]()
1292+Examples
1293+--------
7941294
795− ~zod/try=> (rash 'asa' chrd:xmlp)
1295+ ~zod/try=> (rash 'asa' chrd:poxa)
7961296 [g=[n=%$ a=~[[n=%$ v="asa"]]] c=~]
797− ~zod/try=> (rash 'asa > are' chrd:xmlp)
1297+ ~zod/try=> (rash 'asa > are' chrd:poxa)
7981298 [g=[n=%$ a=~[[n=%$ v="asa > are"]]] c=~]
799− ~zod/try=> (rash 'asa > are' chrd:xmlp)
1299+ ~zod/try=> (rash 'asa > are' chrd:poxa)
8001300 ! {1 6}
8011301 ! exit
8021302
@@ -804,6 +1304,21 @@ Parsing rule. Parses XML character data. Result type [`++mars`]()
8041304
8051305Parses comments
8061306
1307+Parsing rule. Parses XML comment blocks.
1308+
1309+Accepts
1310+-------
1311+
1312+A [`++nail`]().
1313+
1314+Produces
1315+--------
1316+
1317+A [`++like`]().
1318+
1319+Source
1320+------
1321+
8071322 ++ comt :: comments
8081323 =- (ifix [(jest '<!--') (jest '-->')] (star -))
8091324 ;~ pose
@@ -812,14 +1327,16 @@ Parses comments
8121327 ;~(less (jest '-->') hep)
8131328 ==
8141329 ::
1330+A [`++unit`]() of.
8151331
816−Parsing rule. Parses XML comment blocks.
1332+Examples
1333+--------
8171334
818− ~zod/try=> (rash '<!-- bye -->' comt:xmlp)
1335+ ~zod/try=> (rash '<!-- bye -->' comt:poxa)
8191336 " bye "
820− ~zod/try=> (rash '<!-- bye ><<<>< - - -->' comt:xmlp)
1337+ ~zod/try=> (rash '<!-- bye ><<<>< - - -->' comt:poxa)
8211338 " bye ><<<>< - - "
822− ~zod/try=> (rash '<!-- invalid -->-->' comt:xmlp)
1339+ ~zod/try=> (rash '<!-- invalid -->-->' comt:poxa)
8231340 ! {1 18}
8241341 ! exit
8251342
@@ -827,6 +1344,22 @@ Parsing rule. Parses XML comment blocks.
8271344
8281345Parse (possibly) escaped char
8291346
1347+Parsing rule. Parses a nonspecial or escaped character. Result type
1348+[`++char`]()
1349+
1350+Accepts
1351+-------
1352+
1353+A [`++nail`]().
1354+
1355+Produces
1356+--------
1357+
1358+The [`++edge`]() of a [`++cord`]().
1359+
1360+Source
1361+------
1362+
8301363 ++ escp
8311364 ;~ pose
8321365 ;~(less gal gar pam prn)
@@ -837,42 +1370,59 @@ Parse (possibly) escaped char
8371370 (cold '\'' (jest '''))
8381371 ==
8391372
840−Parsing rule. Parses a nonspecial or escaped character. Result type
841−[`++char`]()
1373+Examples
1374+--------
8421375
843− ~zod/try=> (rash 'a' escp:xmlp)
1376+ ~zod/try=> (rash 'a' escp:poxa)
8441377 'a'
845− ~zod/try=> (rash 'ab' escp:xmlp)
1378+ ~zod/try=> (rash 'ab' escp:poxa)
8461379 ! {1 2}
8471380 ! exit
848− ~zod/try=> (rash '.' escp:xmlp)
1381+ ~zod/try=> (rash '.' escp:poxa)
8491382 '.'
850− ~zod/try=> (rash '!' escp:xmlp)
1383+ ~zod/try=> (rash '!' escp:poxa)
8511384 '!'
852− ~zod/try=> (rash '>' escp:xmlp)
1385+ ~zod/try=> (rash '>' escp:poxa)
8531386 ! {1 2}
8541387 ! exit
855− ~zod/try=> (rash '>' escp:xmlp)
1388+ ~zod/try=> (rash '>' escp:poxa)
8561389 '>'
857− ~zod/try=> (rash '"' escp:xmlp)
1390+ ~zod/try=> (rash '"' escp:poxa)
8581391 '"'
8591392
8601393### `++empt`
8611394
8621395Parse self-closing tag
8631396
1397+Parsing rule. Parses self-closing XML tags that end in `/>`.
1398+
1399+Accepts
1400+-------
1401+
1402+A [`++nail`]().
1403+
1404+Produces
1405+--------
1406+
1407+
1408+A `(like tape)`.
1409+
1410+Source
1411+------
1412+
8641413 ++ empt :: self-closing tag
8651414 %+ ifix [gal (jest '/>')]
8661415 ;~(plug ;~(plug name attr) (cold ~ (star whit)))
8671416 ::
8681417
869−Parsing rule. Parses self-closing XML tags that end in `/>`.
1418+Examples
1419+--------
8701420
871− ~zod/try=> (rash '<div/>' empt:xmlp)
1421+ ~zod/try=> (rash '<div/>' empt:poxa)
8721422 [[%div ~] ~]
873− ~zod/try=> (rash '<pre color="#eeffee" />' empt:xmlp)
1423+ ~zod/try=> (rash '<pre color="#eeffee" />' empt:poxa)
8741424 [[%pre ~[[n=%color v="#eeffee"]]] ~]
875− ~zod/try=> (rash '<pre color="#eeffee"></pre>' empt:xmlp)
1425+ ~zod/try=> (rash '<pre color="#eeffee"></pre>' empt:poxa)
8761426 ! {1 21}
8771427 ! exit
8781428
@@ -880,18 +1430,34 @@ Parsing rule. Parses self-closing XML tags that end in `/>`.
8801430
8811431Parse opening tag
8821432
1433+Parsing rule. Parses the opening tag of an XML node. Result type
1434+[`++marx`]()
1435+
1436+Accepts
1437+-------
1438+
1439+A [`++nail`]().
1440+
1441+Produces
1442+--------
1443+
1444+A `(like marx)`.
1445+
1446+Source
1447+------
1448+
8831449 ++ head :: opening tag
8841450 (ifix [gal gar] ;~(plug name attr))
8851451 ::
8861452
887−Parsing rule. Parses the opening tag of an XML node. Result type
888−[`++marx`]()
1453+Examples
1454+--------
8891455
890− ~zod/try=> (rash '<a>' head:xmlp)
1456+ ~zod/try=> (rash '<a>' head:poxa)
8911457 [n=%a a=~]
892− ~zod/try=> (rash '<div mal="tok">' head:xmlp)
1458+ ~zod/try=> (rash '<div mal="tok">' head:poxa)
8931459 [n=%div a=~[[n=%mal v="tok"]]]
894− ~zod/try=> (rash '<div mal="tok" />' head:xmlp)
1460+ ~zod/try=> (rash '<div mal="tok" />' head:poxa)
8951461 ! {1 16}
8961462 ! exit
8971463
@@ -899,6 +1465,21 @@ Parsing rule. Parses the opening tag of an XML node. Result type
8991465
9001466Parse tag name
9011467
1468+Parsing rule. Parses the name of an XML tag.
1469+
1470+Accepts
1471+-------
1472+
1473+A [`++nail`]().
1474+
1475+Produces
1476+--------
1477+
1478+An [`++edge`]() of a [`++mane`]().
1479+
1480+Source
1481+------
1482+
9021483 ++ name :: tag name
9031484 %+ knee *mane |. ~+
9041485 =+ ^= chx
@@ -910,15 +1491,16 @@ Parse tag name
9101491 ;~(pose ;~(plug ;~(sfix chx col) chx) chx)
9111492 ::
9121493
913−Parsing rule. Parses the name of an XML tag. Result type [`++mane`]()
1494+Examples
1495+--------
9141496
915− ~zod/try=> (scan "ham" name:xmlp)
1497+ ~zod/try=> (scan "ham" name:poxa)
9161498 %ham
917− ~zod/try=> (scan "ham:tor" name:xmlp)
1499+ ~zod/try=> (scan "ham:tor" name:poxa)
9181500 [%ham %tor]
919− ~zod/try=> (scan "ham-tor" name:xmlp)
1501+ ~zod/try=> (scan "ham-tor" name:poxa)
9201502 %ham-tor
921− ~zod/try=> (scan "ham tor" name:xmlp)
1503+ ~zod/try=> (scan "ham tor" name:poxa)
9221504 ! {1 4}
9231505 ! exit
9241506
@@ -926,15 +1508,31 @@ Parsing rule. Parses the name of an XML tag. Result type [`++mane`]()
9261508
9271509Parse closing tag
9281510
1511+Parsing rule. Parses an XML closing tag.
1512+
1513+Accepts
1514+-------
1515+
1516+A [`++nail`]().
1517+
1518+Produces
1519+--------
1520+
1521+A `(like tail)`.
1522+
1523+Source
1524+------
1525+
9291526 ++ tail (ifix [(jest '</') gar] name) :: closing tag
9301527
931−Parsing rule. Parses an XML closing tag.
1528+Examples
1529+--------
9321530
933− ~zod/try=> (scan "</div>" tail:xmlp)
1531+ ~zod/try=> (scan "</div>" tail:poxa)
9341532 %div
935− ~zod/try=> (scan "</a>" tail:xmlp)
1533+ ~zod/try=> (scan "</a>" tail:poxa)
9361534 %a
937− ~zod/try=> (scan "</>" tail:xmlp)
1535+ ~zod/try=> (scan "</>" tail:poxa)
9381536 ! {1 3}
9391537 ! exit
9401538
@@ -942,21 +1540,37 @@ Parsing rule. Parses an XML closing tag.
9421540
9431541Parse whitespace, etc.
9441542
1543+Parsing rule. Parses newlines, tabs, and spaces.
1544+
1545+Accepts
1546+-------
1547+
1548+A [`++nail`]().
1549+
1550+Produces
1551+--------
1552+
1553+A `(like char)`.
1554+
1555+Source
1556+------
1557+
9451558 ++ whit (mask ~[' ' `@`0x9 `@`0xa]) :: whitespace
9461559 ::
9471560
948−Parsing rule. Parses newlines, tabs, and spaces.
1561+Examples
1562+--------
9491563
950− ~zod/try=> `@`(scan " " whit:xmlp)
1564+ ~zod/try=> `@`(scan " " whit:poxa)
9511565 32
952− ~zod/try=> `@`(scan " " whit:xmlp)
1566+ ~zod/try=> `@`(scan " " whit:poxa)
9531567 ! {1 2}
9541568 ! exit
955− ~zod/try=> `@`(scan "\0a" whit:xmlp)
1569+ ~zod/try=> `@`(scan "\0a" whit:poxa)
9561570 10
957− ~zod/try=> `@`(scan "\09" whit:xmlp)
1571+ ~zod/try=> `@`(scan "\09" whit:poxa)
9581572 9
959− ~zod/try=> `@`(scan "\08" whit:xmlp)
1573+ ~zod/try=> `@`(scan "\08" whit:poxa)
9601574 ! {1 1}
9611575 ! exit
9621576
@@ -964,21 +1578,46 @@ Parsing rule. Parses newlines, tabs, and spaces.
9641578
9651579JSON reparsing core
9661580
967− ++ jo :: json reparser
968− => |% ++ grub (unit ,*)
969− ++ fist $+(json grub)
970− |%
1581+Contains converters of [`++json`]() to [`++unit`]()s of well-typed structures.
9711582
972−Contains converters of ++json to [`++unit`]() well-typed structures.
1583+Accepts
1584+-------
9731585
9741586A `fist` is a gate that produces a `grub`.
9751587
9761588A `grub` is a unit of some JSON value.
9771589
1590+Source
1591+------
1592+
1593+ ++ jo :: json reparser
1594+ => |% ++ grub (unit ,*)
1595+ ++ fist $+(json grub)
1596+ |%
1597+
1598+
9781599### `++ar`
9791600
9801601Parse array to list
9811602
1603+Reparser modifier. Reparses an array to the [`++unit`]() of a homogenous
1604+[`++list`]() using `wit` to reparse every element.
1605+
1606+`wit` is a [`++fist`](), a JSON reparser.
1607+
1608+
1609+Accepts
1610+-------
1611+
1612+A [`++fist`]().
1613+
1614+Produces
1615+--------
1616+
1617+A [`++rule`]().
1618+
1619+Source
1620+------
9821621 ++ ar :: array as list
9831622 |* wit=fist
9841623 |= jon=json
@@ -989,19 +1628,34 @@ Parse array to list
9891628 [i=(wit i.p.jon) t=$(p.jon t.p.jon)]
9901629 ::
9911630
992−Reparser modifier. Reparses an array to the [`++unit`]() of a homogenous
993−[`++list`]() using `wit` to reparse every element.
994−
995−`wit` is a [`++fist`](), a JSON reparser.
1631+Examples
1632+--------
9961633
9971634 ~zod/try=> :type; ((ar ni):jo a/~[n/'1' n/'2'])
9981635 [~ u=~[1 2]]
9991636 {[%~ u=it(@)] %~}
10001637
1638+
10011639### `++at`
10021640
10031641Reparse array as tuple
10041642
1643+Reparser generator. Reparses an array as a fixed-length tuple of
1644+[`++unit`]()s, using a list of `++fist`s.
1645+
1646+Accepts
1647+-------
1648+
1649+`wil` is a [`++pole`](), a [`face`]()less list of [`++fist`]()s.
1650+
1651+Produces
1652+--------
1653+
1654+A [`++rule`]().
1655+
1656+Source
1657+------
1658+
10051659 ++ at :: array as tuple
10061660 |* wil=(pole fist)
10071661 |= jon=json
@@ -1010,10 +1664,8 @@ Reparse array as tuple
10101664 ?.((za raw) ~ (some (zp raw)))
10111665 ::
10121666
1013−Reparser generator. Reparses an array as a fixed-length tuple of
1014−[`++unit`]()s, using a list of `++fist`s.
1015−
1016−`wil` is a [`++pole`]() a [`face`]()less list of [`++fist`]()s.
1667+Examples
1668+--------
10171669
10181670 ~zod/try=> ((at ni so ni ~):jo a/~[n/'3' s/'to' n/'4'])
10191671 [~ u=[q=3 ~.to q=4]]
@@ -1027,6 +1679,21 @@ Reparser generator. Reparses an array as a fixed-length tuple of
10271679
10281680Reparse array to tuple
10291681
1682+Reparser generator. Reparses a list of [`++json`]() with `wil` to a tuple of [`++unit`]()s.
1683+
1684+Accepts
1685+-------
1686+
1687+`wil` is a [`++pole`](), a [face]()less list of [`++fist`]()s.
1688+
1689+Produces
1690+--------
1691+
1692+A [`++rule`]().
1693+
1694+Source
1695+------
1696+
10301697 ++ at-raw :: array as tuple
10311698 |* wil=(pole fist)
10321699 |= jol=(list json)
@@ -1035,10 +1702,8 @@ Reparse array to tuple
10351702 ((at-raw +.wil) ?~(jol ~ t.jol))
10361703 ::
10371704
1038−Reparser generator. Reparses a list of [`++json`]() to a tuple of
1039−[`++unit`]() using `wil`.
1040−
1041−`wil` is a [`++pole`](), a [face]()less list of [`++fist`]()s.
1705+Examples
1706+--------
10421707
10431708 ~zod/try=> ((at-raw ni ni bo ~):jo ~[s/'hi' n/'1' b/&])
10441709 [~ [~ 1] [~ u=%.y] ~]
@@ -1047,12 +1712,28 @@ Reparser generator. Reparses a list of [`++json`]() to a tuple of
10471712
10481713Reparse boolean
10491714
1715+Reparser modifier. Reparses a boolean to the [`++unit`]() of a
1716+boolean.
1717+
1718+Accepts
1719+-------
1720+
1721+A [`++json`]().
1722+
1723+Produces
1724+--------
1725+
1726+A [`++fist`]().
1727+
1728+Source
1729+------
1730+
10501731 ++ bo :: boolean
10511732 |=(jon=json ?.(?=([%b *] jon) ~ [~ u=p.jon]))
10521733 ::
10531734
1054−Reparser modifier. Reparses a boolean to the [`++unit`]() of a
1055−[`loobean`]().
1735+Examples
1736+--------
10561737
10571738 ~zod/try=> (bo:jo [%b &])
10581739 [~ u=%.y]
@@ -1065,12 +1746,29 @@ Reparser modifier. Reparses a boolean to the [`++unit`]() of a
10651746
10661747Reparse boolean not
10671748
1749+Reparser modifier. Reparses the inverse of a boolean to the [`++unit`]()
1750+of a loobean.
1751+
1752+
1753+Accepts
1754+-------
1755+
1756+A [`++json`]().
1757+
1758+Produces
1759+--------
1760+
1761+A [`++fist`]().
1762+
1763+Source
1764+------
1765+
10681766 ++ bu :: boolean not
10691767 |=(jon=json ?.(?=([%b *] jon) ~ [~ u=!p.jon]))
10701768 ::
10711769
1072−Reparser modifier. Reparses the inverse of a boolean to the [`++unit`]()
1073−of a loobean.
1770+Examples
1771+--------
10741772
10751773 ~zod/try=> (bu:jo [%b &])
10761774 [~ u=%.n]
@@ -1083,19 +1781,33 @@ of a loobean.
10831781
10841782Reparse and transform
10851783
1086− ++ cu :: transform
1087− |* [poq=$+(* *) wit=fist]
1088− |= jon=json
1089− (bind (wit jon) poq)
1090− ::
1091−
10921784Reparser modifier. Reparses `jon` and slams the result through `wit`,
10931785producing a [`++unit`]().
10941786
1787+Accepts
1788+-------
1789+
10951790`wit` is a [`++fist`]().
10961791
10971792`poq` is a [`gate`]() that accepts and returns a [noun]().
10981793
1794+Produces
1795+--------
1796+
1797+A [`++fist`]().
1798+
1799+Source
1800+------
1801+
1802+ ++ cu :: transform
1803+ |* [poq=$+(* *) wit=fist]
1804+ |= jon=json
1805+ (bind (wit jon) poq)
1806+ ::
1807+
1808+Examples
1809+--------
1810+
10991811 ~zod/try=> ((cu dec ni):jo [%n '20'])
11001812 [~ 19]
11011813 ~zod/try=> ((cu dec ni):jo [%b &])
@@ -1105,13 +1817,29 @@ producing a [`++unit`]().
11051817
11061818Reparse UTC date
11071819
1820+Reparser modifier. Reparses a UTC date string to a [`++unit`]().
1821+
1822+Accepts
1823+-------
1824+
1825+`jon` is a [`++json`]().
1826+
1827+Produces
1828+--------
1829+
1830+A [`++fist`]().
1831+
1832+Source
1833+------
1834+
11081835 ++ da :: UTC date
11091836 |= jon=json
11101837 ?. ?=([%s *] jon) ~
11111838 (bind (stud (trip p.jon)) |=(a=date (year a)))
11121839 ::
11131840
1114−Reparser modifier. Reparses a UTC date string to a [`++unit`]().
1841+Examples
1842+--------
11151843
11161844 ~zod/try=> (da:jo [%s 'Wed, 29 Oct 2014 0:26:15 +0000'])
11171845 [~ ~2014.10.29..00.26.15]
@@ -1124,6 +1852,22 @@ Reparser modifier. Reparses a UTC date string to a [`++unit`]().
11241852
11251853Reparse millisecond date
11261854
1855+Reparser modifier. Reparses the javascript millisecond date integer to a
1856+[`++unit`]().
1857+
1858+Accepts
1859+-------
1860+
1861+`jon` is a [`++json`]().
1862+
1863+Produces
1864+--------
1865+
1866+A [`++fist`]().
1867+
1868+Source
1869+------
1870+
11271871 ++ di :: millisecond date
11281872 |= jon=json
11291873 %+ bind (ni jon)
@@ -1131,8 +1875,8 @@ Reparse millisecond date
11311875 (add ~1970.1.1 (div (mul ~s1 a) 1.000))
11321876 ::
11331877
1134−Reparser modifier. Reparses the JavaScript millisecond date integer to a
1135−[`++unit`]().
1878+Examples
1879+--------
11361880
11371881 ~zod/try=> (di:jo [%s '2014-10-29'])
11381882 ~
@@ -1147,18 +1891,32 @@ Reparser modifier. Reparses the JavaScript millisecond date integer to a
11471891
11481892Reparse unit
11491893
1894+Reparser modifier. Reparses `wit` to a [`++unit`]().
1895+
1896+JSON units are considered to be either JSON null or the requested
1897+value, and are reparsed to results of \~ or (some {value}) respectively.
1898+
1899+Accepts
1900+-------
1901+
1902+`wit` is a [`++fist`]().
1903+
1904+Produces
1905+--------
1906+
1907+A [`++fist`]().
1908+
1909+Source
1910+------
1911+
11501912 ++ mu :: true unit
11511913 |* wit=fist
11521914 |= jon=json
11531915 ?~(jon (some ~) (bind (wit jon) some))
11541916 ::
11551917
1156−Reparser modifier. Reparses `wit` to a [`++unit`]().
1157−
1158−A- JSON units are considered to be either JSON null or the requested
1159−value, and are reparsed to results of \~ or (some {value}) respectively
1160−
1161−`wit` is a [`++fist`]().
1918+Examples
1919+--------
11621920
11631921 ~zod/try=> ((mu ni):jo [%n '20'])
11641922 [~ [~ u=q=20]]
@@ -1173,12 +1931,6 @@ value, and are reparsed to results of \~ or (some {value}) respectively
11731931
11741932Reparse number as real
11751933
1176− ++ ne :: number as real
1177− |= jon=json
1178− ^- (unit ,@rd)
1179− !!
1180− ::
1181−
11821934XX Currently unimplemented
11831935
11841936A- yup, this will eventually reparse a floating point atom, but
@@ -1188,13 +1940,29 @@ interfaces for the latter are not currently stable.
11881940
11891941Reparse number as integer
11901942
1943+Reparser modifier. Reparses an integer representation to a [`++unit]().
1944+
1945+Accepts
1946+-------
1947+
1948+`jon` is a ++[`++json`]().
1949+
1950+Produces
1951+--------
1952+
1953+The `++unit` of an atom.
1954+
1955+Source
1956+------
1957+
11911958 ++ ni :: number as integer
11921959 |= jon=json
11931960 ?. ?=([%n *] jon) ~
11941961 (rush p.jon dem)
11951962 ::
11961963
1197−Reparser modifier. Reparses an integer representation to a [\`++unit]().
1964+Examples
1965+--------
11981966
11991967 ~zod/try=> (ni:jo [%n '0'])
12001968 [~ q=0]
@@ -1215,13 +1983,29 @@ Reparser modifier. Reparses an integer representation to a [\`++unit]().
12151983
12161984Reparse number as text
12171985
1986+Reparser modifier. Reparses a numeric representation to a [++cord]().
1987+
1988+Accepts
1989+-------
1990+
1991+`jon` is a `++json`.
1992+
1993+Produces
1994+--------
1995+
1996+The [`++unit`]() of a `++cord`.
1997+
1998+Source
1999+------
2000+
12182001 ++ no :: number as text
12192002 |= jon=json
12202003 ?. ?=([%n *] jon) ~
12212004 (some p.jon)
12222005 ::
12232006
1224−Reparser modifier. Reparses a numeric representation to a [++cord]().
2007+Examples
2008+--------
12252009
12262010 ~zod/try=> (no:jo [%n '0'])
12272011 [~ u=~.0]
@@ -1242,6 +2026,23 @@ Reparser modifier. Reparses a numeric representation to a [++cord]().
12422026
12432027Reparse object to frond
12442028
2029+Reparser generator. Reparses an object, succeeding if it corresponds to
2030+one of the key-value pairs in `wer`.
2031+
2032+Accepts
2033+-------
2034+
2035+`wer` is a [`++pole`](), a [`++face`]()less list of [`++cord`]() and
2036+[`++fist`]() key-value pairs.
2037+
2038+Produces
2039+--------
2040+
2041+The [`++unit`]() of a cell of a.....
2042+
2043+Source
2044+------
2045+
12452046 ++ of :: object as frond
12462047 |* wer=(pole ,[cord fist])
12472048 |= jon=json
@@ -1253,11 +2054,8 @@ Reparse object to frond
12532054 ((of +.wer) jon)
12542055 ::
12552056
1256−Reparser generator. Reparses an object, succeeding if it corresponds to
1257−one of the key-value pairs in `wer`.
1258−
1259−`wer` is a [`++pole`](), a [`++face`]()less list of [`++cord`]() and
1260−[`++fist`]() key-value pairs.
2057+Examples
2058+--------
12612059
12622060 ~zod/try=> ((of sem/sa som/ni ~):jo %o [%sem s/'hi'] ~ ~)
12632061 [~ [%sem "hi"]]
@@ -1282,6 +2080,24 @@ one of the key-value pairs in `wer`.
12822080
12832081Reparse object as tuple
12842082
2083+Reparser generator. For every key in `wer` that matches a key in the
2084+[`++edge`], the fist in `wer` is applied to the corresponding value in
2085+the [`++edge`](), the results of which are produced in a tuple.
2086+
2087+
2088+Accepts
2089+-------
2090+
2091+`wer` is a [`++pole`]() of [`++cord`]() to [`++fist`]() key-value pairs.
2092+
2093+Produces
2094+--------
2095+
2096+A [`++unit`]() of a tuple XX?
2097+
2098+Source
2099+------
2100+
12852101 ++ ot :: object as tuple
12862102 |* wer=(pole ,[cord fist])
12872103 |= jon=json
@@ -1290,11 +2106,8 @@ Reparse object as tuple
12902106 ?.((za raw) ~ (some (zp raw)))
12912107 ::
12922108
1293−Reparser generator. For every key in `wer` that matches a key in the
1294−[`++edge`], the fist in `wer` is applied to the corresponding value in
1295−the [`++edge`](), the results of which are produced in a tuple.
1296−
1297−`wer` is a [`++pole`]() of [`++cord`]() to [`++fist`]() key-value pairs.
2109+Examples
2110+--------
12982111
12992112 ~zod/try=> (jobe [%sem s/'ha'] [%som n/'20'] ~)
13002113 [%o p={[p='sem' q=[%s p=~.ha]] [p='som' q=[%n p=~.20]]}]
@@ -1303,6 +2116,25 @@ the [`++edge`](), the results of which are produced in a tuple.
13032116
13042117### `++ot-raw`
13052118
2119+Reparser generator. Reparses a map `jom` using `wer`; for every key in
2120+`wer` that matches a key in `map`, the corresponding `++fist` is applied
2121+to the corresponding value in `jom`, the results of which are produced
2122+in a tuple.
2123+
2124+
2125+Accepts
2126+-------
2127+
2128+`wer` is a [`++pole`]() of [`++cord`]() to [`++fist`]() key-value pairs.
2129+
2130+Produces
2131+--------
2132+
2133+A [`++unit`]() of.
2134+
2135+Source
2136+------
2137+
13062138 ++ ot-raw :: object as tuple
13072139 |* wer=(pole ,[cord fist])
13082140 |= jom=(map ,@t json)
@@ -1311,10 +2143,8 @@ the [`++edge`](), the results of which are produced in a tuple.
13112143 [?~(ten ~ (+.-.wer u.ten)) ((ot-raw +.wer) jom)]
13122144 ::
13132145
1314−Reparser generator. Reparses a map `jom` using `wer`; for every key in
1315−`wer` that matches a key in `map`, the corresponding `++fist` is applied
1316−to the corresponding value in `jom`, the results of which are produced
1317−in a tuple.
2146+Examples
2147+--------
13182148
13192149 ~zod/try=> ((ot-raw sem/sa som/ni sem/sa ~):jo (mo [%sem s/'ha'] [%som n/'20'] ~))
13202150 [[~ u="ha"] [~ q=20] [~ u="ha"] ~]
@@ -1325,6 +2155,22 @@ in a tuple.
13252155
13262156Parse object to map
13272157
2158+Reparser modifier. Reparses a [`++json`]() object to a homogenous map
2159+using `wit`.
2160+
2161+Accepts
2162+-------
2163+
2164+`wit` is a [`++fist`]().
2165+
2166+Produces
2167+--------
2168+
2169+A [`++unit`]() of...
2170+
2171+Source
2172+------
2173+
13282174 ++ om :: object as map
13292175 |* wit=fist
13302176 |= jon=json
@@ -1332,10 +2178,8 @@ Parse object to map
13322178 (zm ~(run by p.jon) wit)
13332179 ::
13342180
1335−Reparser modifier. Reparses a [`++json`]() object to a homogenous map
1336−using `wit`.
1337−
1338−`wit` is a [`++fist`]().
2181+Examples
2182+--------
13392183
13402184 ~zod/try=> ((om ni):jo (jobe [%sap n/'20'] [%sup n/'5'] [%sop n/'177'] ~))
13412185 [~ {[p='sup' q=q=5] [p='sop' q=q=177] [p='sap' q=q=20]}]
@@ -1346,15 +2190,29 @@ using `wit`.
13462190
13472191Add prefix
13482192
2193+Reparser modifier. Adds a static prefix `pre` to the parse result of
2194+`wit`. See also: [`++stag`]().
2195+
2196+Accepts
2197+-------
2198+
2199+`pre` is a prefix [`noun`]().
2200+
2201+Produces
2202+--------
2203+
2204+The [`++unit`]() of a cell of [noun]() and the result of parsing `wit`.
2205+
2206+Source
2207+------
2208+
13492209 ++ pe :: prefix
13502210 |* [pre=* wit=fist]
13512211 (cu |*(a=* [pre a]) wit)
13522212 ::
13532213
1354−Reparser modifier. Adds a static prefix `pre` to the parse result of
1355−`wit`. See also: [`++stag`]().
1356−
1357−`pre` is a prefix [`noun`]().
2214+Examples
2215+--------
13582216
13592217 ~zod/try=> (ni:jo n/'2')
13602218 [~ q=2]
@@ -1369,12 +2227,28 @@ Reparser modifier. Adds a static prefix `pre` to the parse result of
13692227
13702228Reparse string to tape
13712229
2230+Reparser modifier. Reparses a [`++json`]() string to a [`++tape`]().
2231+
2232+Accepts
2233+-------
2234+
2235+`jon` is a [`++json`]().
2236+
2237+Produces
2238+--------
2239+
2240+The [`++unit`]() of a [`++tape`]().
2241+
2242+Source
2243+------
2244+
13722245 ++ sa :: string as tape
13732246 |= jon=json
13742247 ?.(?=([%s *] jon) ~ (some (trip p.jon)))
13752248 ::
13762249
1377−Reparser modifier. Reparses a [`++json`]() string to a [`++tape`]().
2250+Examples
2251+--------
13782252
13792253 ~zod/try=> (sa:jo s/'value')
13802254 [~ u="value"]
@@ -1387,12 +2261,28 @@ Reparser modifier. Reparses a [`++json`]() string to a [`++tape`]().
13872261
13882262Reparse string to cord
13892263
2264+Reparser modifier. Reparses a string to a [`++cord`]().
2265+
2266+Accepts
2267+-------
2268+
2269+`jon` is a [`++json`]().
2270+
2271+Produces
2272+--------
2273+
2274+The [`++unit`]() of a [`++cord`]().
2275+
2276+Source
2277+------
2278+
13902279 ++ so :: string as cord
13912280 |= jon=json
13922281 ?.(?=([%s *] jon) ~ (some p.jon))
13932282 ::
13942283
1395−Reparser modifier. Reparses a string to a [`++cord`]().
2284+Examples
2285+--------
13962286
13972287 ~zod/try=> (so:jo s/'value')
13982288 [~ u=~.value]
@@ -1405,6 +2295,21 @@ Reparser modifier. Reparses a string to a [`++cord`]().
14052295
14062296Reparse string
14072297
2298+Reparser generator. Produces a reparser that applies `sab` to a string.
2299+
2300+Accepts
2301+-------
2302+
2303+`sab` is a [`++rule`].
2304+
2305+Produces
2306+--------
2307+
2308+A [`++rule`]().
2309+
2310+Source
2311+------
2312+
14082313 ++ su :: parse string
14092314 |* sab=rule
14102315 |= jon=json
@@ -1412,9 +2317,8 @@ Reparse string
14122317 (rush p.jon sab)
14132318 ::
14142319
1415−Reparser generator. Produces a reparser that applies `sab` to a string.
1416−
1417−`sab` is a [`++rule`]().
2320+Examples
2321+--------
14182322
14192323 ~zod/try=> ((su:jo fed:ag) s/'zod')
14202324 [~ 0]
@@ -1429,9 +2333,25 @@ Reparser generator. Produces a reparser that applies `sab` to a string.
14292333
14302334Reparse null
14312335
2336+Reparser modifier. Reparses a null value.
2337+
2338+Accepts
2339+-------
2340+
2341+`jon` is a [`++json`]().
2342+
2343+Produces
2344+--------
2345+
2346+The [`++unit`]() of null.
2347+
2348+Source
2349+------
2350+
14322351 ++ ul |=(jon=json ?~(jon (some ~) ~)) :: null
14332352
1434−Reparser modifier. Reparses a null value.
2353+Examples
2354+--------
14352355
14362356 ~zod/try=> (ul:jo `json`~)
14372357 [~ u=~]
@@ -1446,6 +2366,22 @@ Reparser modifier. Reparses a null value.
14462366
14472367Pole of nonempty units
14482368
2369+Determines if `pod` contains all non-empty units, producing a boolean. Used
2370+internally.
2371+
2372+Accepts
2373+-------
2374+
2375+`pod` is a [`++pole`]() of [`++unit`]().
2376+
2377+Produces
2378+--------
2379+
2380+A boolean.
2381+
2382+Source
2383+------
2384+
14492385 ++ za :: full unit pole
14502386 |* pod=(pole (unit))
14512387 ?~ pod &
@@ -1453,10 +2389,8 @@ Pole of nonempty units
14532389 (za +.pod)
14542390 ::
14552391
1456−Determines if `pod` contains no empty units, producing a loobean. Used
1457−internally.
1458−
1459−`pod` is a [`++pole`]() of [`++unit`]().
2392+Examples
2393+--------
14602394
14612395 ~zod/try=> (za:jo ~[`1 `2 `3])
14622396 %.y
@@ -1467,6 +2401,22 @@ internally.
14672401
14682402Collapse unit list
14692403
2404+Produces a unit of the values of `lut` if every unit in `lut` is
2405+nonempty. Otherwise, produces `~`.
2406+
2407+Accepts
2408+-------
2409+
2410+`lut` is a [`++list`]() of [`++unit`]()s.
2411+
2412+Produces
2413+--------
2414+
2415+A boolean.
2416+
2417+Source
2418+------
2419+
14702420 ++ zl :: collapse unit list
14712421 |* lut=(list (unit))
14722422 ?. |- ^- ?
@@ -1478,11 +2428,8 @@ Collapse unit list
14782428 [i=u:+.i.lut t=$(lut t.lut)]
14792429 ::
14802430
1481−Produces a unit of the values of `lut` if every unit in `lut` is
1482−nonempty. Otherwise, produces `~`. If any of the `++unit`s in `lut` are
1483−empty, produces null.
1484−
1485−`lut` is a [`++list`]() of [`++unit`]()s.
2431+Examples
2432+--------
14862433
14872434 ~zod/try=> (zl:jo `(list (unit))`~[`1 `2 `3])
14882435 [~ u=~[1 2 3]]
@@ -1493,7 +2440,22 @@ empty, produces null.
14932440
14942441### `++zp`
14952442
1496−Parses a
2443+XX
2444+
2445+Collapses a `++pole` of `++unit`s `but`, producing a tuple.
2446+
2447+Accepts
2448+-------
2449+
2450+`but` is a [`++pole`]() of [`++unit`]().
2451+
2452+Produces
2453+--------
2454+
2455+??
2456+
2457+Source
2458+------
14972459
14982460 ++ zp :: unit tuple
14992461 |* but=(pole (unit))
@@ -1503,9 +2465,8 @@ Parses a
15032465 [u:->.but (zp +.but)]
15042466 ::
15052467
1506−Collapses a `++pole` of `++unit`s `but`, producing a tuple.
1507−
1508−`but` is a [`++pole`]() of [`++unit`]().
2468+Examples
2469+--------
15092470
15102471 ~zod/try=> (zp:jo `(pole (unit))`~[`1 `2 `3])
15112472 [1 2 3]
@@ -1518,6 +2479,24 @@ Collapses a `++pole` of `++unit`s `but`, producing a tuple.
15182479
15192480Collapse unit map
15202481
2482+Produces a [`++unit`]() of the [`++map`]() `lum` of term to `++unit` key value
2483+pairs, with all of the nonempty values stripped of their `++unit`
2484+wrappers. If any of the `++units` in `lum` are empty, `~` is produced.
2485+See also: [`++zp`](), [`++zl`]().
2486+
2487+Accepts
2488+-------
2489+
2490+`lum` is a map of [`++term`]() to [`++unit`]()s.
2491+
2492+Produces
2493+--------
2494+
2495+The `++unit` of a tuple of what were the key-value pairs of `lum`.
2496+
2497+Source
2498+------
2499+
15212500 ++ zm :: collapse unit map
15222501 |* lum=(map term (unit))
15232502 ?: (~(rep by lum) | |=([[@ a=(unit)] b=?] |(b ?=(~ a))))
@@ -1525,12 +2504,8 @@ Collapse unit map
15252504 (some (~(run by lum) need))
15262505 ::
15272506
1528−Produces a `++unit` of the map `lum` of term to `++unit` key value
1529−pairs, with all of the nonempty values stripped of their `++unit`
1530−wrappers. If any of the `++units` in `lum` are empty, `~` is produced.
1531−See also: [`++zp`](), [`++zl`]().
1532−
1533−`lum` is a map of [`++term`]() to [`++unit`]()s.
2507+Examples
2508+--------
15342509
15352510 ~zod/try=> (zm:jo `(map term (unit ,@u))`(mo a/`4 b/`1 c/`2 ~))
15362511 [~ {[p=%a q=4] [p=%c q=2] [p=%b q=1]}]
@@ -1549,17 +2524,31 @@ See also: [`++zp`](), [`++zl`]().
15492524
15502525`++json` from key-value pair
15512526
2527+Produces a ++json object with one key-value pair.
2528+
2529+Accepts
2530+-------
2531+
2532+`p` is a `@t` key.
2533+
2534+`q` is a [`++json`]().
2535+
2536+Produces
2537+--------
2538+
2539+A [`++json`]().
2540+
2541+Source
2542+------
2543+
15522544 ++ joba :: object from k-v pair
15532545 |= [p=@t q=json]
15542546 ^- json
15552547 [%o [[p q] ~ ~]]
15562548 ::
15572549
1558−Produces a ++json object with one key.
1559−
1560−`p` is a `@t` key.
1561−
1562−`q` is a [`++json`]().
2550+Examples
2551+--------
15632552
15642553 ~zod/try=> (joba %hi %b |)
15652554 [%o p={[p='hi' q=[%b p=%.n]]}]
@@ -1574,15 +2563,29 @@ Produces a ++json object with one key.
15742563
15752564Object from key-value list
15762565
2566+Produces a `++json` object from a [`++list`]() `a` of key to `++json` values.
2567+
2568+Accepts
2569+-------
2570+
2571+`a` is a [`++list`]() of [`++cord`]() to [`++json`]() values.
2572+
2573+Produces
2574+--------
2575+
2576+A `++json`.
2577+
2578+Source
2579+------
2580+
15772581 ++ jobe :: object from k-v list
15782582 |= a=(list ,[p=@t q=json])
15792583 ^- json
15802584 [%o (~(gas by *(map ,@t json)) a)]
15812585 ::
15822586
1583−Produces a `++json` object from a list `a` of key to `++json` values.
1584−
1585−`a` is a [`++list`]() of [`++cord`]() to [`++json`]() values.
2587+Examples
2588+--------
15862589
15872590 ~zod/try=> (jobe a/n/'20' b/~ c/a/~[s/'mol'] ~)
15882591 [%o p={[p='a' q=[%n p=~.20]] [p='c' q=[%a p=~[[%s p=~.mol]]]] [p='b' q=~]}]
@@ -1593,13 +2596,29 @@ Produces a `++json` object from a list `a` of key to `++json` values.
15932596
15942597`++json` string from tape
15952598
2599+Produces a [`++json`]() string from a [`++tape`]().
2600+
2601+Accepts
2602+-------
2603+
2604+A [`++tape`]().
2605+
2606+Produces
2607+--------
2608+
2609+A `++json`.
2610+
2611+Source
2612+------
2613+
15962614 ++ jape :: string from tape
15972615 |= a=tape
15982616 ^- json
15992617 [%s (crip a)]
16002618 ::
16012619
1602−Produces a [`++json`]() string from a [`++tape`]().
2620+Examples
2621+--------
16032622
16042623 ~zod/try=> (jape ~)
16052624 [%s p=~.]
@@ -1614,6 +2633,21 @@ Produces a [`++json`]() string from a [`++tape`]().
16142633
16152634`++json` number from unigned
16162635
2636+Produces a `++json` number from an unsigned atom.
2637+
2638+Accepts
2639+-------
2640+
2641+`a` is an atom of odor [`@u`]().
2642+
2643+Produces
2644+--------
2645+
2646+A [`++json`]().
2647+
2648+Source
2649+------
2650+
16172651 ++ jone :: number from unsigned
16182652 |= a=@u
16192653 ^- json
@@ -1622,9 +2656,8 @@ Produces a [`++json`]() string from a [`++tape`]().
16222656 (crip (flop |-(^-(tape ?:(=(0 a) ~ [(add '0' (mod a 10)) $(a (div a 10))])))))
16232657 ::
16242658
1625−Produces a `++json` number from an unsigned atom.
1626−
1627−`a` is a [`@u`]().
2659+Examples
2660+--------
16282661
16292662 ~zod/try=> (jone 1)
16302663 [%n p=~.1]
@@ -1639,6 +2672,21 @@ Produces a `++json` number from an unsigned atom.
16392672
16402673Escape JSON character
16412674
2675+Produces a [`++tape`]() of an escaped [`++json`](/doc/hoon/library/3bi#++json) character `a`.
2676+
2677+Accepts
2678+-------
2679+
2680+`a` is an atom of odor [`@tD`](), aka a [`++char`]().
2681+
2682+Produces
2683+--------
2684+
2685+A [`++tape`]().
2686+
2687+Source
2688+------
2689+
16422690 ++ jesc
16432691 |= a=@ ^- tape
16442692 ?+ a [a ~]
@@ -1648,9 +2696,8 @@ Escape JSON character
16482696 ==
16492697 ::
16502698
1651−Produces a `++tape` of an escaped [`++json`](/doc/hoon/library/3bi#++json) character `a`.
1652−
1653−`a` is an atom
2699+Examples
2700+--------
16542701
16552702 ~zod/try=> (jesc 'a')
16562703 "a"
@@ -1661,7 +2708,7 @@ Produces a `++tape` of an escaped [`++json`](/doc/hoon/library/3bi#++json) chara
16612708 ~zod/try=> (jesc '"')
16622709 "\""
16632710
1664−### `++scanf`
2711+### `++scanf` XX
16652712
16662713Formatted scan
16672714
@@ -1693,7 +2740,7 @@ collapses the result list to a tuple, such that (scanf "foo 1 2 bar"
16932740 ~zod/try=> `@da`(year `date`dat(- [%& -.dat], |6 ~[(div (mul |6.dat (bex 16)) 1.000)]))
16942741 ~2014.8.12..23.10.58..ee56
16952742
1696−### `++parsf`
2743+### `++parsf` XX
16972744
16982745 ++ parsf :: make parser from:
16992746 |^ |* a=(pole ,_:/(*$&(_rule tape))) :: ;"chars{rule}chars"
@@ -1710,7 +2757,7 @@ the embedded rules' results.
17102757
17112758Two intermediate arms are used:
17122759
1713−#### ++norm
2760+#### ++norm XX
17142761
17152762 :: .= (norm [;"{n}, {n}"]:n=dim:ag) ~[[& dim] [| ", "] [& dim]]:ag
17162763 ++ norm
@@ -1729,7 +2776,7 @@ Two intermediate arms are used:
17292776`norm` converts a `;"` pole of `[[%~. [%~. ?(tape _rule)] ~] ~]` into a
17302777more convenient list of discriminated tapes and rules.
17312778
1732−#### ++bill
2779+#### ++bill XX
17332780
17342781 :: .= (bill ~[[& dim] [| ", "] [& dim]]:ag)
17352782 :: ;~(plug dim ;~(pfix com ace ;~(plug dim (easy)))):ag
@@ -1747,12 +2794,24 @@ sections and producing a list of the rules' results.
17472794
17482795### `++taco`
17492796
2797+Converts an atom to an octet stream [`++octs`](), which contains a length, to
2798+encode trailing zeroes.
2799+
2800+Produces
2801+--------
2802+
2803+An `++octs`.
2804+
2805+Source
2806+------
2807+
17502808 ++ taco :: atom to octstream
17512809 |= tam=@ ^- octs
17522810 [(met 3 tam) tam]
17532811 ::
17542812
1755−An [octs] contains a length, to encode trailing zeroes.
2813+Examples
2814+--------
17562815
17572816 ~zod/try=> (taco 'abc')
17582817 [p=3 q=6.513.249]
@@ -1761,12 +2820,31 @@ An [octs] contains a length, to encode trailing zeroes.
17612820
17622821### `++tact`
17632822
2823+tape to octs
2824+
2825+Converts a `++tape` to an octet stream ([`++octs`](), which contains a length
2826+to encode trailing zeroes.
2827+
2828+Accepts
2829+-------
2830+
2831+A `++tape`.
2832+
2833+Produces
2834+--------
2835+
2836+An [`++octs`]().
2837+
2838+Source
2839+------
2840+
17642841 ++ tact :: tape to octstream
17652842 |= tep=tape ^- octs
17662843 (taco (rap 3 tep))
17672844 ::
17682845
1769−octs from tape
2846+Examples
2847+--------
17702848
17712849 ~zod/try=> (tact "abc")
17722850 [p=3 q=6.513.249]
@@ -1775,13 +2853,32 @@ octs from tape
17752853
17762854### `++tell`
17772855
2856+octs from wall
2857+
2858+Converts a [`++wall`]() to an octet stream ([`++octs`](), which contains a length
2859+to encode trailing zeroes.
2860+
2861+Accepts
2862+-------
2863+
2864+`wol` is a [`++wall`]().
2865+
2866+Produces
2867+--------
2868+
2869+An `++octs`.
2870+
2871+Source
2872+------
2873+
17782874 ++ tell :: wall to octstream
17792875 |= wol=wall ^- octs
17802876 =+ buf=(rap 3 (turn wol |=(a=tape (crip (weld a `tape`[`@`10 ~])))))
17812877 [(met 3 buf) buf]
17822878 ::
17832879
1784−octs from wall
2880+Examples
2881+--------
17852882
17862883 ~zod/try=> (tell ~["abc" "line" "3"])
17872884 [p=11 q=12.330.290.663.108.538.769.039.969]
@@ -1794,14 +2891,32 @@ octs from wall
17942891
17952892### `++txml`
17962893
2894+Tape to xml CDATA node
2895+
2896+Converts a [`++tape`]() to an xml CDATA node XX
2897+
2898+Accepts
2899+-------
2900+
2901+`tep` is a [`++tape`]().
2902+
2903+Produces
2904+--------
2905+
2906+A [`++manx`]().
2907+
2908+Source
2909+------
2910+
17972911 ++ txml :: string to xml
17982912 |= tep=tape ^- manx
17992913 [[%$ [%$ tep] ~] ~]
18002914 ::
18012915
1802−Tape to xml CDATA node
2916+Examples
2917+--------
18032918
18042919 ~zod/try=> (txml "hi")
18052920 [g=[n=%$ a=~[[n=%$ v="hi"]]] c=~]
18062921 ~zod/try=> (txml "larton bestok")
1807− [g=[n=%$ a=~[[n=%$ v="larton bestok"]]] c=~]
2922+ [