Finish moving and restructuring.
commitd30c2fffabfb50f47facc58307266cc9c8f04acc
authorC. Guy Yarvin <cgyarvin@gmail.com>
dateFri 11 Mar 2016, 16:10 (11 years ago)
parent5221db2
docs/system/hoon/library/core/ab.mddeleted−1365
@@ -1,1365 +0,0 @@
1−### `++ab`
2−
3−Primitive parser engine
4−
5−A core containing numeric parser primitives.
6−
7−Source
8−------
9−
10− ++ ab
11− |%
12−
13−Examples
14−--------
15−
16− ~zod/try=> ab
17− <36.ecc 414.gly 100.xkc 1.ypj %164>
18−
19−------------------------------------------------------------------------
20−
21−### `++bix`
22−
23−Parse hex pair
24−
25−Parsing [`++rule`](). Parses a pair of base-16 digits. Used in escapes.
26−
27−Accepts
28−-------
29−
30−XX
31−
32−Produces
33−--------
34−
35−A an atom. XX
36−
37−Source
38−------
39−
40− ++ bix (bass 16 (stun [2 2] six))
41−
42−Examples
43−--------
44−
45− ~zod/try=> (scan "07" bix:ab)
46− q=7
47− ~zod/try=> (scan "51" bix:ab)
48− q=81
49− ~zod/try=> (scan "a3" bix:ab)
50− q=163
51−
52−------------------------------------------------------------------------
53−
54−### `++hif`
55−
56−Parse phonetic pair
57−
58−Parsing [`++rule`](). Parses an atom of [odor]() [`@pE`](), a phrase of two bytes
59−encoded phonetically.
60−
61−Accepts
62−-------
63−
64−XX
65−
66−Produces
67−--------
68−
69−An atom.
70−
71−Source
72−------
73−
74− ++ hif (boss 256 ;~(plug tip tiq (easy ~)))
75−
76−Examples
77−--------
78−
79− ~zod/try=> (scan "doznec" hif:ab)
80− q=256
81− ~zod/try=> (scan "pittyp" hif:ab)
82− q=48.626
83−
84−------------------------------------------------------------------------
85−
86−### `++huf`
87−
88−Parse two phonetic pairs
89−
90−Parsing [`++rule`](). Parses and unscrambles an atom of odor [@pF](), a phrase
91−of two two-byte pairs that are encoded (and scrambled) phonetically.
92−
93−Accepts
94−-------
95−
96−XX
97−
98−Produces
99−--------
100−
101−An atom. XX
102−
103−Source
104−------
105−
106− ++ huf %+ cook
107− |=([a=@ b=@] (wred:un ~(zug mu ~(zag mu [a b]))))
108− ;~(plug hif ;~(pfix hep hif))
109−
110−Examples
111−--------
112−
113− ~zod/try=> (scan "pittyp-pittyp" huf:ab)
114− 328.203.557
115− ~zod/try=> (scan "tasfyn-partyv" huf:ab)
116− 65.792
117− ~zod/try=> `@ux`(scan "tasfyn-partyv" huf:ab)
118− 0x1.0100
119−
120−------------------------------------------------------------------------
121−
122−### `++hyf`
123−
124−Parse 8 phonetic bytes
125−
126−Parsing [`++rule`](). Parses an atom of odor [@pG](), a phrase of eight of
127−phonetic bytes.
128−
129−Accepts
130−-------
131−
132−An atom of odor [`@pG`]()
133−
134−Produces
135−--------
136−
137−An atom. XX
138−
139−Source
140−------
141−
142− ++ hyf (bass 0x1.0000.0000 ;~(plug huf ;~(pfix hep huf) (easy ~)))
143−
144−Examples
145−--------
146−
147− ~zod/try=> (scan "sondel-forsut-tillyn-nillyt" hyf:ab)
148− q=365.637.097.828.335.095
149− ~zod/try=> `@u`~sondel-forsut-tillyn-nillyt
150− 365.637.097.828.335.095
151−
152−------------------------------------------------------------------------
153−
154−### `++pev`
155−
156−Parse \<= 5 base-32
157−
158−Parsing [`++rule`](). Parses up to five base-32 digits without a leading zero.
159−
160−Accepts
161−-------
162−
163−Up to five [@uv]() (base 64) digits.
164−
165−Produces
166−--------
167−
168−An atom.
169−
170−Source
171−------
172−
173− ++ pev (bass 32 ;~(plug sev (stun [0 4] siv)))
174−
175−Examples
176−--------
177−
178− ~zod/try=> (scan "a" pev:ab)
179− q=10
180− ~zod/try=> (scan "290j" pev:ab)
181− q=74.771
182− ~zod/try=> (scan "123456" pev:ab)
183− ! {1 6}
184− ! exit
185− ~zod/try=> (scan "090j" pev:ab)
186− ~ <syntax error at [1 11]>
187−
188−------------------------------------------------------------------------
189−
190−### `++pew`
191−
192−Parse \<= 5 base-64
193−
194−Parsing [`++rule`](). Parses up to five base-64 digits without a leading zero.
195−
196−Accepts
197−-------
198−
199−Up to five [@uw]() (base 64) digits.
200−
201−Produces
202−--------
203−
204−
205−
206−Source
207−------
208−
209− ++ pew (bass 64 ;~(plug sew (stun [0 4] siw)))
210−
211−Examples
212−--------
213−
214− ~zod/try=> (scan "Q" pew:ab)
215− q=52
216− ~zod/try=> (scan "aQ~9" pew:ab)
217− q=2.838.473
218− ~zod/try=> `@`0waQ~9
219− 2.838.473
220− ~zod/try=> (scan "123456" pew:ab)
221− ! {1 6}
222− ! exit
223− ~zod/try=> (scan "012345" pew:ab)
224− ! {1 1}
225− ! exit
226−
227−------------------------------------------------------------------------
228−
229−### `++piv`
230−
231−Parse 5 base-32
232−
233−Parsing [`++rule`](). Parses exactly five base-32 digits.
234−
235−Accepts
236−-------
237−
238−Produces
239−--------
240−
241−Source
242−------
243−
244− ++ piv (bass 32 (stun [5 5] siv))
245−
246−Examples
247−--------
248−
249− ~zod/try=> (scan "10b3l" piv:ab)
250− q=1.059.957
251− ~zod/try=> (scan "1" piv:ab)
252− ! {1 2}
253− ! exit
254−
255−------------------------------------------------------------------------
256−
257−### `++piw`
258−
259−Parse 5 base-64
260−
261−Parsing [`++rule`](). Parses exactly five base-64 digits.
262−
263−Accepts
264−-------
265−
266−Produces
267−--------
268−
269−My name henry let's see how fast I can type.
270−
271−Source
272−------
273−
274− ++ piw (bass 64 (stun [5 5] siw))
275−
276−Examples
277−--------
278−
279− ~zod/try=> (scan "2C-pZ" piw:ab)
280− q=43.771.517
281− ~zod/try=> (scan "2" piv:ab)
282− ! {1 2}
283− ! exit
284−
285−------------------------------------------------------------------------
286−
287−### `++qeb`
288−
289−Parse \<= 4 binary
290−
291−Parsing [`++rule`](). Parses a binary number of up to 4 digits in length without
292−a leading zero.
293−
294−Accepts
295−-------
296−
297−Produces
298−--------
299−
300−Source
301−------
302−
303− ++ qeb (bass 2 ;~(plug seb (stun [0 3] sib)))
304−
305−Examples
306−--------
307−
308− ~zod/try=> (scan "1" qeb:ab)
309− q=1
310− ~zod/try=> (scan "101" qeb:ab)
311− q=5
312− ~zod/try=> (scan "1111" qeb:ab)
313− q=15
314− ~zod/try=> (scan "11111" qeb:ab)
315− ! {1 5}
316− ! exit
317− ~zod/try=> (scan "01" qeb:ab)
318− ! {1 1}
319− ! exit
320−
321−------------------------------------------------------------------------
322−
323−### `++qex`
324−
325−Parse \<= 4 hex
326−
327−Parsing [`++rule`](). Parses a hexadecimal number of up to 4 digits in length
328−without a leading zero.
329−
330−Accepts
331−-------
332−
333−Produces
334−--------
335−
336−Source
337−------
338−
339− ++ qex (bass 16 ;~(plug sex (stun [0 3] hit)))
340−
341−Examples
342−--------
343−
344− ~zod/try=> (scan "ca" qex:ab)
345− q=202
346− ~zod/try=> (scan "18ac" qex:ab)
347− q=6.316
348− ~zod/try=> (scan "18acc" qex:ab)
349− ! {1 5}
350− ! exit
351− ~zod/try=> (scan "08ac" qex:ab)
352− ! {1 1}
353− ! exit
354−
355−------------------------------------------------------------------------
356−
357−### `++qib`
358−
359−Parse 4 binary
360−
361−Parsing [`++rule`](). Parses exactly four binary digits.
362−
363−Accepts
364−-------
365−
366−Produces
367−--------
368−
369−Source
370−------
371−
372− ++ qib (bass 2 (stun [4 4] sib))
373−
374−Examples
375−--------
376−
377− ~zod/try=> (scan "0001" qib:ab)
378− q=1
379− ~zod/try=> (scan "0100" qib:ab)
380− q=4
381− ~zod/try=> (scan "110" qib:ab)
382− ! {1 4}
383− ! exit
384−
385−------------------------------------------------------------------------
386−
387−### `++qix`
388−
389−Parse 4 hex
390−
391−Parsing [`++rule`](). Parses exactly four hexadecimal digits.
392−
393−Accepts
394−-------
395−
396−Produces
397−--------
398−
399−Source
400−------
401−
402− ++ qix (bass 16 (stun [4 4] six))
403−
404−Examples
405−--------
406−
407− ~zod/try=> (scan "0100" qix:ab)
408− q=256
409− ~zod/try=> (scan "10ff" qix:ab)
410− q=4.351
411− ~zod/try=> (scan "0" qix:ab)
412− ! {1 2}
413− ! exit
414−
415−------------------------------------------------------------------------
416−
417−### `++seb`
418−
419−Parse 1
420−
421−Parsing [`++rule`](). Parses the number 1.
422−
423−Accepts
424−-------
425−
426−Produces
427−--------
428−
429−Source
430−------
431−
432− ++ seb (cold 1 (just '1'))
433−
434−Examples
435−--------
436−
437− ~zod/try=> (scan "1" seb:ab)
438− 1
439− ~zod/try=> (scan "0" seb:ab)
440− ! ~zod/try/~2014.10.23..22.34.21..bfdd/:<[1 1].[1 18]>
441− ! {1 1}
442− ~zod/try=> (scan "2" seb:ab)
443− ! ~zod/try/~2014.10.23..22.34.29..d399/:<[1 1].[1 18]>
444− ! {1 1}
445−
446−------------------------------------------------------------------------
447−
448−### `++sed`
449−
450−Parse decimal
451−
452−Parsing [`++rule`](). Parses a nonzero decimal digit.
453−
454−Accepts
455−-------
456−
457−Produces
458−--------
459−
460−Source
461−------
462−
463− ++ sed (cook |=(a=@ (sub a '0')) (shim '1' '9'))
464−
465−Examples
466−--------
467−
468− ~zod/try=> (scan "5" sed:ab)
469− 5
470− ~zod/try=> (scan "0" sed:ab)
471− ! {1 1}
472− ! exit
473−
474−------------------------------------------------------------------------
475−
476−### `++sev`
477−
478−Parse base-32
479−
480−Parsing [`++rule`](). Parses a nonzero base-32 digit
481−
482−Accepts
483−-------
484−
485−Produces
486−--------
487−
488−Source
489−------
490−
491− ++ sev ;~(pose sed sov)
492−
493−Examples
494−--------
495−
496− ~zod/try=> (scan "c" sev:ab)
497− 12
498− ~zod/socialnet=> (scan "0" sev:ab)
499− ! {1 1}
500− ! exit
501−
502−------------------------------------------------------------------------
503−
504−### `++sew`
505−
506−Parse base-64
507−
508−Parsing [`++rule`](). Parses a nonzero base-64 digit
509−
510−Accepts
511−-------
512−
513−Produces
514−--------
515−
516−Source
517−------
518−
519− ++ sew ;~(pose sed sow)
520−
521−Examples
522−--------
523−
524− ~zod/try=> (scan "M" sew:ab)
525− 48
526− ~zod/try=> (scan "0" sew:ab)
527− ! {1 1}
528− ! exit
529−
530−------------------------------------------------------------------------
531−
532−### `++sex`
533−
534−Parse hex
535−
536−Parsing [`++rule`](). Parses a nonzero hexadecimal digit.
537−
538−Accepts
539−-------
540−
541−Produces
542−--------
543−
544−Source
545−------
546−
547− ++ sex ;~(pose sed sox)
548−
549−Examples
550−--------
551−
552− ~zod/try=> (scan "e" sex:ab)
553− 14
554− ~zod/try=> (scan "0" sex:ab)
555− ! {1 1}
556− ! exit
557−
558−------------------------------------------------------------------------
559−
560−### `++sib`
561−
562−Parse binary
563−
564−Parsing [`++rule`](). Parses a binary digit.
565−
566−Accepts
567−-------
568−
569−Produces
570−--------
571−
572−Source
573−------
574−
575− ++ sib (cook |=(a=@ (sub a '0')) (shim '0' '1'))
576−
577−Examples
578−--------
579−
580− ~zod/try=> (scan "1" sib:ab)
581− 1
582− ~zod/socialnet=> (scan "0" sib:ab)
583− 0
584−
585−------------------------------------------------------------------------
586−
587−### `++sid`
588−
589−Parse decimal
590−
591−Parsing [`++rule`](). Parses a decimal digit.
592−
593−Accepts
594−-------
595−
596−Produces
597−--------
598−
599−Source
600−------
601−
602− ++ sid (cook |=(a=@ (sub a '0')) (shim '0' '9'))
603−
604−Examples
605−--------
606−
607− ~zod/try=> (scan "5" sid:ab)
608− 5
609−
610−------------------------------------------------------------------------
611−
612−### `++siv`
613−
614−Parse base-32
615−
616−Parsing [`++rule`](). Parses a base-32 digit.
617−
618−Accepts
619−-------
620−
621−Produces
622−--------
623−
624−Source
625−------
626−
627− ++ siv ;~(pose sid sov)
628−
629−Examples
630−--------
631−
632− ~zod/try=> (scan "c" siv:ab)
633− 12
634−
635−------------------------------------------------------------------------
636−
637−### `++siw`
638−
639−Parse base-64
640−
641−Parsing [`++rule`](). Parses a base-64 digit.
642−
643−Accepts
644−-------
645−
646−Produces
647−--------
648−
649−Source
650−------
651−
652− ++ siw ;~(pose sid sow)
653−
654−Examples
655−--------
656−
657− ~zod/try=> (scan "M" siw:ab)
658− 48
659−
660−------------------------------------------------------------------------
661−
662−### `++six`
663−
664−Parse hex
665−
666−Parsing [`++rule`](). Parses a hexadecimal digit.
667−
668−Accepts
669−-------
670−
671−Produces
672−--------
673−
674−Source
675−------
676−
677− ++ six ;~(pose sid sox)
678−
679−Examples
680−--------
681−
682− ~zod/try=> (scan "e" six:ab)
683− 14
684−
685−------------------------------------------------------------------------
686−
687−### `++sov`
688−
689−Parse base-32
690−
691−Parsing [`++rule`](). Parses a base-32 letter.
692−
693−Accepts
694−-------
695−
696−Produces
697−--------
698−
699−Source
700−------
701−
702− ++ sov (cook |=(a=@ (sub a 87)) (shim 'a' 'v'))
703−
704−Examples
705−--------
706−
707− ~zod/try=> (scan "c" sov:ab)
708− 12
709−
710−------------------------------------------------------------------------
711−
712−### `++sow`
713−
714−Parse base-64
715−
716−Parsing [`++rule`](). Parses a base-64 letter/symbol.
717−
718−Accepts
719−-------
720−
721−Produces
722−--------
723−
724−Source
725−------
726−
727− ++ sow ;~ pose
728− (cook |=(a=@ (sub a 87)) (shim 'a' 'z'))
729− (cook |=(a=@ (sub a 29)) (shim 'A' 'Z'))
730− (cold 62 (just '-'))
731− (cold 63 (just '~'))
732− ==
733−
734−Examples
735−--------
736−
737− ~zod/try=> (scan "M" sow:ab)
738− 48
739−
740−------------------------------------------------------------------------
741−
742−### `++sox`
743−
744−Parse hex letter
745−
746−Parsing [`++rule`](). Parses a hexadecimal letter.
747−
748−Accepts
749−-------
750−
751−Produces
752−--------
753−
754−Source
755−------
756−
757− ++ sox (cook |=(a=@ (sub a 87)) (shim 'a' 'f'))
758−
759−Examples
760−--------
761−
762− ~zod/try=> (scan "e" sox:ab)
763− 14
764−
765−------------------------------------------------------------------------
766−
767−### `++ted`
768−
769−Parse \<= 3 decimal
770−
771−Parsing [`++rule`](). Parses a decimal number of up to 3 digits without a
772−leading zero.
773−
774−Accepts
775−-------
776−
777−Produces
778−--------
779−
780−Source
781−------
782−
783− ++ ted (bass 10 ;~(plug sed (stun [0 2] sid)))
784−
785−Examples
786−--------
787−
788− ~zod/try=> (scan "21" ted:ab)
789− q=21
790− ~zod/try=> (scan "214" ted:ab)
791− q=214
792− ~zod/try=> (scan "2140" ted:ab)
793− {1 4}
794− ~zod/try=> (scan "0" ted:ab)
795− ! {1 1}
796− ! exit
797−
798−------------------------------------------------------------------------
799−
800−### `++tip`
801−
802−Leading phonetic byte
803−
804−Parsing [`++rule`](). Parses the leading phonetic byte, which represents a
805−syllable.
806−
807−Accepts
808−-------
809−
810−Produces
811−--------
812−
813−Source
814−------
815−
816− ++ tip (sear |=(a=@ (ins:po a)) til)
817−
818−Examples
819−--------
820−
821− ~zod/try=> (scan "doz" tip:ab)
822− 0
823− ~zod/try=> (scan "pit" tip:ab)
824− 242
825−
826−------------------------------------------------------------------------
827−
828−### `++tiq`
829−
830−Trailing phonetic syllable
831−
832−Parsing [`++rule`](). Parses the trailing phonetic byte, which represents a
833−syllable.
834−
835−Accepts
836−-------
837−
838−Produces
839−--------
840−
841−Source
842−------
843−
844− ++ tiq (sear |=(a=@ (ind:po a)) til)
845−
846−Examples
847−--------
848−
849− ~zod/try=> (scan "zod" tiq:ab)
850− 0
851− ~zod/try=> (scan "nec" tiq:ab)
852− 1
853−
854−------------------------------------------------------------------------
855−
856−### `++tid`
857−
858−Parse 3 decimal digits
859−
860−Parsing [`++rule`](). Parses exactly three decimal digits.
861−
862−Accepts
863−-------
864−
865−Produces
866−--------
867−
868−Source
869−------
870−
871− ++ tid (bass 10 (stun [3 3] sid))
872−
873−Examples
874−--------
875−
876− ~zod/try=> (scan "013" tid:ab)
877− q=13
878− ~zod/try=> (scan "01" tid:ab)
879− ! {1 3}
880− ! exit
881−
882−------------------------------------------------------------------------
883−
884−### `++til`
885−
886−Parse 3 lowercase
887−
888−Parsing [`++rule`](). Parses exactly three lowercase letters.
889−
890−Accepts
891−-------
892−
893−Produces
894−--------
895−
896−Source
897−------
898−
899− ++ til (boss 256 (stun [3 3] low))
900−
901−Examples
902−--------
903−
904− ~zod/try=> (scan "mer" til:ab)
905− q=7.497.069
906− ~zod/try=> `@t`(scan "mer" til:ab)
907− 'mer'
908− ~zod/try=> (scan "me" til:ab)
909− ! {1 3}
910− ! exit
911−
912−------------------------------------------------------------------------
913−
914−### `++urs`
915−
916−Parse span characters
917−
918−Parsing rule. Parses characters from an atom of the span odor [`@ta`]().
919−
920−Accepts
921−-------
922−
923−Produces
924−--------
925−
926−Source
927−------
928−
929− ++ urs %+ cook
930− |=(a=tape (rap 3 ^-((list ,@) a)))
931− (star ;~(pose nud low hep dot sig cab))
932−
933−Examples
934−--------
935−
936− ~zod/try=> `@ta`(scan "asa-lom_tak" urs:ab)
937− ~.asa-lom_tak
938− ~zod/try=> `@t`(scan "asa-lom_tak" urs:ab)
939− 'asa-lom_tak'
940−
941−------------------------------------------------------------------------
942−
943−### `++urt`
944−
945−Parse non-`_` span
946−
947−Parsing rule. Parses all characters of the span odor [`@ta`]() except
948−for cab, `_`.
949−
950−Accepts
951−-------
952−
953−Produces
954−--------
955−
956−Source
957−------
958−
959− ++ urt %+ cook
960− |=(a=tape (rap 3 ^-((list ,@) a)))
961− (star ;~(pose nud low hep dot sig))
962−
963−Examples
964−--------
965−
966− ~zod/try=> `@t`(scan "asa-lom.t0k" urt:ab)
967− 'asa-lom.t0k'
968−
969−------------------------------------------------------------------------
970−
971−### `++voy`
972−
973−Parse bas, soq, or bix
974−
975−Parsing rule. Parses an escaped backslash, single quote, or hex pair
976−byte.
977−
978−Accepts
979−-------
980−
981−Produces
982−--------
983−
984−Source
985−------
986−
987− ++ voy ;~(pfix bas ;~(pose bas soq bix))
988−
989−Examples
990−--------
991−
992− ~zod/try=> (scan "\\0a" voy:ab)
993− q=10
994− ~zod/try=> (scan "\\'" voy:ab)
995− q=39
996−
997−------------------------------------------------------------------------
998−
999−### `++ag`
1000−
1001−Top-level atom parser engine
1002−
1003−A core containing top-level atom parsers.
1004−
1005−Accepts
1006−-------
1007−
1008−Produces
1009−--------
1010−
1011−Source
1012−------
1013−
1014− ++ ag
1015− |%
1016−
1017−Examples
1018−--------
1019−
1020− ~zod/try=> ag
1021− <14.vpu 414.mof 100.xkc 1.ypj %164>
1022−
1023−------------------------------------------------------------------------
1024−
1025−### `++ape`
1026−
1027−Parse 0 or rule
1028−
1029−Parser modifier. Parses 0 or the sample rule `fel`.
1030−
1031−Accepts
1032−-------
1033−
1034−Produces
1035−--------
1036−
1037−`fel` is a [`rule`]().
1038−
1039−Source
1040−------
1041−
1042− ++ ape |*(fel=_rule ;~(pose (cold 0 (just '0')) fel))
1043−
1044−Examples
1045−--------
1046−
1047− ~zod/try=> (scan "202" (star (ape:ag (cold 2 (just '2')))))
1048− ~[2 0 2]
1049−
1050−------------------------------------------------------------------------
1051−
1052−### `++bay`
1053−
1054−Parses binary number
1055−
1056−Parsing rule. Parses a binary number without a leading zero.
1057−
1058−Accepts
1059−-------
1060−
1061−Produces
1062−--------
1063−
1064−Source
1065−------
1066−
1067− ++ bay (ape (bass 16 ;~(plug qeb:ab (star ;~(pfix dog qib:ab)))))
1068−
1069−Examples
1070−--------
1071−
1072− ~zod/try=> (scan "10.0110" bay:ag)
1073− q=38
1074−
1075−------------------------------------------------------------------------
1076−
1077−### `++bip`
1078−
1079−Parse IPv6
1080−
1081−Parsing rule. Parses a [`@is`](), an IPv6 address.
1082−
1083−Accepts
1084−-------
1085−
1086−Produces
1087−--------
1088−
1089−Source
1090−------
1091−
1092− ++ bip =+ tod=(ape qex:ab)
1093− (bass 0x1.0000 ;~(plug tod (stun [7 7] ;~(pfix dog tod))))
1094−
1095−Examples
1096−--------
1097−
1098− ~zod/try=> (scan "0.0.ea.3e6c.0.0.0.0" bip:ag)
1099− q=283.183.420.760.121.105.516.068.864
1100− ~zod/try=> `@is`(scan "0.0.ea.3e6c.0.0.0.0" bip:ag)
1101− .0.0.ea.3e6c.0.0.0.0
1102−
1103−------------------------------------------------------------------------
1104−
1105−### `++dem`
1106−
1107−Parse decimal with dots
1108−
1109−Parsing rule. Parses a decimal number that includes dot separators.
1110−
1111−Accepts
1112−-------
1113−
1114−Produces
1115−--------
1116−
1117−Source
1118−------
1119−
1120− ++ dem (ape (bass 1.000 ;~(plug ted:ab (star ;~(pfix dog tid:ab)))))
1121−
1122−Examples
1123−--------
1124−
1125− ~zod/try=> (scan "52" dem:ag)
1126− q=52
1127− ~zod/try=> (scan "13.507" dem:ag)
1128− q=13.507
1129−
1130−------------------------------------------------------------------------
1131−
1132−### `++dim`
1133−
1134−Parse decimal number
1135−
1136−Parsing rule. Parses a decimal number without a leading zero.
1137−
1138−Accepts
1139−-------
1140−
1141−Produces
1142−--------
1143−
1144−Source
1145−------
1146−
1147− ++ dim (ape (bass 10 ;~(plug sed:ab (star sid:ab))))
1148−
1149−Examples
1150−--------
1151−
1152− ~zod/try=> (scan "52" dim:ag)
1153− q=52
1154− ~zod/try=> (scan "013507" dim:ag)
1155− ! {1 2}
1156− ! exit
1157−
1158−------------------------------------------------------------------------
1159−
1160−### `++dum`
1161−
1162−Parse decimal with leading `0`
1163−
1164−Parsing rule. Parses a decmial number with leading zeroes.
1165−
1166−Accepts
1167−-------
1168−
1169−Produces
1170−--------
1171−
1172−Source
1173−------
1174−
1175− ++ dum (bass 10 (plus sid:ab))
1176−
1177−Examples
1178−--------
1179−
1180− ~zod/try=> (scan "52" dum:ag)
1181− q=52
1182− ~zod/try=> (scan "0000052" dum:ag)
1183− q=52
1184− ~zod/try=> (scan "13507" dim:ag)
1185− q=13.507
1186−
1187−------------------------------------------------------------------------
1188−
1189−### `++fed`
1190−
1191−Parse phonetic base
1192−
1193−Parsing rule. Parses an atom of odor [`@p`](), the phonetic base.
1194−
1195−Accepts
1196−-------
1197−
1198−Produces
1199−--------
1200−
1201−Source
1202−------
1203−
1204− ++ fed ;~ pose
1205− (bass 0x1.0000.0000.0000.0000 (most doh hyf:ab))
1206− huf:ab
1207− hif:ab
1208− tiq:ab
1209− ==
1210−
1211−Examples
1212−--------
1213−
1214− ~zod/try=> (scan "zod" fed:ag)
1215− 0
1216− ~zod/try=> (scan "nec" fed:ag)
1217− 1
1218− ~zod/try=> (scan "sondel" fed:ag)
1219− 9.636
1220− ~zod/try=> ~tillyn-nillyt
1221− ~tillyn-nillyt
1222− ~zod/try=> (scan "tillyn-nillyt" fed:ag)
1223− 3.569.565.175
1224− ~zod/try=> (scan "tillyn-nillyt-tasfyn-partyv" fed:ag)
1225− 15.331.165.687.565.582.592
1226− ~zod/try=> (scan "tillyn-nillyt-tasfyn-partyv--novweb-talrud-talmud-sonfyr" fed:ag)
1227− 282.810.089.790.159.633.869.501.053.313.363.681.181
1228−
1229−------------------------------------------------------------------------
1230−
1231−### `++hex`
1232−
1233−Parse hex
1234−
1235−Parsing rule. Parses a hexadecimal number
1236−
1237−Accepts
1238−-------
1239−
1240−Produces
1241−--------
1242−
1243−Source
1244−------
1245−
1246− ++ hex (ape (bass 0x1.0000 ;~(plug qex:ab (star ;~(pfix dog qix:ab)))))
1247−
1248−Examples
1249−--------
1250−
1251− ~zod/try=> (scan "4" hex:ag)
1252− q=4
1253− ~zod/try=> (scan "1a" hex:ag)
1254− q=26
1255− ~zod/try=> (scan "3.ac8d" hex:ag)
1256− q=240.781
1257− ~zod/try=> `@ux`(scan "3.ac8d" hex:ag)
1258− 0x3.ac8d
1259−
1260−------------------------------------------------------------------------
1261−
1262−### `++lip`
1263−
1264−Parse IPv4 address
1265−
1266−Parsing rule. Parses an IPv4 address.
1267−
1268−Accepts
1269−-------
1270−
1271−Produces
1272−--------
1273−
1274−Source
1275−------
1276−
1277− ++ lip =+ tod=(ape ted:ab)
1278− (bass 256 ;~(plug tod (stun [3 3] ;~(pfix dog tod))))
1279−
1280−Examples
1281−--------
1282−
1283− ~zod/try=> (scan "127.0.0.1" lip:ag)
1284− q=2.130.706.433
1285− ~zod/try=> `@if`(scan "127.0.0.1" lip:ag)
1286− .127.0.0.1
1287− ~zod/try=> `@if`(scan "8.8.8.8" lip:ag)
1288− .8.8.8.8
1289−
1290−------------------------------------------------------------------------
1291−
1292−### `++viz`
1293−
1294−Parse Base-32 with dots
1295−
1296−Parsing rule. Parses a Base-32 number with dot separators.
1297−
1298−Accepts
1299−-------
1300−
1301−Produces
1302−--------
1303−
1304−Source
1305−------
1306−
1307− ++ viz (ape (bass 0x200.0000 ;~(plug pev:ab (star ;~(pfix dog piv:ab)))))
1308−
1309−Examples
1310−--------
1311−
1312− ~zod/try=> (scan "e2.ol4pm" viz:ag)
1313− q=15.125.353.270
1314−
1315−------------------------------------------------------------------------
1316−
1317−### `++vum`
1318−
1319−Parse base-32 string
1320−
1321−Parsing rule. Parses a raw base-32 string.
1322−
1323−Accepts
1324−-------
1325−
1326−Produces
1327−--------
1328−
1329−Source
1330−------
1331−
1332− ++ vum (bass 32 (plus siv:ab))
1333−
1334−Examples
1335−--------
1336−
1337− ~zod/try=> (scan "e2ol4pm" vum:ag)
1338− q=15.125.353.270
1339−
1340−------------------------------------------------------------------------
1341−
1342−### `++wiz`
1343−
1344−Parse base-64
1345−
1346−Parsing rule. Parses a base-64 number.
1347−
1348−Accepts
1349−-------
1350−
1351−Produces
1352−--------
1353−
1354−Source
1355−------
1356−
1357− ++ wiz (ape (bass 0x4000.0000 ;~(plug pew:ab (star ;~(pfix dog piw:ab)))))
1358− --
1359− ::
1360−
1361−Examples
1362−--------
1363−
1364− ~zod/try=> (scan "e2O.l4Xpm" wiz:ag)
1365− q=61.764.130.813.526
docs/system/hoon/library/core/aesc.mddeleted−712
@@ -1,712 +0,0 @@
1−### `++aesc`
2−
3− ++ aesc :: AES-256
4− ~% %aesc + ~
5− |%
6−
7−XX document
8−
9−### `++en`
10−
11− ++ en :: ECB enc
12− ~/ %en
13− |= [a=@I b=@H] ^- @uxH
14− =+ ahem
15− (be & (ex a) b)
16−
17−XX document
18−
19−### `++de`
20−
21− ++ de :: ECB dec
22− ~/ %de
23− |= [a=@I b=@H] ^- @uxH
24− =+ ahem
25− (be | (ix (ex a)) b)
26− --
27−
28−XX document
29−
30−### `++ahem`
31−
32− ++ ahem :: AES helpers
33− :: XX should be in aesc, isn't for performance reasons
34− =>
35− =+ =+ [gr=(ga 8 0x11b 3) few==>(fe .(a 5))]
36− =+ [pro=pro.gr dif=dif.gr pow=pow.gr ror=ror.few]
37− [pro=pro dif=dif pow=pow ror=ror nnk=8 nnb=4 nnr=14]
38− => |%
39−
40−XX document
41−
42−### `++cipa`
43−
44− ++ cipa :: AES params
45− $_ ^? |%
46−
47−XX document
48−
49−### `++co`
50−
51− ++ co [0xe 0xb 0xd 0x9]
52−
53−XX document
54−
55−### `++ix`
56−
57− ++ ix :: key expand, inv
58− |= a=@ ^- @
59− =+ [i=1 j=_@ b=_@ c=co:pin]
60− |-
61− ?: =(nnr i)
62− a
63− => .(b (cut 7 [i 1] a))
64− => .(b (rep 5 (mcol (pode 5 4 b) c)))
65− => .(j (sub nnr i))
66− %= $
67− i +(i)
68− a
69− %+ can 7
70− :~ [i (cut 7 [0 i] a)]
71− [1 b]
72− [j (cut 7 [+(i) j] a)]
73− ==
74− ==
75− --
76− ::
77−
78−XX document
79−
80−### `++ro`
81−
82− ++ ro [0 3 2 1]
83−
84−XX document
85−
86−### `++su`
87−
88− ++ su 0x7d0c.2155.6314.69e1.26d6.77ba.7e04.2b17.
89− 6199.5383.3cbb.ebc8.b0f5.2aae.4d3b.e0a0.
90− ef9c.c993.9f7a.e52d.0d4a.b519.a97f.5160.
91− 5fec.8027.5910.12b1.31c7.0788.33a8.dd1f.
92− f45a.cd78.fec0.db9a.2079.d2c6.4b3e.56fc.
93− 1bbe.18aa.0e62.b76f.89c5.291d.711a.f147.
94− 6edf.751c.e837.f9e2.8535.ade7.2274.ac96.
95− 73e6.b4f0.cecf.f297.eadc.674f.4111.913a.
96− 6b8a.1301.03bd.afc1.020f.3fca.8f1e.2cd0.
97− 0645.b3b8.0558.e4f7.0ad3.bc8c.00ab.d890.
98− 849d.8da7.5746.155e.dab9.edfd.5048.706c.
99− 92b6.655d.cc5c.a4d4.1698.6886.64f6.f872.
100− 25d1.8b6d.49a2.5b76.b224.d928.66a1.2e08.
101− 4ec3.fa42.0b95.4cee.3d23.c2a6.3294.7b54.
102− cbe9.dec4.4443.8e34.87ff.2f9b.8239.e37c.
103− fbd7.f381.9ea3.40bf.38a5.3630.d56a.0952
104− --
105− ::
106−
107−XX document
108−
109−### `++pen`
110−
111− ++ pen :: encrypt
112− ^- cipa
113− |%
114−
115−XX document
116−
117−### `++co`
118−
119− ++ co [0xe 0xb 0xd 0x9]
120−
121−XX document
122−
123−### `++ix`
124−
125− ++ ix :: key expand, inv
126− |= a=@ ^- @
127− =+ [i=1 j=_@ b=_@ c=co:pin]
128− |-
129− ?: =(nnr i)
130− a
131− => .(b (cut 7 [i 1] a))
132− => .(b (rep 5 (mcol (pode 5 4 b) c)))
133− => .(j (sub nnr i))
134− %= $
135− i +(i)
136− a
137− %+ can 7
138− :~ [i (cut 7 [0 i] a)]
139− [1 b]
140− [j (cut 7 [+(i) j] a)]
141− ==
142− ==
143− --
144− ::
145−
146−XX document
147−
148−### `++ro`
149−
150− ++ ro [0 3 2 1]
151−
152−XX document
153−
154−### `++su`
155−
156− ++ su 0x7d0c.2155.6314.69e1.26d6.77ba.7e04.2b17.
157− 6199.5383.3cbb.ebc8.b0f5.2aae.4d3b.e0a0.
158− ef9c.c993.9f7a.e52d.0d4a.b519.a97f.5160.
159− 5fec.8027.5910.12b1.31c7.0788.33a8.dd1f.
160− f45a.cd78.fec0.db9a.2079.d2c6.4b3e.56fc.
161− 1bbe.18aa.0e62.b76f.89c5.291d.711a.f147.
162− 6edf.751c.e837.f9e2.8535.ade7.2274.ac96.
163− 73e6.b4f0.cecf.f297.eadc.674f.4111.913a.
164− 6b8a.1301.03bd.afc1.020f.3fca.8f1e.2cd0.
165− 0645.b3b8.0558.e4f7.0ad3.bc8c.00ab.d890.
166− 849d.8da7.5746.155e.dab9.edfd.5048.706c.
167− 92b6.655d.cc5c.a4d4.1698.6886.64f6.f872.
168− 25d1.8b6d.49a2.5b76.b224.d928.66a1.2e08.
169− 4ec3.fa42.0b95.4cee.3d23.c2a6.3294.7b54.
170− cbe9.dec4.4443.8e34.87ff.2f9b.8239.e37c.
171− fbd7.f381.9ea3.40bf.38a5.3630.d56a.0952
172− --
173− ::
174−
175−XX document
176−
177−### `++pin`
178−
179− ++ pin :: decrypt
180− ^- cipa
181− |%
182−
183−XX document
184−
185−### `++co`
186−
187− ++ co [0xe 0xb 0xd 0x9]
188−
189−XX document
190−
191−### `++ix`
192−
193− ++ ix :: key expand, inv
194− |= a=@ ^- @
195− =+ [i=1 j=_@ b=_@ c=co:pin]
196− |-
197− ?: =(nnr i)
198− a
199− => .(b (cut 7 [i 1] a))
200− => .(b (rep 5 (mcol (pode 5 4 b) c)))
201− => .(j (sub nnr i))
202− %= $
203− i +(i)
204− a
205− %+ can 7
206− :~ [i (cut 7 [0 i] a)]
207− [1 b]
208− [j (cut 7 [+(i) j] a)]
209− ==
210− ==
211− --
212− ::
213−
214−XX document
215−
216−### `++ro`
217−
218− ++ ro [0 3 2 1]
219−
220−XX document
221−
222−### `++su`
223−
224− ++ su 0x7d0c.2155.6314.69e1.26d6.77ba.7e04.2b17.
225− 6199.5383.3cbb.ebc8.b0f5.2aae.4d3b.e0a0.
226− ef9c.c993.9f7a.e52d.0d4a.b519.a97f.5160.
227− 5fec.8027.5910.12b1.31c7.0788.33a8.dd1f.
228− f45a.cd78.fec0.db9a.2079.d2c6.4b3e.56fc.
229− 1bbe.18aa.0e62.b76f.89c5.291d.711a.f147.
230− 6edf.751c.e837.f9e2.8535.ade7.2274.ac96.
231− 73e6.b4f0.cecf.f297.eadc.674f.4111.913a.
232− 6b8a.1301.03bd.afc1.020f.3fca.8f1e.2cd0.
233− 0645.b3b8.0558.e4f7.0ad3.bc8c.00ab.d890.
234− 849d.8da7.5746.155e.dab9.edfd.5048.706c.
235− 92b6.655d.cc5c.a4d4.1698.6886.64f6.f872.
236− 25d1.8b6d.49a2.5b76.b224.d928.66a1.2e08.
237− 4ec3.fa42.0b95.4cee.3d23.c2a6.3294.7b54.
238− cbe9.dec4.4443.8e34.87ff.2f9b.8239.e37c.
239− fbd7.f381.9ea3.40bf.38a5.3630.d56a.0952
240− --
241− ::
242−
243−XX document
244−
245−### `++mcol`
246−
247− ++ mcol
248− |= [a=(list ,@) b=[p=@ q=@ r=@ s=@]] ^- (list ,@)
249− =+ c=[p=_@ q=_@ r=_@ s=_@]
250− |- ^- (list ,@)
251− ?~ a ~
252− => .(p.c (cut 3 [0 1] i.a))
253− => .(q.c (cut 3 [1 1] i.a))
254− => .(r.c (cut 3 [2 1] i.a))
255− => .(s.c (cut 3 [3 1] i.a))
256− :_ $(a t.a)
257− %+ rep 3
258− %+ turn
259− %- limo
260− :~ [[p.c p.b] [q.c q.b] [r.c r.b] [s.c s.b]]
261− [[p.c s.b] [q.c p.b] [r.c q.b] [s.c r.b]]
262− [[p.c r.b] [q.c s.b] [r.c p.b] [s.c q.b]]
263− [[p.c q.b] [q.c r.b] [r.c s.b] [s.c p.b]]
264− ==
265− |= [a=[@ @] b=[@ @] c=[@ @] d=[@ @]]
266− :(dif (pro a) (pro b) (pro c) (pro d))
267− ::
268−
269−XX document
270−
271−### `++pode`
272−
273− ++ pode :: explode to block
274− |= [a=bloq b=@ c=@] ^- (list ,@)
275− =+ d=(rip a c)
276− =+ m=(met a c)
277− |-
278− ?: =(m b)
279− d
280− $(m +(m), d (weld d (limo [0 ~])))
281−
282−XX document
283−
284−### `++sube`
285−
286− ++ sube :: s-box word
287− |= [a=@ b=@] ^- @
288− (rep 3 (turn (pode 3 4 a) |=(c=@ (cut 3 [c 1] b))))
289− --
290− |%
291−
292−XX document
293−
294−### `++be`
295−
296− ++ be :: block cipher
297− |= [a=? b=@ c=@H] ^- @uxH
298− ~| %be-aesc
299− => %= .
300− +
301− => +
302− |%
303−
304−XX document
305−
306−### `++ankh`
307−
308− ++ ankh
309− |= [a=cipa b=@ c=@]
310− (pode 5 nnb (cut 5 [(mul (ix.a b) nnb) nnb] c))
311−
312−XX document
313−
314−### `++sark`
315−
316− ++ sark
317− |= [c=(list ,@) d=(list ,@)] ^- (list ,@)
318− ?~ c ~
319− ?~ d !!
320− [(mix i.c i.d) $(c t.c, d t.d)]
321−
322−XX document
323−
324−### `++srow`
325−
326− ++ srow
327− |= [a=cipa b=(list ,@)] ^- (list ,@)
328− =+ [c=0 d=~ e=ro.a]
329− |-
330− ?: =(c nnb)
331− d
332− :_ $(c +(c))
333− %+ rep 3
334− %+ turn
335− (limo [0 p.e] [1 q.e] [2 r.e] [3 s.e] ~)
336− |= [f=@ g=@]
337− (cut 3 [f 1] (snag (mod (add g c) nnb) b))
338−
339−XX document
340−
341−### `++subs`
342−
343− ++ subs
344− |= [a=cipa b=(list ,@)] ^- (list ,@)
345− ?~ b ~
346− [(sube i.b su.a) $(b t.b)]
347− --
348− ==
349− =+ [d=?:(a pen pin) e=(pode 5 nnb c) f=1]
350− => .(e (sark e (ankh d 0 b)))
351− |-
352− ?. =(nnr f)
353− => .(e (subs d e))
354− => .(e (srow d e))
355− => .(e (mcol e co.d))
356− => .(e (sark e (ankh d f b)))
357− $(f +(f))
358− => .(e (subs d e))
359− => .(e (srow d e))
360− => .(e (sark e (ankh d nnr b)))
361− (rep 5 e)
362−
363−XX document
364−
365−### `++ex`
366−
367− ++ ex :: key expand
368− |= a=@I ^- @
369− =+ [b=a c=0 d=su:pen i=nnk]
370− |-
371− ?: =(i (mul nnb +(nnr)))
372− b
373− => .(c (cut 5 [(dec i) 1] b))
374− => ?: =(0 (mod i nnk))
375− => .(c (ror 3 1 c))
376− => .(c (sube c d))
377− .(c (mix c (pow (dec (div i nnk)) 2)))
378− ?: &((gth nnk 6) =(4 (mod i nnk)))
379− .(c (sube c d))
380− .
381− => .(c (mix c (cut 5 [(sub i nnk) 1] b)))
382− => .(b (can 5 [i b] [1 c] ~))
383− $(i +(i))
384−
385−XX document
386−
387−### `++ix`
388−
389− ++ ix :: key expand, inv
390− |= a=@ ^- @
391− =+ [i=1 j=_@ b=_@ c=co:pin]
392− |-
393− ?: =(nnr i)
394− a
395− => .(b (cut 7 [i 1] a))
396− => .(b (rep 5 (mcol (pode 5 4 b) c)))
397− => .(j (sub nnr i))
398− %= $
399− i +(i)
400− a
401− %+ can 7
402− :~ [i (cut 7 [0 i] a)]
403− [1 b]
404− [j (cut 7 [+(i) j] a)]
405− ==
406− ==
407− --
408− ::
409−
410−XX document
411−
412−### `++curt`
413−
414− ++ curt :: curve25519
415− |= [a=@ b=@]
416− => %= .
417− +
418− => +
419− =+ =+ [p=486.662 q=(sub (bex 255) 19)]
420− =+ fq=~(. fo q)
421− [p=p q=q fq=fq]
422− |%
423−
424−XX document
425−
426−### `++cla`
427−
428− ++ cla
429− |= raw=@
430− =+ low=(dis 248 (cut 3 [0 1] raw))
431− =+ hih=(con 64 (dis 127 (cut 3 [31 1] raw)))
432− =+ mid=(cut 3 [1 30] raw)
433− (can 3 [[1 low] [30 mid] [1 hih] ~])
434−
435−XX document
436−
437−### `++sqr`
438−
439− ++ sqr |=(a=@ (mul a a))
440−
441−XX document
442−
443−### `++inv`
444−
445− ++ inv |=(a=@ (~(exp fo q) (sub q 2) a))
446−
447−XX document
448−
449−### `++cad`
450−
451− ++ cad
452− |= [n=[x=@ z=@] m=[x=@ z=@] d=[x=@ z=@]]
453− =+ ^= xx
454− ;: mul 4 z.d
455− %- sqr %- abs:si
456− %+ dif:si
457− (sun:si (mul x.m x.n))
458− (sun:si (mul z.m z.n))
459− ==
460− =+ ^= zz
461− ;: mul 4 x.d
462− %- sqr %- abs:si
463− %+ dif:si
464− (sun:si (mul x.m z.n))
465− (sun:si (mul z.m x.n))
466− ==
467− [(sit.fq xx) (sit.fq zz)]
468−
469−XX document
470−
471−### `++cub`
472−
473− ++ cub
474− |= [x=@ z=@]
475− =+ ^= xx
476− %+ mul
477− %- sqr %- abs:si
478− (dif:si (sun:si x) (sun:si z))
479− (sqr (add x z))
480− =+ ^= zz
481− ;: mul 4 x z
482− :(add (sqr x) :(mul p x z) (sqr z))
483− ==
484− [(sit.fq xx) (sit.fq zz)]
485− --
486− ==
487− =+ one=[b 1]
488− =+ i=253
489− =+ r=one
490− =+ s=(cub one)
491− |-
492− ?: =(i 0)
493− =+ x=(cub r)
494− (sit.fq (mul -.x (inv +.x)))
495− =+ m=(rsh 0 i a)
496− ?: =(0 (mod m 2))
497− $(i (dec i), s (cad r s one), r (cub r))
498− $(i (dec i), r (cad r s one), s (cub s))
499− ::
500−
501−XX document
502−
503−### `++ed`
504−
505− ++ ed :: ed25519
506− =>
507− =+ =+ [b=256 q=(sub (bex 255) 19)]
508− =+ fq=~(. fo q)
509− =+ ^= l
510− %+ add
511− (bex 252)
512− 27.742.317.777.372.353.535.851.937.790.883.648.493
513− =+ d=(dif.fq 0 (fra.fq 121.665 121.666))
514− =+ ii=(exp.fq (div (dec q) 4) 2)
515− [b=b q=q fq=fq l=l d=d ii=ii]
516− ~% %coed +> ~
517− |%
518−
519−### `++norm`
520−
521− ++ norm |=(x=@ ?:(=(0 (mod x 2)) x (sub q x)))
522− ::
523−
524−XX document
525−
526−### `++xrec`
527−
528− ++ xrec :: recover x-coord
529− |= y=@ ^- @
530− =+ ^= xx
531− %+ mul (dif.fq (mul y y) 1)
532− (inv.fq +(:(mul d y y)))
533− =+ x=(exp.fq (div (add 3 q) 8) xx)
534− ?: !=(0 (dif.fq (mul x x) (sit.fq xx)))
535− (norm (pro.fq x ii))
536− (norm x)
537− ::
538−
539−XX document
540−
541−### `++ward`
542−
543− ++ ward :: edwards multiply
544− |= [pp=[@ @] qq=[@ @]] ^- [@ @]
545− =+ dp=:(pro.fq d -.pp -.qq +.pp +.qq)
546− =+ ^= xt
547− %+ pro.fq
548− %+ sum.fq
549− (pro.fq -.pp +.qq)
550− (pro.fq -.qq +.pp)
551− (inv.fq (sum.fq 1 dp))
552− =+ ^= yt
553− %+ pro.fq
554− %+ sum.fq
555− (pro.fq +.pp +.qq)
556− (pro.fq -.pp -.qq)
557− (inv.fq (dif.fq 1 dp))
558− [xt yt]
559− ::
560−
561−XX document
562−
563−### `++scam`
564−
565− ++ scam :: scalar multiply
566− |= [pp=[@ @] e=@] ^- [@ @]
567− ?: =(0 e)
568− [0 1]
569− =+ qq=$(e (div e 2))
570− => .(qq (ward qq qq))
571− ?: =(1 (dis 1 e))
572− (ward qq pp)
573− qq
574− ::
575−
576−XX document
577−
578−### `++etch`
579−
580− ++ etch :: encode point
581− |= pp=[@ @] ^- @
582− (can 0 ~[[(sub b 1) +.pp] [1 (dis 1 -.pp)]])
583− ::
584−
585−XX document
586−
587−### `++curv`
588−
589− ++ curv :: point on curve?
590− |= [x=@ y=@] ^- ?
591− .= 0
592− %+ dif.fq
593− %+ sum.fq
594− (pro.fq (sub q (sit.fq x)) x)
595− (pro.fq y y)
596− (sum.fq 1 :(pro.fq d x x y y))
597− ::
598−
599−XX document
600−
601−### `++deco`
602−
603− ++ deco :: decode point
604− |= s=@ ^- (unit ,[@ @])
605− =+ y=(cut 0 [0 (dec b)] s)
606− =+ si=(cut 0 [(dec b) 1] s)
607− =+ x=(xrec y)
608− => .(x ?:(!=(si (dis 1 x)) (sub q x) x))
609− =+ pp=[x y]
610− ?. (curv pp)
611− ~
612− [~ pp]
613− ::
614−
615−XX document
616−
617−### `++bb`
618−
619− ++ bb
620− =+ bby=(pro.fq 4 (inv.fq 5))
621− [(xrec bby) bby]
622− ::
623− --
624− ~% %ed + ~
625− |%
626−
627−XX document
628−
629−### `++puck`
630−
631− ++ puck :: public key
632− ~/ %puck
633− |= sk=@I ^- @
634− ?: (gth (met 3 sk) 32) !!
635− =+ h=(shal (rsh 0 3 b) sk)
636− =+ ^= a
637− %+ add
638− (bex (sub b 2))
639− (lsh 0 3 (cut 0 [3 (sub b 5)] h))
640− =+ aa=(scam bb a)
641− (etch aa)
642−
643−XX document
644−
645−### `++suck`
646−
647− ++ suck :: keypair from seed
648− |= se=@I ^- @uJ
649− =+ pu=(puck se)
650− (can 0 ~[[b se] [b pu]])
651− ::
652−
653−XX document
654−
655−### `++sign`
656−
657− ++ sign :: certify
658− ~/ %sign
659− |= [m=@ se=@] ^- @
660− =+ sk=(suck se)
661− =+ pk=(cut 0 [b b] sk)
662− =+ h=(shal (rsh 0 3 b) sk)
663− =+ ^= a
664− %+ add
665− (bex (sub b 2))
666− (lsh 0 3 (cut 0 [3 (sub b 5)] h))
667− =+ ^= r
668− =+ hm=(cut 0 [b b] h)
669− =+ ^= i
670− %+ can 0
671− :~ [b hm]
672− [(met 0 m) m]
673− ==
674− (shaz i)
675− =+ rr=(scam bb r)
676− =+ ^= ss
677− =+ er=(etch rr)
678− =+ ^= ha
679− %+ can 0
680− :~ [b er]
681− [b pk]
682− [(met 0 m) m]
683− ==
684− (~(sit fo l) (add r (mul (shaz ha) a)))
685− (can 0 ~[[b (etch rr)] [b ss]])
686− ::
687−
688−XX document
689−
690−### `++veri`
691−
692− ++ veri :: validate
693− ~/ %veri
694− |= [s=@ m=@ pk=@] ^- ?
695− ?: (gth (div b 4) (met 3 s)) |
696− ?: (gth (div b 8) (met 3 pk)) |
697− =+ cb=(rsh 0 3 b)
698− =+ rr=(deco (cut 0 [0 b] s))
699− ?~ rr |
700− =+ aa=(deco pk)
701− ?~ aa |
702− =+ ss=(cut 0 [b b] s)
703− =+ ha=(can 3 ~[[cb (etch u.rr)] [cb pk] [(met 3 m) m]])
704− =+ h=(shaz ha)
705− =((scam bb ss) (ward u.rr (scam u.aa h)))
706− ::
707− --
708− ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
709−
710−XX document
711−
712−
docs/system/hoon/library/core/at.mddeleted−146
@@ -1,146 +0,0 @@
1−### `++at`
2−
3− ++ at
4− |_ a=@
5−
6−XX document
7−
8−### `++r`
9−
10− ++ r
11− ?: ?& (gte (met 3 a) 2)
12− |-
13− ?: =(0 a)
14− &
15− =+ vis=(end 3 1 a)
16− ?& ?|(=('-' vis) ?&((gte vis 'a') (lte vis 'z')))
17− $(a (rsh 3 1 a))
18− ==
19− ==
20− rtam
21− ?: (lte (met 3 a) 2)
22− rud
23− rux
24− ::
25−
26−XX document
27−
28−### `++rf`
29−
30− ++ rf `tape`[?-(a & '&', | '|', * !!) ~]
31−
32−XX document
33−
34−### `++rn`
35−
36− ++ rn `tape`[?>(=(0 a) '~') ~]
37−
38−XX document
39−
40−### `++rt`
41−
42− ++ rt `tape`['\'' (weld (mesc (trip a)) `tape`['\'' ~])]
43−
44−XX document
45−
46−### `++rta`
47−
48− ++ rta rt
49−
50−XX document
51−
52−### `++rtam`
53−
54− ++ rtam `tape`['%' (trip a)]
55−
56−XX document
57−
58−### `++rub`
59−
60− ++ rub `tape`['0' 'b' (rum 2 ~ |=(b=@ (add '0' b)))]
61−
62−XX document
63−
64−### `++rud`
65−
66− ++ rud (rum 10 ~ |=(b=@ (add '0' b)))
67−
68−XX document
69−
70−### `++rum`
71−
72− ++ rum
73− |= [b=@ c=tape d=$+(@ @)]
74− ^- tape
75− ?: =(0 a)
76− [(d 0) c]
77− =+ e=0
78− |- ^- tape
79− ?: =(0 a)
80− c
81− =+ f=&(!=(0 e) =(0 (mod e ?:(=(10 b) 3 4))))
82− %= $
83− a (div a b)
84− c [(d (mod a b)) ?:(f [?:(=(10 b) ',' '-') c] c)]
85− e +(e)
86− ==
87− ::
88−
89−XX document
90−
91−### `++rup`
92−
93− ++ rup
94− =+ b=(met 3 a)
95− ^- tape
96− :- '-'
97− |- ^- tape
98− ?: (gth (met 5 a) 1)
99− %+ weld
100− $(a (rsh 5 1 a), b (sub b 4))
101− `tape`['-' '-' $(a (end 5 1 a), b 4)]
102− ?: =(0 b)
103− ['~' ~]
104− ?: (lte b 1)
105− (trip (tos:po a))
106− |- ^- tape
107− ?: =(2 b)
108− =+ c=(rsh 3 1 a)
109− =+ d=(end 3 1 a)
110− (weld (trip (tod:po c)) (trip (tos:po (mix c d))))
111− =+ c=(rsh 3 2 a)
112− =+ d=(end 3 2 a)
113− (weld ^$(a c, b (met 3 c)) `tape`['-' $(a (mix c d), b 2)])
114− ::
115−
116−XX document
117−
118−### `++ruv`
119−
120− ++ ruv
121− ^- tape
122− :+ '0'
123− 'v'
124− %^ rum
125− 64
126− ~
127− |= b=@
128− ?: =(63 b)
129− '+'
130− ?: =(62 b)
131− '-'
132− ?:((lth b 26) (add 65 b) ?:((lth b 52) (add 71 b) (sub b 4)))
133− ::
134−
135−XX document
136−
137−### `++rux`
138−
139− ++ rux `tape`['0' 'x' (rum 16 ~ |=(b=@ (add b ?:((lth b 10) 48 87))))]
140− --
141− :::::::::::::::::::::::::::::::::::::::::::::::::::::: ::
142−
143−XX document
144−
145−------------------------------------------------------------------------
146−
docs/system/hoon/library/core/co.mddeleted−335
@@ -1,335 +0,0 @@
1−### `++co`
2−
3−Literal rendering engine
4−
5−A [door]() that contains arms that operate on the sample coin `lot`.
6−
7−Accepts
8−-------
9−
10−Produces
11−--------
12−
13−`lot` is a [`++coin`]().
14−
15−Source
16−------
17−
18− ++ co
19− =< |_ lot=coin
20−
21−Examples
22−--------
23−
24− ~zod/try=> ~(. co many/~[`ta/'mo' `ud/5])
25− < 3.dhd
26− [ [ %many
27− [%~ %ta @t]
28− [%~ %ud @ud]
29− %~
30− ]
31− <10.utz 3.zid [rex="" <414.hmb 100.xkc 1.ypj %164>]>
32− ]
33− >
34−
35−------------------------------------------------------------------------
36−
37−### `++rear`
38−
39−Prepend & render as tape
40−
41−Renders a coin `lot` as a [tape]() prepended to the sample tape `rom`.
42−
43−Accepts
44−-------
45−
46−Produces
47−--------
48−
49−`rom` is a [`pe`]()
50−
51−`lot` is a [`++coin`]().
52−
53−Source
54−------
55−
56− ++ rear |=(rom=tape =>(.(rex rom) rend))
57−
58−Examples
59−--------
60−
61− ~zod/try=> (~(rear co %$ %ux 200) "--ha")
62− "0xc8--ha"
63−
64−------------------------------------------------------------------------
65−
66−### `++rent`
67−
68−Render as span
69−
70−Renders a coin `lot` as a span.
71−
72−Accepts
73−-------
74−
75−Produces
76−--------
77−
78−`lot` is a [`++coin`]().
79−
80−Source
81−------
82−
83− ++ rent `@ta`(rap 3 rend)
84−
85−Examples
86−--------
87−
88− ~zod/try=> ~(rent co %$ %ux 200)
89− ~.0xc8
90− ~zod/try=> `@t`~(rent co %$ %ux 200)
91− '0xc8'
92−
93−------------------------------------------------------------------------
94−
95−### `++rend`
96−
97−Render as tape
98−
99−Renders a coin `lot` as a tape.
100−
101−Accepts
102−-------
103−
104−Produces
105−--------
106−
107−`lot` is a [`++coin`]().
108−
109−Source
110−------
111−
112− ++ rend
113− ^- tape
114− ?: ?=(%blob -.lot)
115− ['~' '0' ((v-co 1) (jam p.lot))]
116− ?: ?=(%many -.lot)
117− :- '.'
118− |- ^- tape
119− ?~ p.lot
120− ['_' '_' rex]
121− ['_' (weld (trip (wack rent(lot i.p.lot))) $(p.lot t.p.lot))]
122− =+ [yed=(end 3 1 p.p.lot) hay=(cut 3 [1 1] p.p.lot)]
123− |- ^- tape
124− ?+ yed (z-co q.p.lot)
125− %c ['~' '-' (weld (rip 3 (wood (tuft q.p.lot))) rex)]
126− %d
127− ?+ hay (z-co q.p.lot)
128− %a
129− =+ yod=(yore q.p.lot)
130− => ^+(. .(rex ?~(f.t.yod rex ['.' (s-co f.t.yod)])))
131− => ^+ .
132− %= .
133− rex
134− ?: &(=(~ f.t.yod) =(0 h.t.yod) =(0 m.t.yod) =(0 s.t.yod))
135− rex
136− => .(rex ['.' (y-co s.t.yod)])
137− => .(rex ['.' (y-co m.t.yod)])
138− ['.' '.' (y-co h.t.yod)]
139− ==
140− => .(rex ['.' (a-co d.t.yod)])
141− => .(rex ['.' (a-co m.yod)])
142− => .(rex ?:(a.yod rex ['-' rex]))
143− ['~' (a-co y.yod)]
144− ::
145− %r
146− =+ yug=(yell q.p.lot)
147− => ^+(. .(rex ?~(f.yug rex ['.' (s-co f.yug)])))
148− :- '~'
149− ?: &(=(0 d.yug) =(0 m.yug) =(0 h.yug) =(0 s.yug))
150− ['.' 's' '0' rex]
151− => ^+(. ?:(=(0 s.yug) . .(rex ['.' 's' (a-co s.yug)])))
152− => ^+(. ?:(=(0 m.yug) . .(rex ['.' 'm' (a-co m.yug)])))
153− => ^+(. ?:(=(0 h.yug) . .(rex ['.' 'h' (a-co h.yug)])))
154− => ^+(. ?:(=(0 d.yug) . .(rex ['.' 'd' (a-co d.yug)])))
155− +.rex
156− ==
157− ::
158− %f
159− ?: =(& q.p.lot)
160− ['.' 'y' rex]
161− ?:(=(| q.p.lot) ['.' 'n' rex] (z-co q.p.lot))
162− ::
163− %n ['~' rex]
164− %i
165− ?+ hay (z-co q.p.lot)
166− %f ((ro-co [3 10 4] |=(a=@ ~(d ne a))) q.p.lot)
167− %s ((ro-co [4 16 8] |=(a=@ ~(x ne a))) q.p.lot)
168− ==
169− ::
170− %p
171− =+ dyx=(met 3 q.p.lot)
172− :- '~'
173− ?: (lte dyx 1)
174− (weld (trip (tod:po q.p.lot)) rex)
175− ?: =(2 dyx)
176− ;: weld
177− (trip (tos:po (end 3 1 q.p.lot)))
178− (trip (tod:po (rsh 3 1 q.p.lot)))
179− rex
180− ==
181− =+ [dyz=(met 5 q.p.lot) fin=|]
182− |- ^- tape
183− ?: =(0 dyz)
184− rex
185− %= $
186− fin &
187− dyz (dec dyz)
188− q.p.lot (rsh 5 1 q.p.lot)
189− rex
190− =+ syb=(wren:un (end 5 1 q.p.lot))
191− =+ cog=~(zig mu [(rsh 4 1 syb) (end 4 1 syb)])
192− ;: weld
193− (trip (tos:po (end 3 1 p.cog)))
194− (trip (tod:po (rsh 3 1 p.cog)))
195− `tape`['-' ~]
196− (trip (tos:po (end 3 1 q.cog)))
197− (trip (tod:po (rsh 3 1 q.cog)))
198− `tape`?:(fin ['-' ?:(=(1 (end 0 1 dyz)) ~ ['-' ~])] ~)
199− rex
200− ==
201− ==
202− ::
203− %r
204− ?+ hay (z-co q.p.lot)
205− %d
206− =+ r=(rlyd q.p.lot)
207− ?~ e.r
208− ['.' '~' (r-co r)]
209− ['.' '~' u.e.r]
210− %h ['.' '~' '~' (r-co (rlyh q.p.lot))]
211− %q ['.' '~' '~' '~' (r-co (rlyq q.p.lot))]
212− %s ['.' (r-co (rlys q.p.lot))]
213− ==
214− ::
215− %u
216− =- (weld p.gam ?:(=(0 q.p.lot) `tape`['0' ~] q.gam))
217− ^= gam ^- [p=tape q=tape]
218− ?+ hay [~ ((ox-co [10 3] |=(a=@ ~(d ne a))) q.p.lot)]
219− %b [['0' 'b' ~] ((ox-co [2 4] |=(a=@ ~(d ne a))) q.p.lot)]
220− %i [['0' 'i' ~] ((d-co 1) q.p.lot)]
221− %x [['0' 'x' ~] ((ox-co [16 4] |=(a=@ ~(x ne a))) q.p.lot)]
222− %v [['0' 'v' ~] ((ox-co [32 5] |=(a=@ ~(x ne a))) q.p.lot)]
223− %w [['0' 'w' ~] ((ox-co [64 5] |=(a=@ ~(w ne a))) q.p.lot)]
224− ==
225− ::
226− %s
227− %+ weld
228− ?:((syn:si q.p.lot) "--" "-")
229− $(yed 'u', q.p.lot (abs:si q.p.lot))
230− ::
231− %t
232− ?: =('a' hay)
233− ?: =('s' (cut 3 [2 1] p.p.lot))
234−
235− (weld (rip 3 q.p.lot) rex)
236− ['~' '.' (weld (rip 3 q.p.lot) rex)]
237− ['~' '~' (weld (rip 3 (wood q.p.lot)) rex)]
238− ==
239− --
240− =+ rex=*tape
241− =< |%
242− ++ a-co |=(dat=@ ((d-co 1) dat))
243− ++ d-co |=(min=@ (em-co [10 min] |=([? b=@ c=tape] [~(d ne b) c])))
244− ++ r-co
245− |= [syn=? nub=@ der=@ ign=(unit tape) ne=?]
246− => .(rex ['.' (t-co ((d-co 1) der) ne)])
247− => .(rex ((d-co 1) nub))
248− ?:(syn rex ['-' rex])
249− ++ t-co |= [a=tape n=?] ^- tape
250− ?: n a
251− ?~ a ~|(%empty-frac !!) t.a
252− ::
253− ++ s-co
254− |= esc=(list ,@) ^- tape
255− ~| [%so-co esc]
256− ?~ esc
257− rex
258− :- '.'
259− =>(.(rex $(esc t.esc)) ((x-co 4) i.esc))
260−
261− ::
262− ++ v-co |=(min=@ (em-co [32 min] |=([? b=@ c=tape] [~(v ne b) c])))
263− ++ w-co |=(min=@ (em-co [64 min] |=([? b=@ c=tape] [~(w ne b) c])))
264− ++ x-co |=(min=@ (em-co [16 min] |=([? b=@ c=tape] [~(x ne b) c])))
265− ++ y-co |=(dat=@ ((d-co 2) dat))
266− ++ z-co |=(dat=@ `tape`['0' 'x' ((x-co 1) dat)])
267− --
268− ~% %co +> ~
269− |%
270− ++ em-co
271− ~/ %emco
272− |= [[bas=@ min=@] [par=$+([? @ tape] tape)]]
273− |= hol=@
274− ^- tape
275− ?: &(=(0 hol) =(0 min))
276− rex
277− =+ [rad=(mod hol bas) dar=(div hol bas)]
278− %= $
279− min ?:(=(0 min) 0 (dec min))
280− hol dar
281− rex (par =(0 dar) rad rex)
282− ==
283− ::
284− ++ ox-co
285− ~/ %oxco
286− |= [[bas=@ gop=@] dug=$+(@ @)]
287− %+ em-co
288− [|-(?:(=(0 gop) 1 (mul bas $(gop (dec gop))))) 0]
289− |= [top=? seg=@ res=tape]
290− %+ weld
291− ?:(top ~ `tape`['.' ~])
292− %. seg
293− %+ em-co(rex res)
294− [bas ?:(top 0 gop)]
295− |=([? b=@ c=tape] [(dug b) c])
296− ::
297− ++ ro-co
298− ~/ %roco
299− |= [[buz=@ bas=@ dop=@] dug=$+(@ @)]
300− |= hol=@
301− ^- tape
302− ?: =(0 dop)
303− rex
304− => .(rex $(dop (dec dop)))
305− :- '.'
306− %- (em-co [bas 1] |=([? b=@ c=tape] [(dug b) c]))
307− [(cut buz [(dec dop) 1] hol)]
308− --
309− ::
310−
311−Examples
312−--------
313−
314− ~zod/try=> ~(rend co ~ %ux 200)
315− "0xc8"
316− ~zod/try=> ~(rend co %many ~[[%$ ux/200] [%$ p/40]])
317− "._0xc8_~~tem__"
318− ~zod/try=> ~(rend co ~ %p 32.819)
319− "~pillyt"
320− ~zod/try=> ~(rend co ~ %ux 18)
321− "0x12"
322− ~zod/try=> ~(rend co [~ p=[p=%if q=0x7f00.0001]])
323− ".127.0.0.1"
324− ~zod/try=> `@ux`.127.0.0.1
325− 2.130.706.433
326− ~zod/try=> ~(rend co %many ~[[~ %ud 20] [~ %uw 133] [~ %tas 'sam']])
327− "._20_0w25_sam__"
328− ~zod/try=> ~(rend co %blob [1 1])
329− "~0ph"
330− ~zod/try=> ~0ph
331− [1 1]
332− ~zod/try=> `@uv`(jam [1 1])
333− 0vph
334−
335−
docs/system/hoon/library/core/crua.mddeleted−598
@@ -1,598 +0,0 @@
1−### `++crua`
2−
3− ++ crua !: :: cryptosuite A (RSA)
4− ^- acru
5− =| [mos=@ pon=(unit ,[p=@ q=@ r=[p=@ q=@] s=_*fu])]
6− => |%
7−
8−XX document
9−
10−### `++mx`
11−
12− ++ mx (dec (met 0 mos)) :: bit length
13−
14−XX document
15−
16−### `++dap`
17−
18− ++ dap :: OEAP decode
19− |= [wid=@ xar=@ dog=@] ^- [p=@ q=@]
20− =+ pav=(sub wid xar)
21− =+ qoy=(cut 0 [xar pav] dog)
22− =+ dez=(mix (end 0 xar dog) (shaw %pad-b xar qoy))
23− [dez (mix qoy (shaw %pad-a pav dez))]
24− ::
25−
26−XX document
27−
28−### `++pad`
29−
30− ++ pad :: OEAP encode
31− |= [wid=@ rax=[p=@ q=@] meg=@] ^- @
32− =+ pav=(sub wid p.rax)
33− ?> (gte pav (met 0 meg))
34− ^- @
35− =+ qoy=(mix meg (shaw %pad-a pav q.rax))
36− =+ dez=(mix q.rax (shaw %pad-b p.rax qoy))
37− (can 0 [p.rax dez] [pav qoy] ~)
38− |%
39−
40−XX document
41−
42−### `++pull`
43−
44− ++ pull |=(a=@ (~(exp fo mos) 3 a))
45−
46−XX document
47−
48−### `++push`
49−
50− ++ push |=(a=@ (~(exp fo mos) 5 a))
51−
52−XX document
53−
54−### `++pump`
55−
56− ++ pump
57− |= a=@ ^- @
58− ?~ pon !!
59− (out.s.u.pon (exp.s.u.pon p.r.u.pon (sit.s.u.pon a)))
60− ::
61−
62−XX document
63−
64−### `++punt`
65−
66− ++ punt
67− |= a=@ ^- @
68− ?~ pon !!
69− (out.s.u.pon (exp.s.u.pon q.r.u.pon (sit.s.u.pon a)))
70− |%
71−
72−XX document
73−
74−### `++as`
75−
76− ++ as
77− => |%
78−
79−XX document
80−
81−### `++haul`
82−
83− ++ haul :: revealing haul
84− |= a=pass
85− !!
86− ^?
87− |% ++ seal
88− |= [a=pass b=@ c=@]
89− ^- @
90− !!
91−
92−XX document
93−
94−### `++seal`
95−
96−
97− XX document
98−
99− ###++sign
100−
101− ```
102− ++ sign
103− |= [a=@ b=@] ^- @
104− !!
105− ```
106−
107− XX document
108−
109− ###++sure
110−
111− ```
112− ++ sure
113− |= [a=@ b=@]
114− ^- (unit ,@)
115− !!
116− ```
117−
118− XX document
119−
120− ###++tear
121−
122− ```
123− ++ tear
124− |= [a=pass b=@]
125− ^- (unit ,[p=@ q=@])
126− !!
127− ::
128− ```
129−
130− XX document
131−
132− ###++de
133−
134− ```
135− ++ de
136− |+ [key=@ cep=@] ^- (unit ,@)
137− !!
138− ::
139− ```
140−
141− XX document
142−
143− ###++dy
144−
145− ```
146− ++ dy
147− |+ [a=@ b=@] ^- @
148− !!
149− ```
150−
151− XX document
152−
153− ###++en
154−
155− ```
156− ++ en
157− |+ [key=@ msg=@] ^- @ux
158− !!
159− ::
160− ```
161−
162− XX document
163−
164− ###++ex
165−
166− ```
167− ++ ex ^?
168− |% ++ fig ^- @uvH (shaf %bfig puc)
169− ```
170−
171− XX document
172−
173− ###++fig
174−
175−XX document
176−
177−### `++pac`
178−
179− ++ pac ^- @uvG (end 6 1 (shaf %acod sec))
180−
181−XX document
182−
183−### `++pub`
184−
185− ++ pub ^- pass (cat 3 'b' puc)
186−
187−XX document
188−
189−### `++sec`
190−
191− ++ sec ^- ring sed
192− ::
193−
194−XX document
195−
196−### `++nu`
197−
198− ++ nu
199− ^?
200− |% ++ com
201− |= a=@
202− ^+ ^?(..nu)
203− ..nu(sed ~, puc a)
204− ::
205−
206−XX document
207−
208−### `++elcm`
209−
210− ++ elcm
211− |= [a=@ b=@]
212− (div (mul a b) d:(egcd a b))
213− ::
214−
215−XX document
216−
217−### `++eldm`
218−
219− ++ eldm
220− |= [a=@ b=@ c=@]
221− (~(inv fo (elcm (dec b) (dec c))) a)
222− ::
223−
224−XX document
225−
226−### `++ersa`
227−
228− ++ ersa
229− |= [a=@ b=@]
230− [a b [(eldm 3 a b) (eldm 5 a b)] (fu a b)]
231− ^?
232− |% ++ com
233− |= a=@
234− ^+ ^?(..nu)
235− ..nu(mos a, pon ~)
236− ::
237−
238−XX document
239−
240−### `++com`
241−
242−
243− XX document
244−
245− ###++pit
246−
247− ```
248− ++ pit
249− |= [a=@ b=@]
250− ^+ ^?(..nu)
251− ..nu(sed b, puc (puck:ed b))
252− ::
253− ```
254−
255− XX document
256−
257− ###++nol
258−
259− ```
260− ++ nol
261− |= a=@
262− ^+ ^?(..nu)
263− ..nu(sed a, puc (puck:ed a))
264− ```
265−
266− XX document
267−
268− ###++bruw
269−
270− ```
271− ++ bruw :: create keypair
272− |= [a=@ b=@] :: width seed
273− ^- acru
274− (pit:nu:crua a b)
275− ::
276− ```
277−
278− XX document
279−
280− ###++haul
281−
282− ```
283− ++ haul :: revealing haul
284− |= a=pass
285− !!
286− ^?
287− |% ++ seal
288− |= [a=pass b=@ c=@]
289− ^- @
290− !!
291− ```
292−
293− XX document
294−
295− ###++weur
296−
297− ```
298− ++ weur :: activate secret key
299− |= a=ring
300− ^- acru
301− =+ [mag=(end 3 1 a) bod=(rsh 3 1 a)]
302− ?> =('A' mag)
303− (nol:nu:crua bod)
304− ::
305− ```
306−
307− XX document
308−
309− ###++trua
310−
311− ```
312− ++ trua :: test rsa
313− |= msg=@tas
314− ^- @
315− =+ ali=(bruw 1.024 (shax 'ali'))
316− =+ bob=(bruw 1.024 (shax 'bob'))
317− =+ tef=(sign:as.ali [0 msg])
318− =+ lov=(sure:as.ali [0 tef])
319− ?. &(?=(^ lov) =(msg u.lov))
320− ~|(%test-fail-sign !!)
321− =+ key=(shax (shax (shax msg)))
322− =+ sax=(seal:as.ali pub:ex.bob key msg)
323− =+ tin=(tear:as.bob pub:ex.ali sax)
324− ?. &(?=(^ tin) =(key p.u.tin) =(msg q.u.tin))
325− ~|(%test-fail-seal !!)
326− msg
327− ::
328− ```
329−
330− XX document
331−
332− ###++crub
333−
334− ```
335− ++ crub :: cryptosuite B (Ed)
336− ^- acru
337− =| [puc=pass sed=ring]
338− => |%
339− ```
340−
341− XX document
342−
343− ###++dap
344−
345− ```
346− ++ dap :: OEAP decode
347− |= [wid=@ xar=@ dog=@] ^- [p=@ q=@]
348− =+ pav=(sub wid xar)
349− =+ qoy=(cut 0 [xar pav] dog)
350− =+ dez=(mix (end 0 xar dog) (shaw %pad-b xar qoy))
351− [dez (mix qoy (shaw %pad-a pav dez))]
352− ::
353− ```
354−
355− XX document
356−
357− ###++pad
358−
359− ```
360− ++ pad :: OEAP encode
361− |= [wid=@ rax=[p=@ q=@] meg=@] ^- @
362− =+ pav=(sub wid p.rax)
363− ?> (gte pav (met 0 meg))
364− ^- @
365− =+ qoy=(mix meg (shaw %pad-a pav q.rax))
366− =+ dez=(mix q.rax (shaw %pad-b p.rax qoy))
367− (can 0 [p.rax dez] [pav qoy] ~)
368− |%
369− ```
370−
371− XX document
372−
373− ###++as
374−
375− ```
376− ++ as
377− => |%
378− ```
379−
380− XX document
381−
382− ###++haul
383−
384− ```
385− ++ haul :: revealing haul
386− |= a=pass
387− !!
388− ^?
389− |% ++ seal
390− |= [a=pass b=@ c=@]
391− ^- @
392− !!
393− ```
394−
395− XX document
396−
397− ###++seal
398−
399−XX document
400−
401−### `++sign`
402−
403− ++ sign
404− |= [a=@ b=@] ^- @
405− !!
406−
407−XX document
408−
409−### `++sure`
410−
411− ++ sure
412− |= [a=@ b=@]
413− ^- (unit ,@)
414− !!
415−
416−XX document
417−
418−### `++tear`
419−
420− ++ tear
421− |= [a=pass b=@]
422− ^- (unit ,[p=@ q=@])
423− !!
424− ::
425−
426−XX document
427−
428−### `++de`
429−
430− ++ de
431− |+ [key=@ cep=@] ^- (unit ,@)
432− !!
433− ::
434−
435−XX document
436−
437−### `++dy`
438−
439− ++ dy
440− |+ [a=@ b=@] ^- @
441− !!
442−
443−XX document
444−
445−### `++en`
446−
447− ++ en
448− |+ [key=@ msg=@] ^- @ux
449− !!
450− ::
451−
452−XX document
453−
454−### `++ex`
455−
456− ++ ex ^?
457− |% ++ fig ^- @uvH (shaf %bfig puc)
458−
459−XX document
460−
461−### `++fig`
462−
463−
464− XX document
465−
466− ###++pac
467−
468− ```
469− ++ pac ^- @uvG (end 6 1 (shaf %acod sec))
470− ```
471−
472− XX document
473−
474− ###++pub
475−
476− ```
477− ++ pub ^- pass (cat 3 'b' puc)
478− ```
479−
480− XX document
481−
482− ###++sec
483−
484− ```
485− ++ sec ^- ring sed
486− ::
487− ```
488−
489− XX document
490−
491− ###++nu
492−
493− ```
494− ++ nu
495− ^?
496− |% ++ com
497− |= a=@
498− ^+ ^?(..nu)
499− ..nu(sed ~, puc a)
500− ::
501− ```
502−
503− XX document
504−
505− ###++com
506−
507−XX document
508−
509−### `++pit`
510−
511− ++ pit
512− |= [a=@ b=@]
513− ^+ ^?(..nu)
514− ..nu(sed b, puc (puck:ed b))
515− ::
516−
517−XX document
518−
519−### `++nol`
520−
521− ++ nol
522− |= a=@
523− ^+ ^?(..nu)
524− ..nu(sed a, puc (puck:ed a))
525−
526−XX document
527−
528−### `++brew`
529−
530− ++ brew :: create keypair
531− |= [a=@ b=@] :: width seed
532− ^- acru
533− (pit:nu:crub a b)
534− ::
535−
536−XX document
537−
538−### `++hail`
539−
540− ++ hail :: activate public key
541− |= a=pass
542− ^- acru
543− =+ [mag=(end 3 1 a) bod=(rsh 3 1 a)]
544− ?> =('b' mag)
545− (com:nu:crub bod)
546− ::
547−
548−XX document
549−
550−### `++wear`
551−
552− ++ wear :: activate secret key
553− |= a=ring
554− ^- acru
555− =+ [mag=(end 3 1 a) bod=(rsh 3 1 a)]
556− ?> =('b' mag)
557− (nol:nu:crub bod)
558− ::
559−
560−XX document
561−
562−### `++trub`
563−
564− ++ trub :: test ed
565− |= msg=@tas
566− ^- @
567− =+ ali=(brew 1.024 (shax 'ali'))
568− =+ bob=(brew 1.024 (shax 'bob'))
569− =+ tef=(sign:as.ali [0 msg])
570− =+ lov=(sure:as.ali [0 tef])
571− ?. &(?=(^ lov) =(msg u.lov))
572− ~|(%test-fail-sign !!)
573− =+ key=(shax (shax (shax msg)))
574− =+ sax=(seal:as.ali pub:ex.bob key msg)
575− =+ tin=(tear:as.bob pub:ex.ali sax)
576− ?. &(?=(^ tin) =(key p.u.tin) =(msg q.u.tin))
577− ~|(%test-fail-seal !!)
578− msg
579− ::
580−
581−XX document
582−
583−### `++hmac`
584−
585− ++ hmac :: HMAC-SHA1
586− |= [key=@ mes=@]
587− =+ ip=(fil 3 64 0x36)
588− =+ op=(fil 3 64 0x5c)
589− =+ ^= kex
590− ?: (gth (met 3 key) 64)
591− (lsh 3 44 (shan (swap 3 key)))
592− (lsh 3 (sub 64 (met 3 key)) (swap 3 key))
593− =+ inn=(shan (swap 3 (cat 3 (swap 3 mes) (mix ip kex))))
594− (shan (swap 3 (cat 3 inn (mix op kex))))
595− ::
596−
597−XX document
598−
docs/system/hoon/library/core/epur.mddeleted−885
@@ -1,885 +0,0 @@
1−### `++epur`
2−
3−Top-level URL parser
4−
5−Parses an entire URL.
6−
7−Accepts
8−-------
9−
10−`a` is a [`++cord`](/doc/hoon/library/1#++cord).
11−
12−Produces
13−--------
14−
15−A [`++purl`]().
16−
17−Source
18−------
19−
20− ++ epur :: url/header parser
21− =< |=(a=cord (rush a auri))
22− |%
23−
24−Examples
25−--------
26−
27− ~zod/main=> (epur 'http://127.0.0.1/')
28− [~ [p=[p=%.n q=~ r=[%.n p=.127.0.0.1]] q=[p=~ q=<||>] r=~]]
29− ~zod/main=> (epur 'http://www.google.com/')
30− [~ [p=[p=%.n q=~ r=[%.y p=<|com google www|>]] q=[p=~ q=<||>] r=~]]
31− ~zod/main=> (epur 'https://www.google.com/')
32− [~ [p=[p=%.y q=~ r=[%.y p=<|com google www|>]] q=[p=~ q=<||>] r=~]]
33− ~zod/main=> (epur 'https//www.google.com/')
34− ~
35− ~zod/main=> (epur 'https://www.google.com:200/')
36− [~ [p=[p=%.y q=[~ 200] r=[%.y p=<|com google www|>]] q=[p=~ q=<||>] r=~]]
37− ~zod/main=> (epur 'https://www.google.com:200/search')
38− [ ~
39− [p=[p=%.y q=[~ 200] r=[%.y p=<|com google www|>]] q=[p=~ q=<|search|>] r=~]
40− ]
41− ~zod/main=> (epur 'https://www.google.com/search')
42− [~ [p=[p=%.y q=~ r=[%.y p=<|com google www|>]] q=[p=~ q=<|search|>] r=~]]
43− ~zod/main=> (epur 'https://www.google.com/search?q=urbit')
44− [ ~
45− [ p=[p=%.y q=~ r=[%.y p=<|com google www|>]]
46− q=[p=~ q=<|search|>]
47− r=~[[p='q' q='urbit']]
48− ]
49− ]
50− ~zod/main=> (epur 'https://www.google.com/search?q=urb it')
51− ~
52− ~zod/main=> (epur 'https://www.google.com/search?q=urb%20it')
53− [ ~
54− [ p=[p=%.y q=~ r=[%.y p=<|com google www|>]]
55− q=[p=~ q=<|search|>]
56− r=~[[p='q' q='urb it']]
57− ]
58− ]
59− ~zod/main=> (epur 'https://www.google.com/search?q=urbit%20escaping%3F')
60− [ ~
61− [ p=[p=%.y q=~ r=[%.y p=<|com google www|>]]
62− q=[p=~ q=<|search|>]
63− r=~[[p='q' q='urbit escaping?']]
64− ]
65− ]
66−
67−### `++apat`
68−
69−URL path as ++pork
70−
71−Parses a URL path as a [`++pork`]().
72−
73−Produces
74−--------
75−
76−A [`++rule`]().
77−
78−Source
79−------
80−
81− ++ apat :: 2396 abs_path
82− %+ cook deft
83− (ifix [fas ;~(pose fas (easy ~))] (more fas smeg))
84−
85−Examples
86−--------
87−
88− ~zod/try=> (scan "/foo/mol/lok" apat:epur)
89− [p=~ q=<|foo mol lok|>]
90− ~zod/try=> (scan "/foo/mol/lok.htm" apat:epur)
91− [p=[~ ~.htm] q=<|foo mol lok|>]
92−
93−### `++auri`
94−
95−URL parsing rule
96−
97−Accepts
98−-------
99−
100−A [`++purl`]().
101−
102−Produces
103−--------
104−
105−XX
106−
107−Source
108−------
109−
110− ++ auri
111− %+ cook
112− |= a=purl
113− ?.(=([& /localhost] r.p.a) a a(p.p &))
114− ;~ plug
115− ;~ plug
116− %+ sear
117− |= a=@t
118− ^- (unit ,?)
119− ?+(a ~ %http [~ %|], %https [~ %&])
120− ;~(sfix scem ;~(plug col fas fas))
121− thor
122− ==
123− ;~(plug ;~(pose apat (easy *pork)) yque)
124− ==
125−
126−Examples
127−--------
128−
129− ~zod/main=> (auri:epur [1 1] "http://127.0.0.1/")
130− [ p=[p=1 q=18]
131− q
132− [ ~
133− u
134− [ p=[p=[p=%.n q=~ r=[%.n p=.127.0.0.1]] q=[p=~ q=<||>] r=~]
135− q=[p=[p=1 q=18] q=""]
136− ]
137− ]
138− ]
139− ~zod/main=> (auri:epur [1 1] "http://www.google.com/")
140− [ p=[p=1 q=23]
141− q
142− [ ~
143− u
144− [ p=[p=[p=%.n q=~ r=[%.y p=<|com google www|>]] q=[p=~ q=<||>] r=~]
145− q=[p=[p=1 q=23] q=""]
146− ]
147− ]
148− ]
149− ~zod/main=> (auri:epur [1 1] "https://www.google.com/")
150− [ p=[p=1 q=24]
151− q
152− [ ~
153− u
154− [ p=[p=[p=%.y q=~ r=[%.y p=<|com google www|>]] q=[p=~ q=<||>] r=~]
155− q=[p=[p=1 q=24] q=""]
156− ]
157− ]
158− ]
159− ~zod/main=> (auri:epur [1 1] "https//www.google.com/")
160− [ p=[p=1 q=6] q=~]
161− ~zod/main=> (auri:epur [1 1] "https://www.google.com:200/")
162− [ p=[p=1 q=28]
163− q=[~ u=[p=[p=[p=%.y q=[~ 200] r=[%.y p=<|com google www|>]] q=[p=~ q=<||>] r=~] q=[p=[p=1 q=28] q=""]]]
164− ]
165− ~zod/main=> (auri:epur [1 1] "https://www.google.com:200/search")
166− [ p=[p=1 q=34]
167− q=[~ u=[p=[p=[p=%.y q=[~ 200] r=[%.y p=<|com google www|>]] q=[p=~ q=<|search|>] r=~] q=[p=[p=1 q=34] q=""]]]
168− ]
169− ~zod/main=> (auri:epur [1 1] "https://www.google.com/search")
170− [ p=[p=1 q=30]
171− q=[~ u=[p=[p=[p=%.y q=~ r=[%.y p=<|com google www|>]] q=[p=~ q=<|search|>] r=~] q=[p=[p=1 q=30] q=""]]]
172− ]
173− ~zod/main=> (auri:epur [1 1] "https://www.google.com/search?q=urbit")
174− [ p=[p=1 q=38]
175− q
176− [ ~
177− u
178− [ p=[p=[p=%.y q=~ r=[%.y p=<|com google www|>]] q=[p=~ q=<|search|>] r=~[[p='q' q='urbit']]]
179− q=[p=[p=1 q=38] q=""]
180− ]
181− ]
182− ]
183− ~zod/main=> (auri:epur [1 1] "https://www.google.com/search?q=urb it")
184− [ p=[p=1 q=36]
185− q
186− [ ~
187− u
188− [ p=[p=[p=%.y q=~ r=[%.y p=<|com google www|>]] q=[p=~ q=<|search|>] r=~[[p='q' q='urb']]]
189− q=[p=[p=1 q=36] q=" it"]
190− ]
191− ]
192− ]
193− ~zod/main=> (auri:epur [1 1] "https://www.google.com/search?q=urb%20it")
194− [ p=[p=1 q=41]
195− q
196− [ ~
197− u
198− [ p=[p=[p=%.y q=~ r=[%.y p=<|com google www|>]] q=[p=~ q=<|search|>] r=~[[p='q' q='urb it']]]
199− q=[p=[p=1 q=41] q=""]
200− ]
201− ]
202− ]
203− ~zod/main=> (auri:epur [1 1] "https://www.google.com/search?q=urbit%20escaping%3F")
204− [ p=[p=1 q=52]
205− q
206− [ ~
207− u
208− [ p=[p=[p=%.y q=~ r=[%.y p=<|com google www|>]] q=[p=~ q=<|search|>] r=~[[p='q' q='urbit escaping?']]]
209− q=[p=[p=1 q=52] q=""]
210− ]
211− ]
212− ]
213−
214−### `++cock`
215−
216−HTTP cookies, results in associative list of cord to cord.
217−
218−Accepts
219−-------
220−
221−Produces
222−--------
223−
224−Source
225−------
226−
227− ++ cock :: cookie
228− (most ;~(plug sem ace) ;~(plug toke ;~(pfix tis tosk)))
229−
230−Examples
231−--------
232−
233− ~zod/try=> (scan "sam=lop" cock:epur)
234− [['sam' 'lop'] ~]
235− ~zod/try=> (scan "sam=lop; res=\"salo don -keg!mo\"" cock:epur)
236− [['sam' 'lop'] ~[['res' 'salo don -keg!mo']]]
237− ~zod/try=> (scan "sam=lop; res=\"salo don -keg!mo\"; so" cock:epur)
238− ! {1 34}
239− ! exit
240−
241−### `++dlab`
242−
243−Domain label: alphanumeric, with `-` allowed in middle.
244−
245−Accepts
246−-------
247−
248−Produces
249−--------
250−
251−Source
252−------
253−
254− ++ dlab :: 2396 domainlabel
255− %+ sear
256− |= a=@ta
257− ?.(=('-' (rsh 3 (dec (met 3 a)) a)) [~ u=a] ~)
258− %+ cook cass
259− ;~(plug aln (star alp))
260− ::
261−
262−Examples
263−--------
264−
265− ~zod/try=> (scan "google" dlab:epur)
266− ~.google
267− ~zod/try=> (scan "lera2" dlab:epur)
268− ~.lera2
269− ~zod/try=> (scan "gor-tem" dlab:epur)
270− ~.gor-tem
271− ~zod/try=> (scan "gortem-" dlab:epur)
272− ! {1 8}
273− ! exit
274−
275−### `++fque`
276−
277−One or more query string characters
278−
279−Accepts
280−-------
281−
282−Produces
283−--------
284−
285−Source
286−------
287−
288− ++ fque (cook crip (plus pquo)) :: normal query field
289−
290−Examples
291−--------
292−
293− ~zod/try=> (scan "%20" fque:epur)
294− ' '
295− ~zod/try=> (scan "sam" fque:epur)
296− 'sam'
297− ~zod/try=> (scan "les+tor" fque:epur)
298− 'les tor'
299− ~zod/try=> (scan "sore-%22mek%22" fque:epur)
300− 'sore-"mek"'
301− ~zod/try=> (scan "" fque:epur)
302− ! {1 1}
303− ! exit
304−
305−### `++fquu`
306−
307−Zero or more query string characters
308−
309−Accepts
310−-------
311−
312−Produces
313−--------
314−
315−Source
316−------
317−
318− ++ fquu (cook crip (star pquo)) :: optional field
319−
320−Examples
321−--------
322−
323− ~zod/try=> (scan "%20" fquu:epur)
324− ' '
325− ~zod/try=> (scan "sam" fquu:epur)
326− 'sam'
327− ~zod/try=> (scan "les+tor" fquu:epur)
328− 'les tor'
329− ~zod/try=> (scan "sore-%22mek%22" fquu:epur)
330− 'sore-"mek"'
331− ~zod/try=> (scan "" fquu:epur)
332− ''
333−
334−### `++pcar`
335−
336−Single URL path character: literal, `%` escape, subpath delimiter, `:`
337−or `@`
338−
339−Accepts
340−-------
341−
342−Produces
343−--------
344−
345−Source
346−------
347−
348− ++ pcar ;~(pose pure pesc psub col pat) :: 2396 path char
349−
350−Examples
351−--------
352−
353− ~zod/try=> (scan "a" pcar:epur)
354− ~~a
355− ~zod/try=> (scan "ab" pcar:epur)
356− ! {1 2}
357− ! exit
358− ~zod/try=> (scan "-" pcar:epur)
359− ~~-
360− ~zod/try=> (scan "." pcar:epur)
361− ~~~.
362− ~zod/try=> (scan "%20" pcar:epur)
363− ~~.
364− ~zod/try=> (scan "!" pcar:epur)
365− ~~~21.
366−
367−### `++pcok`
368−
369−Cookie character
370−
371−Accepts
372−-------
373−
374−Produces
375−--------
376−
377−Source
378−------
379−
380− ++ pcok ;~(less bas sem com doq prn) :: cookie char
381−
382−Examples
383−--------
384−
385− ~zod/try=> (scan "a" pcok:epur)
386− ~~a
387− ~zod/try=> (scan "ab" pcok:epur)
388− ! {1 2}
389− ! exit
390− ~zod/try=> (scan "!" pcok:epur)
391− ~~~21.
392− ~zod/try=> (scan ";" pcok:epur)
393− ! {1 2}
394− ! exit
395−
396−### `++pesc`
397−
398−URL `%` escape, by two hex characters.
399−
400−Accepts
401−-------
402−
403−Produces
404−--------
405−
406−Source
407−------
408−
409− ++ pesc ;~(pfix cen mes) :: 2396 escaped
410−
411−Examples
412−--------
413−
414− ~zod/try=> `@t`(scan "%22" pesc:epur)
415− '"'
416− ~zod/try=> `@t`(scan "%20" pesc:epur)
417− ' '
418−
419−### `++pold`
420−
421−Old URL `' '` escape
422−
423−Accepts
424−-------
425−
426−Produces
427−--------
428−
429−Source
430−------
431−
432− ++ pold (cold ' ' (just '+')) :: old space code
433−
434−Examples
435−--------
436−
437− ~zod/try=> `@t`(scan "+" pold:epur)
438− ' '
439− ~zod/try=> `@t`(scan " " pold:epur)
440− ! {1 1}
441− ! exit
442−
443−### `++pque`
444−
445−Irregular query string character.
446−
447−Accepts
448−-------
449−
450−Produces
451−--------
452−
453−Source
454−------
455−
456− ++ pque ;~(pose pcar fas wut) :: 3986 query char
457−
458−Examples
459−--------
460−
461− ~zod/try=> `@t`(scan "a" pque:epur)
462− 'a'
463− ~zod/try=> `@t`(scan "?" pque:epur)
464− '?'
465− ~zod/try=> `@t`(scan "%20" pque:epur)
466− ' '
467− ~zod/try=> `@t`(scan "+" pque:epur)
468− '+'
469−
470−### `++pquo`
471−
472−Character in query string key/value
473−
474−Accepts
475−-------
476−
477−Produces
478−--------
479−
480−Source
481−------
482−
483− ++ pquo ;~(pose pure pesc pold) :: normal query char
484−
485−Examples
486−--------
487−
488− ~zod/try=> (scan "a" pquo:epur)
489− 'a'
490− ~zod/try=> (scan "ab" pquo:epur)
491− ! {1 2}
492− ! exit
493− ~zod/try=> (scan "%22" pquo:epur)
494− '"'
495− ~zod/try=> (scan "%20" pquo:epur)
496− ' '
497− ~zod/try=> (scan "+" pquo:epur)
498− ' '
499−
500−### `++pure`
501−
502−URL-safe character
503−
504−Accepts
505−-------
506−
507−Produces
508−--------
509−
510−Source
511−------
512−
513− ++ pure ;~(pose aln hep dot cab sig) :: 2396 unreserved
514−
515−Examples
516−--------
517−
518− ~zod/try=> (scan "a" pure:epur)
519− ~~a
520− ~zod/try=> (scan "%20" pure:epur)
521− ! {1 1}
522− ! exit
523− ~zod/try=> (scan "." pure:epur)
524− ~~~.
525− ~zod/try=> (scan "-" pure:epur)
526− ~~-
527−
528−### `++psub`
529−
530−URL path subdelimeter
531−
532−Accepts
533−-------
534−
535−Produces
536−--------
537−
538−Source
539−------
540−
541− ++ psub ;~ pose :: 3986 sub-delims
542− zap buc pam soq pel per
543− tar lus com sem tis
544− ==
545−
546−Examples
547−--------
548−
549− ~zod/try=> `@t`(scan "+" psub:epur)
550− '+'
551− ~zod/try=> `@t`(scan "(" psub:epur)
552− '('
553− ~zod/try=> `@t`(scan "$" psub:epur)
554− '$'
555− ~zod/try=> `@t`(scan "a" psub:epur)
556− ! {1 1}
557− ! exit
558−
559−### `++ptok`
560−
561−Character valid in HTTP token
562−
563−Accepts
564−-------
565−
566−Produces
567−--------
568−
569−Source
570−------
571−
572− ++ ptok ;~ pose :: 2616 token
573− aln zap hax buc cen pam soq tar lus
574− hep dot ket cab tec bar sig
575− ==
576−
577−Examples
578−--------
579−
580− ~zod/try=> `tape`(murn =+(a=' ' |-(`tape`?:(=(0x7f a) ~ [a $(a +(a))]))) (curr rush ptok):epur)
581− "!#$%&'*+-.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ^_`abcdefghijklmnopqrstuvwxyz|~"
582− ~zod/try=> `tape`(skim =+(a=' ' |-(`tape`?:(=(0x7f a) ~ [a $(a +(a))]))) |=(a=char ?=(~ (rush a ptok:epur))))
583− " "(),/:;<=>?@[\]{}"
584−
585−### `++scem`
586−
587−URI scheme: alphabetic character, followed by any number of
588−alphanumeric, `+` `-` or `.`
589−
590−Accepts
591−-------
592−
593−Produces
594−--------
595−
596−Source
597−------
598−
599− ++ scem :: 2396 scheme
600− %+ cook cass
601− ;~(plug alf (star ;~(pose aln lus hep dot)))
602− ::
603−
604−Examples
605−--------
606−
607− ~zod/try=> `@t`(scan "http" scem:epur)
608− 'http'
609− ~zod/try=> `@t`(scan "https" scem:epur)
610− 'https'
611− ~zod/try=> `@t`(scan "chrome-extension" scem:epur)
612− 'chrome-extension'
613−
614−### `++smeg`
615−
616−URL path segment
617−
618−Accepts
619−-------
620−
621−Produces
622−--------
623−
624−Source
625−------
626−
627− ++ smeg (cook crip (plus pcar)) :: 2396 segment
628−
629−Examples
630−--------
631−
632− ~zod/try=> (scan "foo" smeg:epur)
633− 'foo'
634− ~zod/try=> (scan "bar%20baz-bam" smeg:epur)
635− 'bar baz-bam'
636−
637−### `++tock`
638−
639−HTTP cookie value
640−
641−Accepts
642−-------
643−
644−Produces
645−--------
646−
647−Source
648−------
649−
650− ++ tock (cook crip (plus pcok)) :: 6265 cookie-value
651−
652−Examples
653−--------
654−
655− ~zod/try=> (rush 'sam' tock:epur)
656− [~ 'sam']
657− ~zod/try=> (rush 'las!tore' tock:epur)
658− [~ 'las!tore']
659− ~zod/try=> (rush '"sop""les"tor' tock:epur)
660− ~
661− ~zod/try=> (rush '"zemug"' tock:epur)
662− ~
663−
664−### `++tosk`
665−
666−Possibly quoted HTTP cookie value
667−
668−Accepts
669−-------
670−
671−Produces
672−--------
673−
674−Source
675−------
676−
677− ++ tosk ;~(pose tock (ifix [doq doq] tock)) :: 6265 cookie-value
678−
679−Examples
680−--------
681−
682− ~zod/try=> (rush 'sam' tosk:epur)
683− [~ 'sam']
684− ~zod/try=> (rush 'las!tore' tosk:epur)
685− [~ 'las!tore']
686− ~zod/try=> (rush '"sop""les"tor' tosk:epur)
687− ~
688− ~zod/try=> (rush '"zemug"' tosk:epur)
689− [~ 'zemug']
690−
691−### `++toke`
692−
693−HTTP cookie name
694−
695−Accepts
696−-------
697−
698−Produces
699−--------
700−
701−Source
702−------
703−
704− ++ toke (cook crip (plus ptok)) :: 2616 token
705−
706−Examples
707−--------
708−
709− ~zod/try=> (rush 'sam' toke:epur)
710− [~ 'sam']
711− ~zod/try=> (rush 'las!tore' toke:epur)
712− [~ 'las!tore']
713− ~zod/try=> (rush 'sop""les"tor' toke:epur)
714− ~
715− ~zod/try=> (rush '"zemug"' toke:epur)
716− ~
717−
718−### `++thor`
719−
720−Parse ++host and unit `@ui` port.
721−
722−Accepts
723−-------
724−
725−Produces
726−--------
727−
728−Source
729−------
730−
731− ++ thor :: 2396 host/port
732− %+ cook |*(a=[* *] [+.a -.a])
733− ;~ plug
734− thos
735− ;~(pose (stag ~ ;~(pfix col dim:ag)) (easy ~))
736− ==
737−
738−Examples
739−--------
740−
741− ~zod/try=> (scan "localhost" thor:epur)
742− [~ [%.y i='localhost' t=~]]
743− ~zod/try=> (scan "localhost:8080" thor:epur)
744− [[~ q=8.080] [%.y i='localhost' t=~]]
745− ~zod/try=> (scan "192.168.0.1:8080" thor:epur)
746− [[~ q=8.080] [%.n q=3.232.235.521]]
747− ~zod/try=> (scan "www.google.com" thor:epur)
748− [~ [%.y i='com' t=~['google' 'www']]]
749−
750−### `++thos`
751−
752−URI host: dot-separated segments, or IP address.
753−
754−Accepts
755−-------
756−
757−Produces
758−--------
759−
760−Source
761−------
762−
763− ++ thos :: 2396 host, no local
764− ;~ plug
765− ;~ pose
766− %+ stag %&
767− %+ sear :: LL parser weak here
768− |= a=(list ,@t)
769− =+ b=(flop a)
770− ?> ?=(^ b)
771− =+ c=(end 3 1 i.b)
772− ?.(&((gte c 'a') (lte c 'z')) ~ [~ u=b])
773− (most dot dlab)
774− ::
775− %+ stag %|
776− =+ tod=(ape:ag ted:ab)
777− %+ bass 256
778− ;~(plug tod (stun [3 3] ;~(pfix dot tod)))
779− ==
780− ==
781−
782−Examples
783−--------
784−
785− ~zod/try=> (scan "localhost" thos:epur)
786− [%.y i='localhost' t=~]
787− ~zod/try=> (scan "192.168.0.1" thos:epur)
788− [%.n q=3.232.235.521]
789− ~zod/try=> (scan "192.168.0.1:80" thos:epur)
790− ! {1 12}
791− ! exit
792− ~zod/try=> (scan "www.google.com" thos:epur)
793− [%.y i='com' t=~['google' 'www']]
794−
795−### `++yque`
796−
797−Parses query string, or lack thereof. Result type ++quay
798−
799−Accepts
800−-------
801−
802−Produces
803−--------
804−
805−Source
806−------
807−
808− ++ yque :: query ending
809− ;~ pose
810− ;~(pfix wut yquy)
811− (easy ~)
812− ==
813−
814−Examples
815−--------
816−
817− ~zod/try=> (scan "?sar=tok" yque:epur)
818− [['sar' 'tok'] ~]
819− ~zod/try=> (scan "?les=urbit%20sep&met=kam" yque:epur)
820− [['les' 'urbit sep'] ~[['met' 'kam']]]
821− ~zod/try=> (scan "" yque:epur)
822− ~
823−
824−### `++yquy`
825−
826−Parse query string after `?`
827−
828−Accepts
829−-------
830−
831−Produces
832−--------
833−
834−Source
835−------
836−
837− ++ yquy :: query
838− ;~ pose :: proper query
839− %+ more
840− ;~(pose pam sem)
841− ;~(plug fque ;~(pose ;~(pfix tis fquu) (easy '')))
842− ::
843− %+ cook :: funky query
844− |=(a=tape [[%$ (crip a)] ~])
845− (star pque)
846− ==
847−
848−Examples
849−--------
850−
851− ~zod/try=> (scan "sar=tok" yquy:epur)
852− [['sar' 'tok'] ~]
853− ~zod/try=> (scan "les=urbit%20sep&met=kam" yquy:epur)
854− [['les' 'urbit sep'] ~[['met' 'kam']]]
855− ~zod/try=> (scan "" yquy:epur)
856− ~
857−
858−### `++zest`
859−
860−Parse ++quri absolute or relative request path
861−
862−Accepts
863−-------
864−
865−Produces
866−--------
867−
868−Source
869−------
870−
871− ++ zest :: 2616 request-uri
872− ;~ pose
873− (stag %& (cook |=(a=purl a) auri))
874− (stag %| ;~(plug apat yque))
875− ==
876− --
877−
878−Examples
879−--------
880−
881− ~zod/try=> (scan "http://www.google.com:80/search?q=foo" zest:epur)
882− [%.y p=[p=%.n q=[~ 80] r=[%.y p=<|com google www|>]] q=[p=~ q=<|search|>] r=~[[p='q' q='foo']]]
883− ~zod/try=> (scan "/rel/bat" zest:epur)
884− [%.n [p=~ q=<|rel bat|>] ~]
885−
docs/system/hoon/library/core/fe.mddeleted−416
@@ -1,416 +0,0 @@
1−### `++fe` :: modulo bloq
2−
3−Modulo bloq
4−
5−Core containing XX
6−
7−Accepts
8−-------
9−
10−`a` is a [`++bloq`]().
11−
12−Source
13−------
14−
15− |_ a=bloq
16−
17−### `++dif`
18−
19−Produces the difference between two [atom]()s in the modular basis
20−representation.
21−
22−Accepts
23−-------
24−
25−`a` is a [`++bloq`]().
26−
27−`b` is an atom.
28−
29−`c` is an atom.
30−
31−Produces
32−--------
33−
34−A [`@s`]()
35−
36−Source
37−------
38−
39− ++ dif |=([b=@ c=@] (sit (sub (add out (sit b)) (sit c))))
40−
41−Examples
42−--------
43−
44− ~zod/try=> (~(dif fe 3) 63 64)
45− 255
46− ~zod/try=> (~(dif fe 3) 5 10)
47− 251
48− ~zod/try=> (~(dif fe 3) 0 1)
49− 255
50− ~zod/try=> (~(dif fe 0) 9 10)
51− 1
52− ~zod/try=> (~(dif fe 0) 9 11)
53− 0
54− ~zod/try=> (~(dif fe 0) 9 12)
55− 1
56− ~zod/try=> (~(dif fe 2) 9 12)
57− 13
58− ~zod/try=> (~(dif fe 2) 63 64)
59− 15
60−
61−------------------------------------------------------------------------
62−
63−### `++inv`
64−
65−Invert mod field
66−
67−Inverts the order of the modular field.
68−
69−Accepts
70−-------
71−
72−`b` is a [`++bloq`]().
73−
74−Produces
75−--------
76−
77−An atom.
78−
79−
80−Source
81−------
82−
83− ++ inv |=(b=@ (sub (dec out) (sit b)))
84−
85−Examples
86−--------
87−
88− ~zod/try=> (~(inv fe 3) 255)
89− 0
90− ~zod/try=> (~(inv fe 3) 256)
91− 255
92− ~zod/try=> (~(inv fe 3) 0)
93− 255
94− ~zod/try=> (~(inv fe 3) 1)
95− 254
96− ~zod/try=> (~(inv fe 3) 2)
97− 253
98− ~zod/try=> (~(inv fe 3) 55)
99− 200
100−
101−------------------------------------------------------------------------
102−
103−### `++net`
104−
105−Reverse bytes
106−
107−Revereses bytes within block.
108−
109−Accepts
110−-------
111−
112−`b` is a [`++bloq`]().
113−
114−Produces
115−--------
116−
117−An atom.=
118−
119−Source
120−------
121−
122− ++ net |= b=@ ^- @
123− => .(b (sit b))
124− ?: (lte a 3)
125− b
126− =+ c=(dec a)
127− %+ con
128− (lsh c 1 $(a c, b (cut c [0 1] b)))
129− $(a c, b (cut c [1 1] b))
130−
131−Examples
132−--------
133−
134− ~zod/try=> (~(net fe 3) 64)
135− 64
136− ~zod/try=> (~(net fe 3) 128)
137− 128
138− ~zod/try=> (~(net fe 3) 255)
139− 255
140− ~zod/try=> (~(net fe 3) 256)
141− 0
142− ~zod/try=> (~(net fe 3) 257)
143− 1
144− ~zod/try=> (~(net fe 3) 500)
145− 244
146− ~zod/try=> (~(net fe 3) 511)
147− 255
148− ~zod/try=> (~(net fe 3) 512)
149− 0
150− ~zod/try=> (~(net fe 3) 513)
151− 1
152− ~zod/try=> (~(net fe 3) 0)
153− 0
154− ~zod/try=> (~(net fe 3) 1)
155− 1
156− ~zod/try=> (~(net fe 0) 1)
157− 1
158− ~zod/try=> (~(net fe 0) 2)
159− 0
160− ~zod/try=> (~(net fe 0) 3)
161− 1
162− ~zod/try=> (~(net fe 6) 1)
163− 72.057.594.037.927.936
164− ~zod/try=> (~(net fe 6) 2)
165− 144.115.188.075.855.872
166− ~zod/try=> (~(net fe 6) 3)
167− 216.172.782.113.783.808
168− ~zod/try=> (~(net fe 6) 4)
169− 288.230.376.151.711.744
170− ~zod/try=> (~(net fe 6) 5)
171− 360.287.970.189.639.680
172− ~zod/try=> (~(net fe 6) 6)
173− 432.345.564.227.567.616
174− ~zod/try=> (~(net fe 6) 7)
175− 504.403.158.265.495.552
176− ~zod/try=> (~(net fe 6) 512)
177− 562.949.953.421.312
178− ~zod/try=> (~(net fe 6) 513)
179− 72.620.543.991.349.248
180−
181−------------------------------------------------------------------------
182−
183−### `++out`
184−
185−Max integer value
186−
187−The maximum integer value that the current block can store.
188−
189−Accepts
190−-------
191−
192−A [`++bloq`]().
193−
194−Produces
195−--------
196−
197−An [atom]().
198−
199−Source
200−------
201−
202− ++ out (bex (bex a))
203−
204−Examples
205−--------
206−
207− ~zod/try=> ~(out fe 0)
208− 2
209− ~zod/try=> ~(out fe 1)
210− 4
211− ~zod/try=> ~(out fe 2)
212− 16
213− ~zod/try=> ~(out fe 3)
214− 256
215− ~zod/try=> ~(out fe 4)
216− 65.536
217− ~zod/try=> ~(out fe 10)
218− \/179.769.313.486.231.590.772.930.519.078.902.473.361.797.697.894.230.657.\/
219− 273.430.081.157.732.675.805.500.963.132.708.477.322.407.536.021.120.113.
220− 879.871.393.357.658.789.768.814.416.622.492.847.430.639.474.124.377.767.
221− 893.424.865.485.276.302.219.601.246.094.119.453.082.952.085.005.768.838.
222− 150.682.342.462.881.473.913.110.540.827.237.163.350.510.684.586.298.239.
223− 947.245.938.479.716.304.835.356.329.624.224.137.216
224− \/ \/
225−
226−------------------------------------------------------------------------
227−
228−### `++rol`
229−
230−Roll left
231−
232−Roll `d` to the left by `c` `b`-sized blocks.
233−
234−Accepts
235−-------
236−
237−`a` is a [`++bloq`]().
238−
239−`b` is a `++bloq`.
240−
241−`c` is an atom.
242−
243−`d` is an atom.
244−
245−Produces
246−--------
247−
248−An atom.
249−
250−Source
251−------
252−
253− ++ rol |= [b=bloq c=@ d=@] ^- @ :: roll left
254− =+ e=(sit d)
255− =+ f=(bex (sub a b))
256− =+ g=(mod c f)
257− (sit (con (lsh b g e) (rsh b (sub f g) e)))
258−
259−Examples
260−--------
261−
262− ~zod/try=> `@ux`(~(rol fe 6) 4 3 0xabac.dedf.1213)
263− 0x1213.0000.abac.dedf
264− ~zod/try=> `@ux`(~(rol fe 6) 4 2 0xabac.dedf.1213)
265− 0xdedf.1213.0000.abac
266− ~zod/try=> `@t`(~(rol fe 5) 3 1 'dfgh')
267− 'hdfg'
268− ~zod/try=> `@t`(~(rol fe 5) 3 2 'dfgh')
269− 'ghdf'
270− ~zod/try=> `@t`(~(rol fe 5) 3 0 'dfgh')
271− 'dfgh'
272−
273−------------------------------------------------------------------------
274−
275−### `++ror`
276−
277−Roll right
278−
279−Roll `d` to the right by `c` `b`-sized blocks.
280−
281−Accepts
282−-------
283−
284−`a` is a [`++bloq`]().
285−
286−`b` is a `++bloq`.
287−
288−`c` is an [atom]().
289−
290−`d` is an atom.
291−
292−Produces
293−--------
294−
295−An atom.
296−
297−Source
298−------
299−
300− ++ ror |= [b=bloq c=@ d=@] ^- @ :: roll right
301− =+ e=(sit d)
302− =+ f=(bex (sub a b))
303− =+ g=(mod c f)
304− (sit (con (rsh b g e) (lsh b (sub f g) e)))
305−
306−Examples
307−--------
308−
309− ~zod/try=> `@ux`(~(ror fe 6) 4 1 0xabac.dedf.1213)
310− 0x1213.0000.abac.dedf
311− ~zod/try=> `@ux`(~(ror fe 6) 3 5 0xabac.dedf.1213)
312− 0xacde.df12.1300.00ab
313− ~zod/try=> `@ux`(~(ror fe 6) 3 3 0xabac.dedf.1213)
314− 0xdf12.1300.00ab.acde
315− ~zod/try=> `@t`(~(rol fe 5) 3 0 'hijk')
316− 'hijk'
317− ~zod/try=> `@t`(~(rol fe 5) 3 1 'hijk')
318− 'khij'
319− ~zod/try=> `@t`(~(rol fe 5) 3 2 'hijk')
320− 'jkhi'
321−
322−------------------------------------------------------------------------
323−
324−### `++sum`
325−
326−Sum
327−
328−Sum two numbers in this modular field.
329−
330−Accepts
331−-------
332−
333−`a` is a [`++bloq`]().
334−
335−`b` is an [atom]().
336−
337−`c` is an atom.
338−
339−Produces
340−--------
341−
342−An atom.
343−
344−Source
345−------
346−
347− ++ sum |=([b=@ c=@] (sit (add b c))) :: wrapping add
348−
349−Examples
350−--------
351−
352− ~zod/try=> (~(sum fe 3) 10 250)
353− 4
354− ~zod/try=> (~(sum fe 0) 0 1)
355− 1
356− ~zod/try=> (~(sum fe 0) 0 2)
357− 0
358− ~zod/try=> (~(sum fe 2) 14 2)
359− 0
360− ~zod/try=> (~(sum fe 2) 14 3)
361− 1
362− ~zod/try=> (~(sum fe 4) 10.000 256)
363− 10.256
364− ~zod/try=> (~(sum fe 4) 10.000 100.000)
365− 44.464
366−
367−### `++sit`
368−
369−Atom in mod block representation
370−
371−Produce an [atom]() in the current modular block representation.
372−
373−Accepts
374−-------
375−
376−`a` is a [`++bloq`]().
377−
378−`b` is an atom.
379−
380−Produces
381−--------
382−
383−An atom.
384−
385−Source
386−------
387−
388− ++ sit |=(b=@ (end a 1 b)) :: enforce modulo
389−
390−Examples
391−--------
392−
393− ~zod/try=> (~(sit fe 3) 255)
394− 255
395− ~zod/try=> (~(sit fe 3) 256)
396− 0
397− ~zod/try=> (~(sit fe 3) 257)
398− 1
399− ~zod/try=> (~(sit fe 2) 257)
400− 1
401− ~zod/try=> (~(sit fe 2) 10.000)
402− 0
403− ~zod/try=> (~(sit fe 2) 100)
404− 4
405− ~zod/try=> (~(sit fe 2) 19)
406− 3
407− ~zod/try=> (~(sit fe 2) 17)
408− 1
409− ~zod/try=> (~(sit fe 0) 17)
410− 1
411− ~zod/try=> (~(sit fe 0) 0)
412− 0
413− ~zod/try=> (~(sit fe 0) 1)
414− 1
415−
416−
docs/system/hoon/library/core/fu.mddeleted−68
@@ -1,68 +0,0 @@
1−3bA lite number theory
2−======================
3−
4−### `++fu`
5−
6− ++ fu :: modulo (mul p q)
7− |= a=[p=@ q=@]
8− =+ b=?:(=([0 0] a) 0 (~(inv fo p.a) (~(sit fo p.a) q.a)))
9− |%
10−
11−XX document
12−
13−### `++dif`
14−
15− ++ dif
16− |= [c=[@ @] d=[@ @]]
17− [(~(dif fo p.a) -.c -.d) (~(dif fo q.a) +.c +.d)]
18− ::
19−
20−XX document
21−
22−### `++exp`
23−
24− ++ exp
25− |= [c=@ d=[@ @]]
26− :- (~(exp fo p.a) (mod c (dec p.a)) -.d)
27− (~(exp fo q.a) (mod c (dec q.a)) +.d)
28− ::
29−
30−XX document
31−
32−### `++out`
33−
34− ++ out :: garner's formula
35− |= c=[@ @]
36− %+ add
37− +.c
38− (mul q.a (~(pro fo p.a) b (~(dif fo p.a) -.c (~(sit fo p.a) +.c))))
39− ::
40−
41−XX document
42−
43−### `++pro`
44−
45− ++ pro
46− |= [c=[@ @] d=[@ @]]
47− [(~(pro fo p.a) -.c -.d) (~(pro fo q.a) +.c +.d)]
48− ::
49−
50−XX document
51−
52−### `++sum`
53−
54− ++ sum
55− |= [c=[@ @] d=[@ @]]
56− [(~(sum fo p.a) -.c -.d) (~(sum fo q.a) +.c +.d)]
57− ::
58−
59−XX document
60−
61−### `++sit`
62−
63− ++ sit
64− |= c=@
65− [(mod c p.a) (mod c q.a)]
66−
67−XX document
68−
docs/system/hoon/library/core/in.mddeleted−589
@@ -1,589 +0,0 @@
1−
2−### `++in`
3−
4−Set operations
5−
6−Core whose [arm]()s contain a variety of functions that operate on [`++set`]()s. Its [sample]() accepts the input [`++set`]() to be manipulated.
7−
8−Accepts
9−-------
10−
11−A `++set`.
12−
13−Source
14−------
15−
16− ++ in :: set engine
17− ~/ %in
18− |/ a=(set)
19−
20−Examples
21−--------
22−
23− ~zod/try=> ~(. in (sa "asd"))
24− <13.evb [nlr(^$1{@tD $1}) <414.fvk 101.jzo 1.ypj %164>]>
25−
26−### `+-all:in`
27−
28−Logical AND
29−
30−Computes the logical AND on every element in `a` slammed with `b`,
31−producing a boolean.
32−
33−Accepts
34−-------
35−
36−`a` is a [`++set`]().
37−
38−`b` is a [wet]() [gate]() that accepts a [noun]() and produces a boolean.
39−
40−Produces
41−--------
42−
43−A boolean.
44−
45−Source
46−------
47−
48− +- all :: logical AND
49− ~/ %all
50− |* b=$+(* ?)
51− |- ^- ?
52− ?~ a
53− &
54− ?&((b n.a) $(a l.a) $(a r.a))
55− ::
56−
57−Examples
58−--------
59−
60− ~zod/try=> =b (sa `(list ,[@t *])`[['a' 1] ['b' [2 3]] ~])
61− ~zod/try=> (~(all in b) |=(a=* ?@(+.a & |)))
62− %.n
63− ~zod/try=> =b (sa `(list ,@t)`['john' 'bonita' 'daniel' 'madeleine' ~])
64− ~zod/try=> (~(all in b) |=(a=@t (gte a 100)))
65− %.y
66−
67−------------------------------------------------------------------------
68−
69−### `+-any:in`
70−
71−Logical OR
72−
73−Computes the logical OR on every element of `a` slammed with `b`.
74−
75−Accepts
76−-------
77−
78−`a` is a [`++set`]().
79−
80−`b` is a [gate]() that accepts a noun and produces a boolean.
81−
82−Produces
83−--------
84−
85−A boolean.
86−
87−Source
88−------
89−
90− +- any :: logical OR
91− ~/ %any
92− |* b=$+(* ?)
93− |- ^- ?
94− ?~ a
95− |
96− ?|((b n.a) $(a l.a) $(a r.a))
97− ::
98−
99−Examples
100−--------
101−
102− ~zod/try=> =b (sa `(list ,[@t *])`[['a' 1] ['b' [2 3]] ~])
103− ~zod/try=> (~(any in b) |=(a=* ?@(+.a & |)))
104− %.y
105− ~zod/try=> =b (sa `(list ,@t)`['john' 'bonita' 'daniel' 'madeleine' ~])
106− ~zod/try=> (~(any in b) |=(a=@t (lte a 100)))
107− %.n
108−
109−------------------------------------------------------------------------
110−
111−### `+-del:in`
112−
113−Remove noun
114−
115−Removes `b` from the [`++set`]() `a`.
116−
117−Accepts
118−-------
119−
120−`a` is a set.
121−
122−`b` is a [noun]().
123−
124−Produces
125−--------
126−
127−A set.
128−
129−Source
130−------
131−
132− +- del :: b without any a
133− ~/ %del
134− |* b=*
135− |- ^+ a
136− ?~ a
137− ~
138− ?. =(b n.a)
139− ?: (hor b n.a)
140− [n.a $(a l.a) r.a]
141− [n.a l.a $(a r.a)]
142− |- ^- ?(~ _a)
143− ?~ l.a r.a
144− ?~ r.a l.a
145− ?: (vor n.l.a n.r.a)
146− [n.l.a l.l.a $(l.a r.l.a)]
147− [n.r.a $(r.a l.r.a) r.r.a]
148− ::
149−
150−
151−Examples
152−--------
153−
154− ~zod/try=> =b (sa `(list ,@t)`['a' 'b' 'c' ~])
155− ~zod/try=> (~(del in b) 'a')
156− {'c' 'b'}
157− ~zod/try=> =b (sa `(list ,@t)`['john' 'bonita' 'daniel' 'madeleine' ~])
158− ~zod/try=> (~(del in b) 'john')
159− {'bonita' 'madeleine' 'daniel'}
160− ~zod/try=> (~(del in b) 'susan')
161− {'bonita' 'madeleine' 'daniel' 'john'}
162−
163−------------------------------------------------------------------------
164−
165−### `+-dig:in`
166−
167−Axis a in b
168−
169−Produce the axis of `b` within `a`.
170−
171−Accepts
172−-------
173−
174−`a` is a [`++set`]().
175−
176−`b` is a [noun]().
177−
178−Produces
179−--------
180−
181−The [`++unit`]() of an atom.
182−
183−Source
184−------
185−
186− +- dig :: axis of a in b
187− |= b=*
188− =+ c=1
189− |- ^- (unit ,@)
190− ?~ a ~
191− ?: =(b n.a) [~ u=(peg c 2)]
192− ?: (gor b n.a)
193− $(a l.a, c (peg c 6))
194− $(a r.a, c (peg c 7))
195− ::
196−
197−
198−Examples
199−--------
200−
201− ~zod/try=> =a (sa `(list ,@)`[1 2 3 4 5 6 7 ~])
202− ~zod/try=> a
203− {5 4 7 6 1 3 2}
204− ~zod/try=> -.a
205− n=6
206− ~zod/try=> (~(dig in a) 7)
207− [~ 12]
208− ~zod/try=> (~(dig in a) 2)
209− [~ 14]
210− ~zod/try=> (~(dig in a) 6)
211− [~ 2]
212−
213−------------------------------------------------------------------------
214−
215−### `+-gas:in`
216−
217−Concatenate
218−
219−Insert the elements of a [`++list`]() `b` into a [`++set`]() `a`.
220−
221−Accepts
222−-------
223−
224−`a` is a set.
225−
226−`b` is a list.
227−
228−Produces
229−--------
230−
231−A `++set`.
232−
233−Source
234−------
235−
236− +- gas :: concatenate
237− ~/ %gas
238− |= b=(list ,_?>(?=(^ a) n.a))
239− |- ^+ a
240− ?~ b
241− a
242− $(b t.b, a (put(+< a) i.b))
243− ::
244−
245−
246−Examples
247−--------
248−
249− ~zod/try=> b
250− {'bonita' 'madeleine' 'rudolf' 'john'}
251− ~zod/try=> (~(gas in b) `(list ,@t)`['14' 'things' 'number' '1.337' ~])
252− {'1.337' '14' 'number' 'things' 'bonita' 'madeleine' 'rudolf' 'john'}
253− ~zod/try=> (~(gas in s) `(list ,@t)`['1' '2' '3' ~])
254− {'1' '3' '2' 'e' 'd' 'a' 'c' 'b'}
255−
256−------------------------------------------------------------------------
257−
258−### `+-has:in`
259−
260−b in a?
261−
262−Checks if `b` is an element of `a`, producing a boolean.
263−
264−Accepts
265−-------
266−
267−`a` is a [`++set`]().
268−
269−`b` is a [noun]().
270−
271−Produces
272−--------
273−
274−A boolean.
275−
276−Source
277−------
278−
279− +- has :: b exists in a check
280− ~/ %has
281− |* b=*
282− |- ^- ?
283− ?~ a
284− |
285− ?: =(b n.a)
286− &
287− ?: (hor b n.a)
288− $(a l.a)
289− $(a r.a)
290− ::
291−
292−
293−Examples
294−--------
295−
296− ~zod/try=> =a (~(gas in `(set ,@t)`~) `(list ,@t)`[`a` `b` `c` ~])
297− ~zod/try=> (~(has in a) `a`)
298− %.y
299− ~zod/try=> (~(has in a) 'z')
300− %.n
301−
302−------------------------------------------------------------------------
303−
304−### `+-int:in`
305−
306−Intersection
307−
308−Produces a set of the intersection between two [`++set`]()s of the same type,
309−`a` and `b`.
310−
311−Accepts
312−-------
313−
314−`a` is a set.
315−
316−`b` is a set.
317−
318−Produces
319−--------
320−
321−A [`++set`]().
322−
323−Source
324−------
325−
326− +- int :: intersection
327− ~/ %int
328− |* b=_a
329− |- ^+ a
330− ?~ b
331− ~
332− ?~ a
333− ~
334− ?. (vor n.a n.b)
335− $(a b, b a)
336− ?: =(n.b n.a)
337− [n.a $(a l.a, b l.b) $(a r.a, b r.b)]
338− ?: (hor n.b n.a)
339− %- uni(+< $(a l.a, b [n.b l.b ~])) $(b r.b)
340− %- uni(+< $(a r.a, b [n.b ~ r.b])) $(b l.b)
341−
342−
343−Examples
344−--------
345−
346− ~zod/try=> (~(int in (sa "ac")) (sa "ha"))
347− {~~a}
348− ~zod/try=> (~(int in (sa "acmo")) ~)
349− {}
350− ~zod/try=> (~(int in (sa "acmo")) (sa "ham"))
351− {~~a ~~m}
352− ~zod/try=> (~(int in (sa "acmo")) (sa "lep"))
353− {}
354−
355−------------------------------------------------------------------------
356−
357−### `+-put:in`
358−
359−Put b in a
360−
361−Add an element `b` to the [`++set`]() `a`.
362−
363−Accepts
364−-------
365−
366−`a` is a set.
367−
368−`b` is a [noun]().
369−
370−Produces
371−--------
372−
373−A [`++set`]().
374−
375−Source
376−------
377−
378− +- put :: puts b in a
379− ~/ %put
380− |* b=*
381− |- ^+ a
382− ?~ a
383− [b ~ ~]
384− ?: =(b n.a)
385− a
386− ?: (hor b n.a)
387− =+ c=$(a l.a)
388− ?> ?=(^ c)
389− ?: (vor n.a n.c)
390− [n.a c r.a]
391− [n.c l.c [n.a r.c r.a]]
392− =+ c=$(a r.a)
393− ?> ?=(^ c)
394− ?: (vor n.a n.c)
395− [n.a l.a c]
396− [n.c [n.a l.a l.c] r.c]
397− ::
398−
399−
400−Examples
401−--------
402−
403− ~zod/try=> =a (~(gas in `(set ,@t)`~) `(list ,@t)`[`a` `b` `c` ~])
404− ~zod/try=> =b (~(put in a) `d`)
405− ~zod/try=> b
406− {`d` `a` `c` `b`}
407− ~zod/try=> -.l.+.b
408− n=`d`
409−
410−------------------------------------------------------------------------
411−
412−### `+-rep:in`
413−
414−Accumulate
415−
416−Accumulate the elements of `a` using a [gate]() `c` and an accumulator `b`.
417−
418−Accepts
419−--------
420−
421−`a` is a [`++set`]().
422−
423−`b` is a [noun]().
424−
425−`c` is a gate.
426−
427−Produces
428−--------
429−
430−A noun.
431−
432−Source
433−------
434−
435− +- rep :: replace by tile
436− |* [b=* c=_,*]
437− |-
438− ?~ a b
439− $(a r.a, b $(a l.a, b (c n.a b)))
440− ::
441−
442−
443−Examples
444−--------
445−
446− ~zod/try=> =a (~(gas in *(set ,@)) [1 2 3 ~])
447− ~zod/try=> a
448− {1 3 2}
449− ~zod/try=> (~(rep in a) 0 |=([a=@ b=@] (add a b)))
450− 6
451−
452−------------------------------------------------------------------------
453−
454−### `+-tap:in`
455−
456−Set to list
457−
458−Flattens the [`++set`]() `a` into a [`++list`]().
459−
460−Accepts
461−-------
462−
463−`a` is an set.
464−
465−Produces
466−--------
467−
468−A list.
469−
470−Source
471−------
472−
473− +- tap :: list tiles a set
474− ~/ %tap
475− |= b=(list ,_?>(?=(^ a) n.a))
476− ^+ b
477− ?~ a
478− b
479− $(a r.a, b [n.a $(a l.a)])
480− ::
481−
482−
483−Examples
484−--------
485−
486− ~zod/try=> =s (sa `(list ,@t)`['a' 'b' 'c' 'd' 'e' ~])
487− ~zod/try=> s
488− {'e' 'd' 'a' 'c' 'b'}
489− ~zod/try=> (~(tap in s) `(list ,@t)`['1' '2' '3' ~])
490− ~['b' 'c' 'a' 'd' 'e' '1' '2' '3']
491− ~zod/try=> b
492− {'bonita' 'madeleine' 'daniel' 'john'}
493− ~zod/try=> (~(tap in b) `(list ,@t)`['david' 'people' ~])
494− ~['john' 'daniel' 'madeleine' 'bonita' 'david' 'people']
495−
496−------------------------------------------------------------------------
497−
498−### `+-uni:in`
499−
500−Union
501−
502−Produces a set of the union between two [`++set`]()s of the same type, `a` and
503−`b`.
504−
505−Accepts
506−-------
507−
508−`a` is a set.
509−
510−`b` is a set.
511−
512−Produces
513−--------
514−
515−A set.
516−
517−Source
518−------
519−
520− +- uni :: union
521− ~/ %uni
522− |* b=_a
523− |- ^+ a
524− ?~ b
525− a
526− ?~ a
527− b
528− ?: (vor n.a n.b)
529− ?: =(n.b n.a)
530− [n.b $(a l.a, b l.b) $(a r.a, b r.b)]
531− ?: (hor n.b n.a)
532− $(a [n.a $(a l.a, b [n.b l.b ~]) r.a], b r.b)
533− $(a [n.a l.a $(a r.a, b [n.b ~ r.b])], b l.b)
534− ?: =(n.a n.b)
535− [n.b $(b l.b, a l.a) $(b r.b, a r.a)]
536− ?: (hor n.a n.b)
537− $(b [n.b $(b l.b, a [n.a l.a ~]) r.b], a r.a)
538− $(b [n.b l.b $(b r.b, a [n.a ~ r.a])], a l.a)
539−
540−
541−Examples
542−--------
543−
544− ~zod/try=> (~(uni in (sa "ac")) (sa "ha"))
545− {~~a ~~c ~~h}
546− ~zod/try=> (~(uni in (sa "acmo")) ~)
547− {~~a ~~c ~~m ~~o}
548− ~zod/try=> (~(uni in (sa "acmo")) (sa "ham"))
549− {~~a ~~c ~~m ~~o ~~h}
550− ~zod/try=> (~(uni in (sa "acmo")) (sa "lep"))
551− {~~e ~~a ~~c ~~m ~~l ~~o ~~p}
552−
553−------------------------------------------------------------------------
554−
555−### `+-wyt:in`
556−
557−Set size
558−
559−Produce the number of elements in [`++set`]() `a` as an atom.
560−
561−Accepts
562−-------
563−
564−`a` is an set.
565−
566−Produces
567−--------
568−
569−An atom.
570−
571−Source
572−------
573−
574− +- wyt :: size of set
575− |- ^- @
576− ?~(a 0 +((add $(a l.a) $(a r.a))))
577−
578−
579−Examples
580−--------
581−
582− ~zod/try=> =a (~(put in (~(put in (sa)) 'a')) 'b')
583− ~zod/try=> ~(wyt in a)
584− 2
585− ~zod/try=> b
586− {'bonita' 'madeleine' 'daniel' 'john'}
587− ~zod/try=> ~(wyt in b)
588− 4
589−
docs/system/hoon/library/core/ja.mddeleted−229
@@ -1,229 +0,0 @@
1−### `++ja`
2−
3−Jar engine
4−
5− ++ ja :: jar engine
6− |/ a=(jar)
7−
8−A container arm for `++jar` operation arms. A `++jar` is a `++map` of
9−`++list`s. The contained arms inherit the [sample]() jar.
10−
11−`a` is a [jar]().
12−
13− ~zod/try=> ~(. ja (mo (limo a/"ho" b/"he" ~)))
14− <2.dgz [nlr([p={%a %b} q=""]) <414.fvk 101.jzo 1.ypj %164>]>
15−
16−------------------------------------------------------------------------
17−
18−### `+-get:ja`
19−
20−Grab value by key
21−
22− +- get :: grab value by key
23− |* b=*
24− =+ c=(~(get by a) b)
25− ?~(c ~ u.c)
26−
27−Produces a list retrieved from jar `a` using the key `b`.
28−
29−`a` is a [`++jar`](/doc/hoon/library/1#++jar).
30−
31−`b` is a key of the same type as the keys in `a`.
32−
33− ~zod/try=> =l (mo `(list ,[@t (list ,@)])`[['a' `(list ,@)`[1 2 3 ~]] ['b' `(list ,@)`[4 5 6 ~]] ~])
34− ~zod/try=> l
35− {[p='a' q=~[1 2 3]] [p='b' q=~[4 5 6]]}
36− ~zod/try=> (~(get ja l) 'a')
37− ~[1 2 3]
38− ~zod/try=> (~(get ja l) 'b')
39− ~[4 5 6]
40− ~zod/try=> (~(get ja l) 'c')
41− ~
42−
43−------------------------------------------------------------------------
44−
45−### `+-add:ja`
46−
47−Prepend to list
48−
49− +- add :: adds key-list pair
50− |* [b=* c=*]
51− =+ d=(get(+< a) b)
52− (~(put by a) b [c d])
53−
54−Produces jar `a` with value `c` prepended to the list located at key
55−`b`.
56−
57−`a` is a [jar]().
58−
59−`b` is a key of the same type as the keys in `a`.
60−
61−`c` is a value of the same type as the values in `a`.
62−
63− ~zod/try=> =l (mo `(list ,[@t (list ,@)])`[['a' `(list ,@)`[1 2 3 ~]] ['b' `(list ,@)`[4 5 6 ~]] ~])
64− ~zod/try=> l
65− {[p='a' q=~[1 2 3]] [p='b' q=~[4 5 6]]}
66− ~zod/try=> (~(add ja l) 'b' 7)
67− {[p='a' q=~[1 2 3]] [p='b' q=~[7 4 5 6]]}
68− ~zod/try=> (~(add ja l) 'a' 100)
69− {[p='a' q=~[100 1 2 3]] [p='b' q=~[4 5 6]]}
70− ~zod/try=> (~(add ja l) 'c' 7)
71− {[p='a' q=~[1 2 3]] [p='c' q=~[7]] [p='b' q=~[4 5 6]]}
72− ~zod/try=> (~(add ja l) 'c' `(list ,@)`[7 8 9 ~])
73− ! type-fail
74− ! exit
75−
76−------------------------------------------------------------------------
77−
78−### `++ju`
79−
80−Jug operations
81−
82− ++ ju :: jug engine
83− |/ a=(jug)
84−
85−Container arm for jug operation arms. A `++jug` is a `++map` of
86−`++sets`. The contained arms inherit its [sample]() jug, `a`.
87−
88−`a` is a [jug]().
89−
90− ~zod/try=> ~(. ju (mo (limo a/(sa "ho") b/(sa "he") ~)))
91− <2.dgz [nlr([p={%a %b} q={nlr(^$1{@tD $1}) nlr(^$3{@tD $3})}]) <414.fvk 101.jzo 1.ypj %164>]>
92−
93−### `+-del:ju`
94−
95−Remove
96−
97− +- del :: delete at key b
98− |* [b=* c=*]
99− ^+ a
100− =+ d=(get(+< a) b)
101− =+ e=(~(del in d) c)
102− ?~ e
103− (~(del by a) b)
104− (~(put by a) b e)
105−
106−Produces jug `a` with value `c` removed from set located at key `b`.
107−
108−`a` is a [jug]().
109−
110−`b` is a key of the same type as the keys in `a`.
111−
112−`c` is the value of the same type of the keys in `a` that is to be
113−removed.
114−
115− ~zod/try=> s
116− {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
117− ~zod/try=> (~(del ju s) 'a' 1)
118− {[p='a' q={3 2}] [p='b' q={5 4 6}]}
119− ~zod/try=> (~(del ju s) 'c' 7)
120− {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
121−
122−------------------------------------------------------------------------
123−
124−### `+-get:ju`
125−
126−Retrieve set
127−
128− +- get :: gets set by key
129− |* b=*
130− =+ c=(~(get by a) b)
131− ?~(c ~ u.c)
132−
133−Produces a set retrieved from jar `a` using key `b`.
134−
135−`a` is a [jar]().
136−
137−`b` is a key of the same type as the keys in `a`.
138−
139− ~zod/try=> s
140− {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
141− ~zod/try=> (~(get ju s) 'a')
142− {1 3 2}
143− ~zod/try=> (~(get ju s) 'b')
144− {5 4 6}
145− ~zod/try=> (~(get ju s) 'c')
146− ~
147−
148−------------------------------------------------------------------------
149−
150−### `+-has:ju`
151−
152−Check contents
153−
154− +- has :: existence check
155− |* [b=* c=*]
156− ^- ?
157− (~(has in (get(+< a) b)) c)
158−
159−Computes whether a value `c` exists within the set located at key `b`
160−with jar `a`. Produces a loobean.
161−
162−`a` is a [set]().
163−
164−`b` is a key as a [noun]().
165−
166−`c` is a value as a [noun]().
167−
168− ~zod/try=> s
169− {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
170− ~zod/try=> (~(has ju s) 'a' 3)
171− %.y
172− ~zod/try=> (~(has ju s) 'b' 6)
173− %.y
174− ~zod/try=> (~(has ju s) 'a' 7)
175− %.n
176− ~zod/try=> (~(has jus s) 'c' 7)
177− ! -find-limb.jus
178− ! find-none
179− ! exit
180− ~zod/try=> (~(has ju s) 'c' 7)
181− %.n
182−
183−------------------------------------------------------------------------
184−
185−### `+-put:ju`
186−
187−Add key-set pair
188−
189− +- put :: adds key-element pair
190− |* [b=* c=*]
191− ^+ a
192− =+ d=(get(+< a) b)
193− (~(put by a) b (~(put in d) c))
194−
195−Produces jar `a` with `c` added to the set value located at key `b`.
196−
197−`a` is a [set]().
198−
199−`b` is a key as a [noun]().
200−
201−`c` is a [value]().
202−
203− ~zod/try=> s
204− {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
205− ~zod/try=> (~(put ju s) 'a' 7)
206− {[p='a' q={7 1 3 2}] [p='b' q={5 4 6}]}
207− ~zod/try=> (~(put ju s) 'a' 1)
208− {[p='a' q={1 3 2}] [p='b' q={5 4 6}]}
209− ~zod/try=> (~(put ju s) 'c' 7)
210− {[p='a' q={1 3 2}] [p='c' q={7}] [p='b' q={5 4 6}]}
211−
212−------------------------------------------------------------------------
213−
214−### `++by`
215−
216−Map operations
217−
218− ++ by :: map engine
219− ~/ %by
220− |/ a=(map)
221−
222−Container arm for map operation arms. A map is a set of key, value
223−pairs. The contained arms inherit it's [sample]() [map](), `a`.
224−
225−`a` is a [map]().
226−
227− ~zod/try=> ~(. by (mo (limo [%a 1] [%b 2] ~)))
228− <19.irb [nlr([p={%a %b} q=@ud]) <414.rvm 101.jzo 1.ypj %164>]>
229−
docs/system/hoon/library/core/jo.mddeleted−948
@@ -1,948 +0,0 @@
1−
2−### `++jo`
3−
4−JSON reparsing core
5−
6−Contains converters of [`++json`]() to [`++unit`]()s of well-typed structures.
7−
8−Accepts
9−-------
10−
11−A `fist` is a gate that produces a `grub`.
12−
13−A `grub` is a unit of some JSON value.
14−
15−Source
16−------
17−
18− ++ jo :: json reparser
19− => |% ++ grub (unit ,*)
20− ++ fist $+(json grub)
21− |%
22−
23−
24−### `++ar`
25−
26−Parse array to list
27−
28−Reparser modifier. Reparses an array to the [`++unit`]() of a homogenous
29−[`++list`]() using `wit` to reparse every element.
30−
31−`wit` is a [`++fist`](), a JSON reparser.
32−
33−
34−Accepts
35−-------
36−
37−A [`++fist`]().
38−
39−Produces
40−--------
41−
42−A [`++rule`]().
43−
44−Source
45−------
46− ++ ar :: array as list
47− |* wit=fist
48− |= jon=json
49− ?. ?=([%a *] jon) ~
50− %- zl
51− |-
52− ?~ p.jon ~
53− [i=(wit i.p.jon) t=$(p.jon t.p.jon)]
54− ::
55−
56−Examples
57−--------
58−
59− ~zod/try=> :type; ((ar ni):jo a/~[n/'1' n/'2'])
60− [~ u=~[1 2]]
61− {[%~ u=it(@)] %~}
62−
63−
64−### `++at`
65−
66−Reparse array as tuple
67−
68−Reparser generator. Reparses an array as a fixed-length tuple of
69−[`++unit`]()s, using a list of `++fist`s.
70−
71−Accepts
72−-------
73−
74−`wil` is a [`++pole`](), a [`face`]()less list of [`++fist`]()s.
75−
76−Produces
77−--------
78−
79−A [`++rule`]().
80−
81−Source
82−------
83−
84− ++ at :: array as tuple
85− |* wil=(pole fist)
86− |= jon=json
87− ?. ?=([%a *] jon) ~
88− =+ raw=((at-raw wil) p.jon)
89− ?.((za raw) ~ (some (zp raw)))
90− ::
91−
92−Examples
93−--------
94−
95− ~zod/try=> ((at ni so ni ~):jo a/~[n/'3' s/'to' n/'4'])
96− [~ u=[q=3 ~.to q=4]]
97− ~zod/try=> :type; ((at ni so ni ~):jo a/~[n/'3' s/'to' n/'4'])
98− [~ u=[q=3 ~.to q=4]]
99− {{[%~ u=[q=@ @ta q=@]] %~} %~}
100− ~zod/try=> ((at ni so ni ~):jo a/~[n/'3' s/'to' n/''])
101− ~
102−
103−### `++at-raw`
104−
105−Reparse array to tuple
106−
107−Reparser generator. Reparses a list of [`++json`]() with `wil` to a tuple of [`++unit`]()s.
108−
109−Accepts
110−-------
111−
112−`wil` is a [`++pole`](), a [face]()less list of [`++fist`]()s.
113−
114−Produces
115−--------
116−
117−A [`++rule`]().
118−
119−Source
120−------
121−
122− ++ at-raw :: array as tuple
123− |* wil=(pole fist)
124− |= jol=(list json)
125− ?~ wil ~
126− :- ?~(jol ~ (-.wil i.jol))
127− ((at-raw +.wil) ?~(jol ~ t.jol))
128− ::
129−
130−Examples
131−--------
132−
133− ~zod/try=> ((at-raw ni ni bo ~):jo ~[s/'hi' n/'1' b/&])
134− [~ [~ 1] [~ u=%.y] ~]
135−
136−### `++bo`
137−
138−Reparse boolean
139−
140−Reparser modifier. Reparses a boolean to the [`++unit`]() of a
141−boolean.
142−
143−Accepts
144−-------
145−
146−A [`++json`]().
147−
148−Produces
149−--------
150−
151−A [`++fist`]().
152−
153−Source
154−------
155−
156− ++ bo :: boolean
157− |=(jon=json ?.(?=([%b *] jon) ~ [~ u=p.jon]))
158− ::
159−
160−Examples
161−--------
162−
163− ~zod/try=> (bo:jo [%b &])
164− [~ u=%.y]
165− ~zod/try=> (bo:jo [%b |])
166− [~ u=%.n]
167− ~zod/try=> (bo:jo [%s 'hi'])
168− ~
169−
170−### `++bu`
171−
172−Reparse boolean not
173−
174−Reparser modifier. Reparses the inverse of a boolean to the [`++unit`]()
175−of a loobean.
176−
177−
178−Accepts
179−-------
180−
181−A [`++json`]().
182−
183−Produces
184−--------
185−
186−A [`++fist`]().
187−
188−Source
189−------
190−
191− ++ bu :: boolean not
192− |=(jon=json ?.(?=([%b *] jon) ~ [~ u=!p.jon]))
193− ::
194−
195−Examples
196−--------
197−
198− ~zod/try=> (bu:jo [%b &])
199− [~ u=%.n]
200− ~zod/try=> (bu:jo [%b |])
201− [~ u=%.y]
202− ~zod/try=> (bu:jo [%s 'hi'])
203− ~
204−
205−### `++cu`
206−
207−Reparse and transform
208−
209−Reparser modifier. Reparses `jon` and slams the result through `wit`,
210−producing a [`++unit`]().
211−
212−Accepts
213−-------
214−
215−`wit` is a [`++fist`]().
216−
217−`poq` is a [`gate`]() that accepts and returns a [noun]().
218−
219−Produces
220−--------
221−
222−A [`++fist`]().
223−
224−Source
225−------
226−
227− ++ cu :: transform
228− |* [poq=$+(* *) wit=fist]
229− |= jon=json
230− (bind (wit jon) poq)
231− ::
232−
233−Examples
234−--------
235−
236− ~zod/try=> ((cu dec ni):jo [%n '20'])
237− [~ 19]
238− ~zod/try=> ((cu dec ni):jo [%b &])
239− ~
240−
241−### `++da`
242−
243−Reparse UTC date
244−
245−Reparser modifier. Reparses a UTC date string to a [`++unit`]().
246−
247−Accepts
248−-------
249−
250−`jon` is a [`++json`]().
251−
252−Produces
253−--------
254−
255−A [`++fist`]().
256−
257−Source
258−------
259−
260− ++ da :: UTC date
261− |= jon=json
262− ?. ?=([%s *] jon) ~
263− (bind (stud (trip p.jon)) |=(a=date (year a)))
264− ::
265−
266−Examples
267−--------
268−
269− ~zod/try=> (da:jo [%s 'Wed, 29 Oct 2014 0:26:15 +0000'])
270− [~ ~2014.10.29..00.26.15]
271− ~zod/try=> (da:jo [%s 'Wed, 29 Oct 2012 0:26:15'])
272− [~ ~2012.10.29..00.26.15]
273− ~zod/try=> (da:jo [%n '20'])
274− ~
275−
276−### `++di`
277−
278−Reparse millisecond date
279−
280−Reparser modifier. Reparses the javascript millisecond date integer to a
281−[`++unit`]().
282−
283−Accepts
284−-------
285−
286−`jon` is a [`++json`]().
287−
288−Produces
289−--------
290−
291−A [`++fist`]().
292−
293−Source
294−------
295−
296− ++ di :: millisecond date
297− |= jon=json
298− %+ bind (ni jon)
299− |= a=@u ^- @da
300− (add ~1970.1.1 (div (mul ~s1 a) 1.000))
301− ::
302−
303−Examples
304−--------
305−
306− ~zod/try=> (di:jo [%s '2014-10-29'])
307− ~
308− ~zod/try=> (di:jo [%n '1414545548325'])
309− [~ ~2014.10.29..01.19.08..5333.3333.3333.3333]
310− ~zod/try=> (di:jo [%n '1414545615128'])
311− [~ ~2014.10.29..01.20.15..20c4.9ba5.e353.f7ce]
312− ~zod/try=> (di:jo [%n '25000'])
313− [~ ~1970.1.1..00.00.25]
314−
315−### `++mu`
316−
317−Reparse unit
318−
319−Reparser modifier. Reparses `wit` to a [`++unit`]().
320−
321−JSON units are considered to be either JSON null or the requested
322−value, and are reparsed to results of \~ or (some {value}) respectively.
323−
324−Accepts
325−-------
326−
327−`wit` is a [`++fist`]().
328−
329−Produces
330−--------
331−
332−A [`++fist`]().
333−
334−Source
335−------
336−
337− ++ mu :: true unit
338− |* wit=fist
339− |= jon=json
340− ?~(jon (some ~) (bind (wit jon) some))
341− ::
342−
343−Examples
344−--------
345−
346− ~zod/try=> ((mu ni):jo [%n '20'])
347− [~ [~ u=q=20]]
348− ~zod/try=> ((mu ni):jo [%n '15'])
349− [~ [~ u=q=15]]
350− ~zod/try=> ((mu ni):jo ~)
351− [~ u=~]
352− ~zod/try=> ((mu ni):jo [%s 'ma'])
353− ~
354−
355−### `++ne`
356−
357−Reparse number as real
358−
359−XX Currently unimplemented
360−
361−A- yup, this will eventually reparse a floating point atom, but
362−interfaces for the latter are not currently stable.
363−
364−### `++ni`
365−
366−Reparse number as integer
367−
368−Reparser modifier. Reparses an integer representation to a [`++unit]().
369−
370−Accepts
371−-------
372−
373−`jon` is a ++[`++json`]().
374−
375−Produces
376−--------
377−
378−The `++unit` of an atom.
379−
380−Source
381−------
382−
383− ++ ni :: number as integer
384− |= jon=json
385− ?. ?=([%n *] jon) ~
386− (rush p.jon dem)
387− ::
388−
389−Examples
390−--------
391−
392− ~zod/try=> (ni:jo [%n '0'])
393− [~ q=0]
394− ~zod/try=> (ni:jo [%n '200'])
395− [~ q=200]
396− ~zod/try=> (ni:jo [%n '-2.5'])
397− ~
398− ~zod/try=> (ni:jo [%s '10'])
399− ~
400− ~zod/try=> (ni:jo [%b |])
401− ~
402− ~zod/try=> (ni:jo [%n '4'])
403− [~ q=4]
404− ~zod/try=> (ni:jo [%a ~[b/& b/& b/& b/&]])
405− ~
406−
407−### `++no`
408−
409−Reparse number as text
410−
411−Reparser modifier. Reparses a numeric representation to a [++cord]().
412−
413−Accepts
414−-------
415−
416−`jon` is a `++json`.
417−
418−Produces
419−--------
420−
421−The [`++unit`]() of a `++cord`.
422−
423−Source
424−------
425−
426− ++ no :: number as text
427− |= jon=json
428− ?. ?=([%n *] jon) ~
429− (some p.jon)
430− ::
431−
432−Examples
433−--------
434−
435− ~zod/try=> (no:jo [%n '0'])
436− [~ u=~.0]
437− ~zod/try=> (no:jo [%n '200'])
438− [~ u=~.200]
439− ~zod/try=> (no:jo [%n '-2.5'])
440− [~ u=~.-2.5]
441− ~zod/try=> (no:jo [%s '10'])
442− ~
443− ~zod/try=> (no:jo [%b |])
444− ~
445− ~zod/try=> (no:jo [%n '4'])
446− [~ u=~.4]
447− ~zod/try=> (no:jo [%a ~[b/& b/& b/& b/&]])
448− ~
449−
450−### `++of`
451−
452−Reparse object to frond
453−
454−Reparser generator. Reparses an object, succeeding if it corresponds to
455−one of the key-value pairs in `wer`.
456−
457−Accepts
458−-------
459−
460−`wer` is a [`++pole`](), a [`++face`]()less list of [`++cord`]() and
461−[`++fist`]() key-value pairs.
462−
463−Produces
464−--------
465−
466−The [`++unit`]() of a cell of a.....
467−
468−Source
469−------
470−
471− ++ of :: object as frond
472− |* wer=(pole ,[cord fist])
473− |= jon=json
474− ?. ?=([%o [@ *] ~ ~] jon) ~
475− |-
476− ?~ wer ~
477− ?: =(-.-.wer p.n.p.jon)
478− ((pe -.-.wer +.-.wer) q.n.p.jon)
479− ((of +.wer) jon)
480− ::
481−
482−Examples
483−--------
484−
485− ~zod/try=> ((of sem/sa som/ni ~):jo %o [%sem s/'hi'] ~ ~)
486− [~ [%sem "hi"]]
487− ~zod/try=> ((of sem/sa som/ni ~):jo %o [%som n/'20'] ~ ~)
488− [~ [%som q=20]]
489− ~zod/try=> ((of sem/sa som/ni ~):jo %o [%som s/'he'] ~ ~)
490− ~
491− ~zod/try=> ((of sem/sa som/ni ~):jo %o [%som s/'5'] ~ ~)
492− ~
493− ~zod/try=> ((of sem/sa som/ni ~):jo %o [%sem s/'5'] ~ ~)
494− [~ [%sem "5"]]
495− ~zod/try=> ((of sem/sa som/ni ~):jo %o [%sem n/'2'] ~ ~)
496− ~
497− ~zod/try=> ((of sem/sa som/ni ~):jo %o [%sem b/&] ~ ~)
498− ~
499− ~zod/try=> ((of sem/sa som/ni ~):jo %a ~[s/'som' n/'4'])
500− ~
501− ~zod/try=> ((of sem/sa som/ni ~):jo %o [%sem s/'hey'] ~ [%sam s/'other value'] ~ ~)
502− ~
503−
504−### `++ot`
505−
506−Reparse object as tuple
507−
508−Reparser generator. For every key in `wer` that matches a key in the
509−[`++edge`], the fist in `wer` is applied to the corresponding value in
510−the [`++edge`](), the results of which are produced in a tuple.
511−
512−
513−Accepts
514−-------
515−
516−`wer` is a [`++pole`]() of [`++cord`]() to [`++fist`]() key-value pairs.
517−
518−Produces
519−--------
520−
521−A [`++unit`]() of a tuple XX?
522−
523−Source
524−------
525−
526− ++ ot :: object as tuple
527− |* wer=(pole ,[cord fist])
528− |= jon=json
529− ?. ?=([%o *] jon) ~
530− =+ raw=((ot-raw wer) p.jon)
531− ?.((za raw) ~ (some (zp raw)))
532− ::
533−
534−Examples
535−--------
536−
537− ~zod/try=> (jobe [%sem s/'ha'] [%som n/'20'] ~)
538− [%o p={[p='sem' q=[%s p=~.ha]] [p='som' q=[%n p=~.20]]}]
539− ~zod/try=> ((ot sem/sa som/ni sem/sa ~):jo (jobe [%sem s/'ha'] [%som n/'20'] ~))
540− [~ u=["ha" q=20 "ha"]]
541−
542−### `++ot-raw`
543−
544−Reparser generator. Reparses a map `jom` using `wer`; for every key in
545−`wer` that matches a key in `map`, the corresponding `++fist` is applied
546−to the corresponding value in `jom`, the results of which are produced
547−in a tuple.
548−
549−
550−Accepts
551−-------
552−
553−`wer` is a [`++pole`]() of [`++cord`]() to [`++fist`]() key-value pairs.
554−
555−Produces
556−--------
557−
558−A [`++unit`]() of.
559−
560−Source
561−------
562−
563− ++ ot-raw :: object as tuple
564− |* wer=(pole ,[cord fist])
565− |= jom=(map ,@t json)
566− ?~ wer ~
567− =+ ten=(~(get by jom) -.-.wer)
568− [?~(ten ~ (+.-.wer u.ten)) ((ot-raw +.wer) jom)]
569− ::
570−
571−Examples
572−--------
573−
574− ~zod/try=> ((ot-raw sem/sa som/ni sem/sa ~):jo (mo [%sem s/'ha'] [%som n/'20'] ~))
575− [[~ u="ha"] [~ q=20] [~ u="ha"] ~]
576− ~zod/try=> ((ot-raw sem/sa som/ni sem/sa ~):jo (mo [%sem s/'ha'] [%som b/|] ~))
577− [[~ u="ha"] ~ [~ u="ha"] ~]
578−
579−### `++om`
580−
581−Parse object to map
582−
583−Reparser modifier. Reparses a [`++json`]() object to a homogenous map
584−using `wit`.
585−
586−Accepts
587−-------
588−
589−`wit` is a [`++fist`]().
590−
591−Produces
592−--------
593−
594−A [`++unit`]() of...
595−
596−Source
597−------
598−
599− ++ om :: object as map
600− |* wit=fist
601− |= jon=json
602− ?. ?=([%o *] jon) ~
603− (zm ~(run by p.jon) wit)
604− ::
605−
606−Examples
607−--------
608−
609− ~zod/try=> ((om ni):jo (jobe [%sap n/'20'] [%sup n/'5'] [%sop n/'177'] ~))
610− [~ {[p='sup' q=q=5] [p='sop' q=q=177] [p='sap' q=q=20]}]
611− ~zod/try=> ((om ni):jo (jobe [%sap n/'20'] [%sup n/'0x5'] [%sop n/'177'] ~))
612− ~
613−
614−### `++pe`
615−
616−Add prefix
617−
618−Reparser modifier. Adds a static prefix `pre` to the parse result of
619−`wit`. See also: [`++stag`]().
620−
621−Accepts
622−-------
623−
624−`pre` is a prefix [`noun`]().
625−
626−Produces
627−--------
628−
629−The [`++unit`]() of a cell of [noun]() and the result of parsing `wit`.
630−
631−Source
632−------
633−
634− ++ pe :: prefix
635− |* [pre=* wit=fist]
636− (cu |*(a=* [pre a]) wit)
637− ::
638−
639−Examples
640−--------
641−
642− ~zod/try=> (ni:jo n/'2')
643− [~ q=2]
644− ~zod/try=> (ni:jo b/|)
645− ~
646− ~zod/try=> ((pe %hi ni):jo n/'2')
647− [~ [%hi q=2]]
648− ~zod/try=> ((pe %hi ni):jo b/|)
649− ~
650−
651−### `++sa`
652−
653−Reparse string to tape
654−
655−Reparser modifier. Reparses a [`++json`]() string to a [`++tape`]().
656−
657−Accepts
658−-------
659−
660−`jon` is a [`++json`]().
661−
662−Produces
663−--------
664−
665−The [`++unit`]() of a [`++tape`]().
666−
667−Source
668−------
669−
670− ++ sa :: string as tape
671− |= jon=json
672− ?.(?=([%s *] jon) ~ (some (trip p.jon)))
673− ::
674−
675−Examples
676−--------
677−
678− ~zod/try=> (sa:jo s/'value')
679− [~ u="value"]
680− ~zod/try=> (sa:jo n/'46')
681− ~
682− ~zod/try=> (sa:jo a/~[s/'val 2'])
683− ~
684−
685−### `++so`
686−
687−Reparse string to cord
688−
689−Reparser modifier. Reparses a string to a [`++cord`]().
690−
691−Accepts
692−-------
693−
694−`jon` is a [`++json`]().
695−
696−Produces
697−--------
698−
699−The [`++unit`]() of a [`++cord`]().
700−
701−Source
702−------
703−
704− ++ so :: string as cord
705− |= jon=json
706− ?.(?=([%s *] jon) ~ (some p.jon))
707− ::
708−
709−Examples
710−--------
711−
712− ~zod/try=> (so:jo s/'value')
713− [~ u=~.value]
714− ~zod/try=> (so:jo n/'46')
715− ~
716− ~zod/try=> (so:jo a/~[s/'val 2'])
717− ~
718−
719−### `++su`
720−
721−Reparse string
722−
723−Reparser generator. Produces a reparser that applies `sab` to a string.
724−
725−Accepts
726−-------
727−
728−`sab` is a [`++rule`].
729−
730−Produces
731−--------
732−
733−A [`++rule`]().
734−
735−Source
736−------
737−
738− ++ su :: parse string
739− |* sab=rule
740− |= jon=json
741− ?. ?=([%s *] jon) ~
742− (rush p.jon sab)
743− ::
744−
745−Examples
746−--------
747−
748− ~zod/try=> ((su:jo fed:ag) s/'zod')
749− [~ 0]
750− ~zod/try=> ((su:jo fed:ag) s/'doznec')
751− [~ 256]
752− ~zod/try=> ((su:jo fed:ag) s/'notship')
753− ~
754− ~zod/try=> ((su:jo fed:ag) n/'20')
755− ~
756−
757−### `++ul`
758−
759−Reparse null
760−
761−Reparser modifier. Reparses a null value.
762−
763−Accepts
764−-------
765−
766−`jon` is a [`++json`]().
767−
768−Produces
769−--------
770−
771−The [`++unit`]() of null.
772−
773−Source
774−------
775−
776− ++ ul |=(jon=json ?~(jon (some ~) ~)) :: null
777−
778−Examples
779−--------
780−
781− ~zod/try=> (ul:jo `json`~)
782− [~ u=~]
783− ~zod/try=> (ul:jo s/'null')
784− ~
785− ~zod/try=> (ul:jo b/|)
786− ~
787− ~zod/try=> (ul:jo b/&)
788− ~
789−
790−### `++za`
791−
792−Pole of nonempty units
793−
794−Determines if `pod` contains all non-empty units, producing a boolean. Used
795−internally.
796−
797−Accepts
798−-------
799−
800−`pod` is a [`++pole`]() of [`++unit`]().
801−
802−Produces
803−--------
804−
805−A boolean.
806−
807−Source
808−------
809−
810− ++ za :: full unit pole
811− |* pod=(pole (unit))
812− ?~ pod &
813− ?~ -.pod |
814− (za +.pod)
815− ::
816−
817−Examples
818−--------
819−
820− ~zod/try=> (za:jo ~[`1 `2 `3])
821− %.y
822− ~zod/try=> (za:jo ~[`1 ~ `3])
823− %.n
824−
825−### `++zl`
826−
827−Collapse unit list
828−
829−Produces a unit of the values of `lut` if every unit in `lut` is
830−nonempty. Otherwise, produces `~`.
831−
832−Accepts
833−-------
834−
835−`lut` is a [`++list`]() of [`++unit`]()s.
836−
837−Produces
838−--------
839−
840−A boolean.
841−
842−Source
843−------
844−
845− ++ zl :: collapse unit list
846− |* lut=(list (unit))
847− ?. |- ^- ?
848− ?~(lut & ?~(i.lut | $(lut t.lut)))
849− ~
850− %- some
851− |-
852− ?~ lut ~
853− [i=u:+.i.lut t=$(lut t.lut)]
854− ::
855−
856−Examples
857−--------
858−
859− ~zod/try=> (zl:jo `(list (unit))`~[`1 `2 `3])
860− [~ u=~[1 2 3]]
861− ~zod/try=> (zl:jo `(list (unit))`~[`1 `17 `3])
862− [~ u=~[1 17 3]]
863− ~zod/try=> (zl:jo `(list (unit))`~[`1 ~ `3])
864− ~
865−
866−### `++zp`
867−
868−XX
869−
870−Collapses a `++pole` of `++unit`s `but`, producing a tuple.
871−
872−Accepts
873−-------
874−
875−`but` is a [`++pole`]() of [`++unit`]().
876−
877−Produces
878−--------
879−
880−??
881−
882−Source
883−------
884−
885− ++ zp :: unit tuple
886− |* but=(pole (unit))
887− ?~ but !!
888− ?~ +.but
889− u:->.but
890− [u:->.but (zp +.but)]
891− ::
892−
893−Examples
894−--------
895−
896− ~zod/try=> (zp:jo `(pole (unit))`~[`1 `2 `3])
897− [1 2 3]
898− ~zod/try=> (zp:jo `(pole (unit))`~[`1 `17 `3])
899− [1 17 3]
900− ~zod/try=> (zp:jo `(pole (unit))`~[`1 ~ `3])
901− ! exit
902−
903−### `++zm`
904−
905−Collapse unit map
906−
907−Produces a [`++unit`]() of the [`++map`]() `lum` of term to `++unit` key value
908−pairs, with all of the nonempty values stripped of their `++unit`
909−wrappers. If any of the `++units` in `lum` are empty, `~` is produced.
910−See also: [`++zp`](), [`++zl`]().
911−
912−Accepts
913−-------
914−
915−`lum` is a map of [`++term`]() to [`++unit`]()s.
916−
917−Produces
918−--------
919−
920−The `++unit` of a tuple of what were the key-value pairs of `lum`.
921−
922−Source
923−------
924−
925− ++ zm :: collapse unit map
926− |* lum=(map term (unit))
927− ?: (~(rep by lum) | |=([[@ a=(unit)] b=?] |(b ?=(~ a))))
928− ~
929− (some (~(run by lum) need))
930− ::
931−
932−Examples
933−--------
934−
935− ~zod/try=> (zm:jo `(map term (unit ,@u))`(mo a/`4 b/`1 c/`2 ~))
936− [~ {[p=%a q=4] [p=%c q=2] [p=%b q=1]}]
937− ~zod/try=> (zm:jo `(map term (unit ,@u))`(mo a/`4 b/~ c/`2 ~))
938− ~
939− ~zod/try=> (~(run by `(map ,@t ,@u)`(mo a/1 b/2 c/3 ~)) (flit |=(a=@ (lth a 5))))
940− {[p='a' q=[~ u=1]] [p='c' q=[~ u=3]] [p='b' q=[~ u=2]]}
941− ~zod/try=> (zm:jo (~(run by `(map ,@t ,@u)`(mo a/1 b/2 c/3 ~)) (flit |=(a=@ (lth a 5)))))
942− [~ {[p='a' q=1] [p='c' q=3] [p='b' q=2]}]
943− ~zod/try=> (zm:jo (~(run by `(map ,@t ,@u)`(mo a/1 b/7 c/3 ~)) (flit |=(a=@ (lth a 5)))))
944− ~
945− ~zod/try=> (~(run by `(map ,@t ,@u)`(mo a/1 b/7 c/3 ~)) (flit |=(a=@ (lth a 5))))
946− {[p='a' q=[~ u=1]] [p='c' q=[~ u=3]] [p='b' q=~]}
947−
948−
docs/system/hoon/library/core/map.mddeleted−551
@@ -1,551 +0,0 @@
1−### `+-all:by`
2−
3−Logical AND
4−
5− +- all :: logical AND
6− ~/ %all
7− |* b=$+(* ?)
8− |- ^- ?
9− ?~ a
10− &
11− ?&((b q.n.a) $(a l.a) $(a r.a))
12−
13−Computes the logical AND on the results of slamming every element in map
14−`a` with gate `b`. Produces a loobean.
15−
16−`a` is a [map]().
17−
18−`b` is a [wet gate]().
19−
20− ~zod/try=> =b (mo `(list ,[@t *])`[['a' 1] ['b' [2 3]] ~])
21− ~zod/try=> (~(all by b) |=(a=* ?@(a & |)))
22− %.n
23− ~zod/try=> =a (mo `(list ,[@t @u])`[['a' 1] ['b' 2] ['c' 3] ['d' 4] ['e' 5] ~])
24− ~zod/try=> (~(all by a) |=(a=@ (lte a 6)))
25− %.y
26− ~zod/try=> (~(all by a) |=(a=@ (lte a 4)))
27− %.n
28−
29−------------------------------------------------------------------------
30−
31−### `+-any:by`
32−
33−Logical OR
34−
35− +- any :: logical OR
36− ~/ %any
37− |* b=$+(* ?)
38− |- ^- ?
39− ?~ a
40− |
41− ?|((b q.n.a) $(a l.a) $(a r.a))
42−
43−Computes the logical OR on the results of slamming every element with
44−gate `b`. Produces a loobean.
45−
46−`a` is a [map]().
47−
48−`b` is a [wet gate]().
49−
50− ~zod/try=> =b (mo `(list ,[@t *])`[['a' 1] ['b' [2 3]] ~])
51− ~zod/try=> (~(all by b) |=(a=* ?@(a & |)))
52− %.y
53− ~zod/try=> =a (mo `(list ,[@t @u])`[['a' 1] ['b' 2] ['c' 3] ['d' 4] ['e' 5] ~])
54− ~zod/try=> (~(any by a) |=(a=@ (lte a 4)))
55− %.y
56−
57−------------------------------------------------------------------------
58−
59−### `+-del:by`
60−
61−Delete
62−
63− +- del :: delete at key b
64− ~/ %del
65− |* b=*
66− |- ^+ a
67− ?~ a
68− ~
69− ?. =(b p.n.a)
70− ?: (gor b p.n.a)
71− [n.a $(a l.a) r.a]
72− [n.a l.a $(a r.a)]
73− |- ^- ?(~ _a)
74− ?~ l.a r.a
75− ?~ r.a l.a
76− ?: (vor p.n.l.a p.n.r.a)
77− [n.l.a l.l.a $(l.a r.l.a)]
78− [n.r.a $(r.a l.r.a) r.r.a]
79−
80−Produces map `a` with the element located at key `b` removed.
81−
82−`a` is a [map]().
83−
84−`b` is a key as a [noun]().
85−
86− ~zod/try=> =b (mo `(list ,[@t *])`[['a' 1] ['b' [2 3]] ~])
87− ~zod/try=> (~(del by b) `a`)
88− {[p=`b` q=[2 3]]}
89−
90−------------------------------------------------------------------------
91−
92−### `+-dig:by`
93−
94−Axis of key
95−
96− +- dig :: axis of key
97− |= b=*
98− =+ c=1
99− |- ^- (unit ,@)
100− ?~ a ~
101− ?: =(b p.n.a) [~ u=(peg c 2)]
102− ?: (gor b p.n.a)
103− $(a l.a, c (peg c 6))
104− $(a r.a, c (peg c 7))
105−
106−Produce the axis of key `b` within map `a`.
107−
108−`a` is a [map]().
109−
110−`b` is a key as a [noun]().
111−
112− ~zod/try=> =b (mo `(list ,[@t *])`[['a' 1] ['b' [2 3]] ~])
113− ~zod/try=> (~(dig by b) `b`)
114− [~ 2]
115−
116−------------------------------------------------------------------------
117−
118−### `+-gas:by`
119−
120−Concatenate
121−
122− +- gas :: concatenate
123− ~/ %gas
124− |* b=(list ,[p=* q=*])
125− => .(b `(list ,_?>(?=(^ a) n.a))`b)
126− |- ^+ a
127− ?~ b
128− a
129− $(b t.b, a (put(+< a) p.i.b q.i.b))
130−
131−Insert a list of key-value pairs `b` into map `a`.
132−
133−`a` is a [map]().
134−
135−`b` is a [list]() of [cells]() of key-value nouns `p` and `q`.
136−
137− ~zod/try=> =a (mo `(list ,[@t *])`[[`a` 1] [`b` 2] ~])
138− ~zod/try=> =b `(list ,[@t *])`[[`c` 3] [`d` 4] ~]
139− ~zod/try=> (~(gas by a) b)
140− {[p=`d` q=4] [p=`a` q=1] [p=`c` q=3] [p=`b` q=2]}
141−
142−------------------------------------------------------------------------
143−
144−### `+-get:by`
145−
146−Grab unit value
147−
148− +- get :: unit value by key
149− ~/ %get
150− |* b=*
151− |- ^- ?(~ [~ u=_?>(?=(^ a) q.n.a)])
152− ?~ a
153− ~
154− ?: =(b p.n.a)
155− [~ u=q.n.a]
156− ?: (gor b p.n.a)
157− $(a l.a)
158− $(a r.a)
159−
160−Produce the unit value of the value located at key `b` within map `a`.
161−
162−`a` is a [map]()
163−
164−`b` is a [key]() as a [noun]()
165−
166− ~zod/try=> =b (mo `(list ,[@t *])`[['a' 1] ['b' [2 3]] ~])
167− ~zod/try=> (~(get by b) `b`)
168− [~ [2 3]]
169−
170−------------------------------------------------------------------------
171−
172−### `+-got:by`
173−
174−Assert
175−
176− +- got
177− |* b=*
178− %- need
179− %- get(+< a) b
180−
181−Produce the value located at key `b` within map `a`. Crash if key `b`
182−does not exist.
183−
184−`a` is a [map]().
185−
186−`b` is a [key]().
187−
188− ~zod/try=> =m (mo `(list ,[@t *])`[['a' 1] ['b' 2] ~])
189− ~zod/try=> m
190− {[p='a' q=1] [p='b' q=2]}
191− ~zod/try=> (~(get by m) 'a')
192− [~ 1]
193− ~zod/try=> (~(got by m) 'a')
194− 1
195− ~zod/try=> (~(got by m) 'c')
196− ! exit
197−
198−------------------------------------------------------------------------
199−
200−### `+-has:by`
201−
202−Key existence check
203−
204− +- has :: key existence check
205− ~/ %has
206− |* b=*
207− !=(~ (get(+< a) b))
208−
209−Checks whether map `a` contains an element with key `b`, producing a
210−loobean.
211−
212−`a` is a [map]().
213−
214−`b` is a key as a [noun]().
215−
216− ~zod/try=> =b (mo `(list ,[@t *])`[['a' 1] ['b' [2 3]] ~])
217− ~zod/try=> (~(has by b) `b`)
218− %.y
219− ~zod/try=> (~(has by b) `c`)
220− %.n
221−
222−------------------------------------------------------------------------
223−
224−### `+-int:by`
225−
226−Intersection
227−
228− +- int :: intersection
229− ~/ %int
230− |* b=_a
231− |- ^+ a
232− ?~ b
233− ~
234− ?~ a
235− ~
236− ?: (vor p.n.a p.n.b)
237− ?: =(p.n.b p.n.a)
238− [n.b $(a l.a, b l.b) $(a r.a, b r.b)]
239− ?: (hor p.n.b p.n.a)
240− %- uni(+< $(a l.a, b [n.b l.b ~])) $(b r.b)
241− %- uni(+< $(a r.a, b [n.b ~ r.b])) $(b l.b)
242− ?: =(p.n.a p.n.b)
243− [n.b $(b l.b, a l.a) $(b r.b, a r.a)]
244− ?: (hor p.n.a p.n.b)
245− %- uni(+< $(b l.b, a [n.a l.a ~])) $(a r.a)
246− %- uni(+< $(b r.b, a [n.a ~ r.a])) $(a l.a)
247−
248−Produces a map of the (key) intersection between two maps of the same
249−type, `a` and `b`. If both maps have an identical key that point to
250−different values, the element from map `b` is used.
251−
252−`a` is a [map]().
253−
254−`b` is a [map]().
255−
256− ~zod/try=> =n (mo `(list ,[@t *])`[['a' 1] ['c' 3] ~])
257− ~zod/try=> n
258− {[p='a' q=1] [p='c' q=3]}
259− ~zod/try=> m
260− {[p='a' q=1] [p='b' q=2]}
261− ~zod/try=> (~(int by m) n)
262− {[p='a' q=1]}
263− ~ravpel-holber/try=> =p (mo `(list ,[@t *])`[['a' 2] ['b' 2] ~])
264− ~zod/try=> p
265− {[p='a' q=2] [p='b' q=2]}
266− ~zod/try=> (~(int by p) n)
267− {[p='a' q=2]}
268− ~zod/try=> =q (mo `(list ,[@t *])`[['a' 2] ['c' 2] ~])
269− ~zod/try=> q
270− {[p='a' q=2] [p='b' q=2]}
271− ~zod/try=> (~(int by p) q)
272− {[p='a' q=2] [p='b' q=2]}
273− ~zod/try=> =o (mo `(list ,[@t *])`[['c' 3] ['d' 4] ~])
274− ~zod/try=> (~(int by m) o)
275− {}
276−
277−
278−------------------------------------------------------------------------
279−
280−### `+-mar:by`
281−
282−Assert and Add
283−
284− +- mar :: add with validation
285− |* [b=_?>(?=(^ a) p.n.a) c=(unit ,_?>(?=(^ a) q.n.a))]
286− ?~ c
287− (del b)
288− (put b u.c)
289−
290−Produces map `a` with the addition of a key-value pair, where the value
291−is a nonempty unit.
292−
293−Accept a noun and a unit of a noun of the type of the map's keys and
294−values, respectively. Validate that the value is not null and put the
295−pair in the map. If the value is null, delete the key.
296−
297−XX This arm is broken, asana task 15186618346453
298−
299− ~zod/try=> m
300− {[p='a' q=1] [p='b' q=2]}
301− ~zod/try=> (~(mar by m) 'c' (some 3))
302− ! -find-limb.n
303− ! find-none
304− ! exit
305− ~zod/try=> (~(mar by m) 'c' ~)
306− ! -find-limb.n
307− ! find-none
308− ! exit
309− ~zod/try=> (~(mar by m) 'b' ~)
310− ! -find-limb.n
311− ! find-none
312− ! exit
313−
314−------------------------------------------------------------------------
315−
316−### `+-put:by`
317−
318−Add key-value pair
319−
320− +- put :: adds key-value pair
321− ~/ %put
322− |* [b=* c=*]
323− |- ^+ a
324− ?~ a
325− [[b c] ~ ~]
326− ?: =(b p.n.a)
327− ?: =(c q.n.a)
328− a
329− [[b c] l.a r.a]
330− ?: (gor b p.n.a)
331− =+ d=$(a l.a)
332− ?> ?=(^ d)
333− ?: (vor p.n.a p.n.d)
334− [n.a d r.a]
335− [n.d l.d [n.a r.d r.a]]
336− =+ d=$(a r.a)
337− ?> ?=(^ d)
338− ?: (vor p.n.a p.n.d)
339− [n.a l.a d]
340− [n.d [n.a l.a l.d] r.d]
341−
342−Produces `a` with the addition of the key-value pair of `b` and `c`.
343−
344−`a` is a [map]().
345−
346−`b` is a key of the same type as the keys in `a`.
347−
348−`c` is a value of the same type of the values in `a`.
349−
350− ~zod/try=> m
351− {[p='a' q=1] [p='b' q=2]}
352− ~zod/try=> (~(put by m) 'c' 3)
353− {[p='a' q=1] [p='c' q=3] [p='b' q=2]}
354− ~zod/try=> (~(put by m) "zod" 26)
355− ! type-fail
356− ! exit
357− ~zod/try=> (~(put by m) 'a' 2)
358− {[p='a' q=2] [p='b' q=2]}
359−
360−------------------------------------------------------------------------
361−
362−### `+-rep:by`
363−
364− +- rep :: replace by product
365− |* [b=* c=_,*]
366− |-
367− ?~ a b
368− $(a r.a, b $(a l.a, b (c q.n.a b)))
369−
370−Accumulate using gate from values in map
371−
372−XX interface changing.
373−
374−------------------------------------------------------------------------
375−
376−### `+-rib:by`
377−
378− +- rib :: transform + product
379− |* [b=* c=_,*]
380− |- ^+ [b a]
381− ?~ a [b ~]
382− =+ d=(c n.a b)
383− =. n.a +.d
384− =+ e=$(a l.a, b -.d)
385− =+ f=$(a r.a, b -.e)
386− [-.f [n.a +.e +.f]]
387−
388−Replace values with accumulator
389−
390−XX interface changing, possibly disappearing
391−
392−------------------------------------------------------------------------
393−
394−### `+-run:by`
395−
396−Transform values
397−
398− +- run :: turns to tuples
399− |* b=_,*
400− |-
401− ?~ a a
402− a(n (b q.n.a), l $(a l.a), r $(a r.a))
403−
404−Iterates over every value in set `a` using gate `b`. Produces a map.
405−
406−`a` is a [map]().
407−
408−`b` is a [wet gate]().
409−
410− ~zod/try=> m
411− {[p='a' q=1] [p='b' q=2]}
412− ~zod/try=> ^+(m (~(run by m) dec))
413− {[p='a' q=0] [p='b' q=1]}
414− ~zod/try=> `(map ,@tas ,@t)`(~(run by m) (cury scot %ux))
415− {[p=%a q='0x1'] [p=%b q='0x2']}
416−
417−------------------------------------------------------------------------
418−
419−### `+-tap:by`
420−
421−Listify pairs
422−
423− +- tap :: listify pairs
424− ~/ %tap
425− |= b=(list ,_?>(?=(^ a) n.a))
426− ^+ b
427− ?~ a
428− b
429− $(a r.a, b [n.a $(a l.a)])
430−
431−Produces the list of all elements in map `a` that is prepended to list
432−`b`, which is empty by default.
433−
434−`a` is a [map]().
435−
436−`b` is a [list]().
437−
438− {[p='a' q=1] [p='b' q=2]}
439− ~zod/try=> `*`m
440− [[98 2] [[97 1] 0 0] 0]
441− ~zod/try=> (~(tap by m))
442− ~[[p='b' q=2] [p='a' q=1]]
443− ~zod/try=> `*`(~(tap by m))
444− [[98 2] [97 1] 0]
445−
446−------------------------------------------------------------------------
447−
448−### `+-uni:by`
449−
450−Union
451−
452− +- uni :: union, merge
453− ~/ %uni
454− |* b=_a
455− |- ^+ a
456− ?~ b
457− a
458− ?~ a
459− b
460− ?: (vor p.n.a p.n.b)
461− ?: =(p.n.b p.n.a)
462− [n.b $(a l.a, b l.b) $(a r.a, b r.b)]
463− ?: (hor p.n.b p.n.a)
464− $(a [n.a $(a l.a, b [n.b l.b ~]) r.a], b r.b)
465− $(a [n.a l.a $(a r.a, b [n.b ~ r.b])], b l.b)
466− ?: =(p.n.a p.n.b)
467− [n.b $(b l.b, a l.a) $(b r.b, a r.a)]
468− ?: (hor p.n.a p.n.b)
469− $(b [n.b $(b l.b, a [n.a l.a ~]) r.b], a r.a)
470− $(b [n.b l.b $(b r.b, a [n.a ~ r.a])], a l.a)
471−
472−Produces a map of the union between the keys of `a` and `b`. If `b`
473−shares a key with `a`, the tuple from `a` is preserved.
474−
475−`a` is a [map]().
476−
477−`b` is a [map]().
478−
479− ~zod/try=> m
480− {[p='a' q=1] [p='b' q=2]}
481− ~zod/try=> o
482− {[p='d' q=4] [p='c' q=3]}
483− ~zod/try=> (~(uni by m) o)
484− {[p='d' q=4] [p='a' q=1] [p='c' q=3] [p='b' q=2]}
485− ~zod/try=> (~(uni by m) ~)
486− {[p='a' q=1] [p='b' q=2]}
487− ~zod/try=> n
488− {[p='a' q=1] [p='c' q=9]}
489− ~zod/try=> (~(uni by o) n)
490− {[p='d' q=4] [p='a' q=1] [p='c' q=3]}
491− ~zod/try=> =n (mo `(list ,[@t *])`[['a' 1] ['c' 9] ~])
492− ~zod/try=> n
493− {[p='a' q=1] [p='c' q=9]}
494− ~zod/try=> (~(uni by o) n)
495− {[p='d' q=4] [p='a' q=1] [p='c' q=9]}
496−
497−------------------------------------------------------------------------
498−
499−### `+-urn:by`
500−
501−Turn (with key)
502−
503− +- urn :: turn
504− |* b=$+([* *] *)
505− |-
506− ?~ a ~
507− [n=[p=p.n.a q=(b p.n.a q.n.a)] l=$(a l.a) r=$(a r.a)]
508−
509−Iterates over every value in map `a` using gate `b`, which accepts both
510−the key and the value of each element as its sample.
511−
512−`a` is a [map]().
513−
514−`b` is a [wet gate]() that accepts two nouns (a key and a value) and
515−produces a noun (the new value).
516−
517− ~zod/try=> m
518− {[p='a' q=1] [p='b' q=2]}
519− ~zod/try=> (~(urn by m) |=(a=[p=* q=*] q.a))
520− {[p='a' q=1] [p='b' q=2]}
521− ~zod/try=> (~(urn by m) |=(a=[p=* q=*] 7))
522− {[p='a' q=7] [p='b' q=7]}
523− ~zod/try=> (~(urn by m) |=(a=[p=* q=*] p.a))
524− {[p='a' q=97] [p='b' q=98]}
525−
526−------------------------------------------------------------------------
527−
528−### `+-wyt:by`
529−
530−Depth
531−
532− +- wyt :: depth of map
533− |- ^- @
534− ?~(a 0 +((add $(a l.a) $(a r.a))))
535−
536−Produce the depth of the tree map `a`.
537−
538−`a` is a [map]().
539−
540− ~zod/try=> m
541− {[p='a' q=1] [p='b' q=2]}
542− ~zod/try=> o
543− {[p='d' q=4] [p='c' q=3]}
544− ~zod/try=> ~(wyt by m)
545− 2
546− ~zod/try=> ~(wyt by o)
547− 2
548− ~zod/try=> ~(wyt by (~(uni by m) o))
549− 4
550−
551−
docs/system/hoon/library/core/mu.mddeleted−124
@@ -1,124 +0,0 @@
1−### `++mu`
2−
3−Core used to scramble 16-bit atoms
4−
5−A [door]() that contains arms that are used to scramble two atoms, `top`
6−and `bot`. Used especially in the phonetic base to disguise the
7−relationship between a destroyer and its cruiser.
8−
9−Accepts
10−-------
11−
12−Produces
13−--------
14−
15−`bot` is an [atom]().
16−
17−`top` is an [atom]().
18−
19−Source
20−------
21−
22− ++ mu
23− |_ [top=@ bot=@]
24−
25−Examples
26−--------
27−
28− ~zod/try=> ~(. mu 0x20e5 0x5901)
29− <3.sjm [[@ux @ux] <414.hhh 100.xkc 1.ypj %164>]>
30−
31−------------------------------------------------------------------------
32−
33−### `++zag`
34−
35−Add bottom into top
36−
37−Produces the cell of `top` and `bot` with `top` scrambled to the result
38−of adding `bot` to `top` modulo 16. Used to scramble the name of a
39−destroyer.
40−
41−Accepts
42−-------
43−
44−Produces
45−--------
46−
47−`bot` is an [atom]().
48−
49−`top` is an [atom]().
50−
51−Source
52−------
53−
54− ++ zag [p=(end 4 1 (add top bot)) q=bot]
55−
56−Examples
57−--------
58−
59− ~zod/try=> `[@ux @ux]`~(zag mu 0x20e0 0x201)
60− [0x22e1 0x201]
61−
62−------------------------------------------------------------------------
63−
64−### `++zig`
65−
66−Subtract bottom from top
67−
68−The inverse of [`++zag`](). Produces the cell of `top` and `bot` with
69−`top` unscrambled. The unscrambled `top` is the sum of the sample `top`
70−and the 16-bit complement of `bot`. Used to unscramble the name of the
71−destroyer.
72−
73−Accepts
74−-------
75−
76−Produces
77−--------
78−
79−`bot` is an [atom]().
80−
81−`top` is an [atom]().
82−
83−Source
84−------
85−
86− ++ zig [p=(end 4 1 (add top (sub 0x1.0000 bot))) q=bot]
87−
88−Examples
89−--------
90−
91− ~zod/try=> `[@ux @ux]`~(zig mu 0x2f46 0x1042)
92− [0x1f04 0x1042]
93−
94−------------------------------------------------------------------------
95−
96−### `++zug`
97−
98−Concatenate into atom
99−
100−Produces the concatenation of `top` and `bot`. Used to assemble a
101−destroyer name.
102−
103−Accepts
104−-------
105−
106−Produces
107−--------
108−
109−`bot` is an [atom]().
110−
111−`top` is an [atom]().
112−
113−Source
114−------
115−
116− ++ zug (mix (lsh 4 1 top) bot)
117−
118−Examples
119−--------
120−
121− ~zod/try=> `@ux`~(zug mu 0x10e1 0xfa)
122− 0x10e1.00fa
123−
124−
docs/system/hoon/library/core/ne.mddeleted−154
@@ -1,154 +0,0 @@
1−### `++ne`
2−
3−Digit rendering engine
4−
5−A [door]() containing arms that render digits at bases 10, 16, 32, and
6−64.
7−
8−Accepts
9−-------
10−
11−Produces
12−--------
13−
14−`tig` is an [`atom`]().
15−
16−Source
17−------
18−
19− ++ ne
20− |_ tig=@
21−
22−Examples
23−--------
24−
25− ~zod/try=> ~(. ne 20)
26− <4.gut [@ud <414.hhh 100.xkc 1.ypj %164>]>
27−
28−------------------------------------------------------------------------
29−
30−### `++d`
31−
32−Render decimal
33−
34−Renders a decimal digit as an atom of an ACII byte value.
35−
36−Accepts
37−-------
38−
39−Produces
40−--------
41−
42−`tig` is an [`atom`]().
43−
44−Source
45−------
46−
47− ++ d (add tig '0')
48−
49−Examples
50−--------
51−
52− ~zod/try=> `@t`~(d ne 7)
53− '7'
54−
55−------------------------------------------------------------------------
56−
57−### `++x`
58−
59−Render hex
60−
61−Renders a hexadecimal digit as an atom of an ASCII byte value.
62−
63−Accepts
64−-------
65−
66−Produces
67−--------
68−
69−`tig` is an [`atom`]().
70−
71−Source
72−------
73−
74− ++ x ?:((gte tig 10) (add tig 87) d)
75−
76−Examples
77−--------
78−
79− ~zod/try=> `@t`~(x ne 7)
80− '7'
81− ~zod/try=> `@t`~(x ne 14)
82− 'e'
83−
84−------------------------------------------------------------------------
85−
86−### `++v`
87−
88−Render base-32
89−
90−Renders a base-32 digit as an atom of an ASCII byte value.
91−
92−Accepts
93−-------
94−
95−Produces
96−--------
97−
98−Source
99−------
100−
101− ++ v ?:((gte tig 10) (add tig 87) d)
102−
103−Examples
104−--------
105−
106− ~zod/try=> `@t`~(v ne 7)
107− '7'
108− ~zod/try=> `@t`~(v ne 14)
109− 'e'
110− ~zod/try=> `@t`~(v ne 25)
111− 'p'
112−
113−------------------------------------------------------------------------
114−
115−### `++w`
116−
117−Render base-64
118−
119−Renders a base-64 digit as an atom of an ASCII byte value.
120−
121−Accepts
122−-------
123−
124−Produces
125−--------
126−
127−`tig` is an [`atom`]().
128−
129−Source
130−------
131−
132− ++ w ?:(=(tig 63) '~' ?:(=(tig 62) '-' ?:((gte tig 36) (add tig 29) x)))
133− --
134− ::
135−
136−Examples
137−--------
138−
139− ~zod/try=> `@t`~(w ne 7)
140− '7'
141− ~zod/try=> `@t`~(w ne 14)
142− 'e'
143− ~zod/try=> `@t`~(w ne 25)
144− 'p'
145− ~zod/try=> `@t`~(w ne 52)
146− 'Q'
147− ~zod/try=> `@t`~(w ne 61)
148− 'Z'
149− ~zod/try=> `@t`~(w ne 63)
150− '~'
151− ~zod/try=> `@t`~(w ne 62)
152− '-'
153−
154−
docs/system/hoon/library/core/ob.mddeleted−255
@@ -1,255 +0,0 @@
1−### `++ob`
2−
3−Reversible scrambling core, v2
4−
5− ++ ob
6− |%
7−
8−A core for performing reversible scrambling operations for the `@p` phonetic base.
9−
10−------------------------------------------------------------------------
11−
12−### `++feen`
13−
14−Conceal structure, v2
15−
16−Randomly permutes atoms that fit into 17 to 32 bits into one another. If the
17−atom fits into 33 to 64 bits, does the same permutation on the low 32 bits
18−only. Otherwise, passes the atom through unchanged.
19−
20−Accepts
21−-------
22−
23−An atom.
24−
25−Produces
26−--------
27−
28−An atom.
29−
30−Source
31−------
32−
33− ++ feen :: conceal structure v2
34− |= pyn=@ ^- @
35− ?: &((gte pyn 0x1.0000) (lte pyn 0xffff.ffff))
36− (add 0x1.0000 (fice (sub pyn 0x1.0000)))
37− ?: &((gte pyn 0x1.0000.0000) (lte pyn 0xffff.ffff.ffff.ffff))
38− =+ lo=(dis pyn 0xffff.ffff)
39− =+ hi=(dis pyn 0xffff.ffff.0000.0000)
40− %+ con hi
41− (add 0x1.0000 (fice (sub lo 0x1.0000)))
42− pyn
43−
44−Examples
45−--------
46−
47−
48−------------------------------------------------------------------------
49−
50−### `++fend`
51−
52−XX
53−
54−Randomly permutes atoms that fit into 17 to 32 bits into one another, and
55−randomly permutes the low 32 bits of atoms that fit into 33 to 64 bits;
56−otherwise, passes the atom through unchanged. The permutation is the inverse of
57−the one applied by [`++feen`]().
58−
59−Accepts
60−-------
61−
62−An atom.
63−
64−Produces
65−--------
66−
67−An atom.
68−
69−Source
70−------
71−
72− ++ fend :: restore structure v2
73− |= cry=@ ^- @
74− ?: &((gte cry 0x1.0000) (lte cry 0xffff.ffff))
75− (add 0x1.0000 (teil (sub cry 0x1.0000)))
76− ?: &((gte cry 0x1.0000.0000) (lte cry 0xffff.ffff.ffff.ffff))
77− =+ lo=(dis cry 0xffff.ffff)
78− =+ hi=(dis cry 0xffff.ffff.0000.0000)
79− %+ con hi
80− (add 0x1.0000 (teil (sub lo 0x1.0000)))
81− cry
82−
83−Examples
84−--------
85−
86−------------------------------------------------------------------------
87−
88−### `++fice`
89−
90−XX
91−
92−Applies a 3-round Feistel-like cipher to randomly permute atoms in the range `0` to `2^32 - 2^16`. The construction given in Black and Rogaway is ideal for a domain with a size of that form, and as with a conventionel Feistel cipher, three rounds suffice to make the permutation pseudorandom.
93−
94−Accepts
95−-------
96−
97−An atom.
98−
99−Produces
100−--------
101−
102−An atom.
103−
104−Source
105−------
106−
107− ++ fice :: adapted from
108− |= nor=@ :: black and rogaway
109− ^- @ :: "ciphers with
110− =+ ^= sel :: arbitrary finite
111− %+ rynd 2 :: domains", 2002
112− %+ rynd 1
113− %+ rynd 0
114− [(mod nor 65.535) (div nor 65.535)]
115− (add (mul 65.535 -.sel) +.sel)
116−
117−Examples
118−--------
119−
120−------------------------------------------------------------------------
121−
122−### `++teil`
123−
124−XX
125−
126−Applies the reverse of the Feistel-like cipher applied by [`++fice`](). Unlike
127−a conventional Feistel cipher that is its own inverse if keys are used in
128−reverse order, this Feistel-like cipher uses two moduli that must be swapped
129−when applying the reverse transformation.
130−
131−Accepts
132−-------
133−
134−An atom.
135−
136−Produces
137−--------
138−
139−An atom.
140−
141−Source
142−------
143−
144− ++ teil :: reverse ++fice
145− |= vip=@
146− ^- @
147− =+ ^= sel
148− %+ rund 0
149− %+ rund 1
150− %+ rund 2
151− [(mod vip 65.535) (div vip 65.535)]
152− (add (mul 65.535 -.sel) +.sel)
153−
154−Examples
155−--------
156−
157−------------------------------------------------------------------------
158−
159−### `++rynd`
160−
161−XX
162−
163−A single round of the Feistel-like cipher [`++fice`](). AES ([`++aesc`]()) is
164−used as the round function.
165−
166−Accepts
167−-------
168−
169−A cell of three atoms, `n`, `l`, and `r`.
170−
171−Produces
172−--------
173−
174−A cell of two atoms.
175−
176−Source
177−------
178−
179− ++ rynd :: feistel round
180− |= [n=@ l=@ r=@]
181− ^- [@ @]
182− :- r
183− ?~ (mod n 2)
184− (~(sum fo 65.535) l (en:aesc (snag n raku) r))
185− (~(sum fo 65.536) l (en:aesc (snag n raku) r))
186−
187−Examples
188−--------
189−
190−------------------------------------------------------------------------
191−
192−### `++rund`
193−
194−XX
195−
196−A single round of the Feistel-like reverse cipher [`++teil`]().
197−
198−Accepts
199−-------
200−
201−A cell of three atoms, `n`, `l`, and `r`.
202−
203−Produces
204−--------
205−
206−A cell of two atoms.
207−
208−Source
209−------
210−
211− ++ rund :: reverse round
212− |= [n=@ l=@ r=@]
213− ^- [@ @]
214− :- r
215− ?~ (mod n 2)
216− (~(dif fo 65.535) l (en:aesc (snag n raku) r))
217− (~(dif fo 65.536) l (en:aesc (snag n raku) r))
218−
219−Examples
220−--------
221−
222−------------------------------------------------------------------------
223−
224−### `++raku`
225−
226−XX
227−
228−
229−Accepts
230−-------
231−
232−A list of atoms of [odor]() [`@ux`]() (hexadecimal).
233−
234−Produces
235−--------
236−
237−Arbitrary keys for use with [`++aesc`]().
238−
239−Source
240−------
241−
242− ++ raku
243− ^- (list ,@ux)
244− :~ 0x15f6.25e3.083a.eb3e.7a55.d4db.fb99.32a3.
245− 43af.2750.219e.8a24.e5f8.fac3.6c36.f968
246− 0xf2ff.24fe.54d0.1abd.4b2a.d8aa.4402.8e88.
247− e82f.19ec.948d.b1bb.ed2e.f791.83a3.8133
248− 0xa3d8.6a7b.400e.9e91.187d.91a7.6942.f34a.
249− 6f5f.ab8e.88b9.c089.b2dc.95a6.aed5.e3a4
250− ==
251−
252−Examples
253−--------
254−
255−
docs/system/hoon/library/core/og.mddeleted−55
@@ -1,55 +0,0 @@
1−
2−### `++og`
3−
4− ++ og :: shax-powered rng
5− ~/ %og
6− |_ a=@
7−
8−XX document
9−
10−### `++rad`
11−
12− ++ rad :: random in range
13− |= b=@ ^- @
14− =+ c=(raw (met 0 b))
15− ?:((lth c b) c $(a +(a)))
16− ::
17−
18−XX document
19−
20−### `++rads`
21−
22− ++ rads :: random continuation
23− |= b=@
24− =+ r=(rad b)
25− [r +>.$(a (shas %og-s r))]
26−
27−XX document
28−
29−### `++raw`
30−
31− ++ raw :: random bits
32− ~/ %raw
33− |= b=@ ^- @
34− %+ can
35− 0
36− =+ c=(shas %og-a (mix b a))
37− |- ^- (list ,[@ @])
38− ?: =(0 b)
39− ~
40− =+ d=(shas %og-b (mix b (mix a c)))
41− ?: (lth b 256)
42− [[b (end 0 b d)] ~]
43− [[256 d] $(c d, b (sub b 256))]
44−
45−XX document
46−
47−### `++raws`
48−
49− ++ raws :: random bits continuation
50− |= b=@
51− =+ r=(raw b)
52− [r +>.$(a (shas %og-s r))]
53− --
54−
55−
docs/system/hoon/library/core/po.mddeleted−200
@@ -1,200 +0,0 @@
1−### `++po`
2−
3−++ po
4− ~/ %po
5− =+ :- ^= sis :: prefix syllables
6− 'dozmarbinwansamlitsighidfidlissogdirwacsabwissib\
7− /rigsoldopmodfoglidhopdardorlorhodfolrintogsilmir\
8− /holpaslacrovlivdalsatlibtabhanticpidtorbolfosdot\
9− /losdilforpilramtirwintadbicdifrocwidbisdasmidlop\
10− /rilnardapmolsanlocnovsitnidtipsicropwitnatpanmin\
11− /ritpodmottamtolsavposnapnopsomfinfonbanporworsip\
12− /ronnorbotwicsocwatdolmagpicdavbidbaltimtasmallig\
13− /sivtagpadsaldivdactansidfabtarmonranniswolmispal\
14− /lasdismaprabtobrollatlonnodnavfignomnibpagsopral\
15− /bilhaddocridmocpacravripfaltodtiltinhapmicfanpat\
16− /taclabmogsimsonpinlomrictapfirhasbosbatpochactid\
17− /havsaplindibhosdabbitbarracparloddosbortochilmac\
18− /tomdigfilfasmithobharmighinradmashalraglagfadtop\
19− /mophabnilnosmilfopfamdatnoldinhatnacrisfotribhoc\
20− /nimlarfitwalrapsarnalmoslandondanladdovrivbacpol\
21− /laptalpitnambonrostonfodponsovnocsorlavmatmipfap'
22− ^= dex :: suffix syllables
23− 'zodnecbudwessevpersutletfulpensytdurwepserwylsun\
24− /rypsyxdyrnuphebpeglupdepdysputlughecryttyvsydnex\
25− /lunmeplutseppesdelsulpedtemledtulmetwenbynhexfeb\
26− /pyldulhetmevruttylwydtepbesdexsefwycburderneppur\
27− /rysrebdennutsubpetrulsynregtydsupsemwynrecmegnet\
28− /secmulnymtevwebsummutnyxrextebfushepbenmuswyxsym\
29− /selrucdecwexsyrwetdylmynmesdetbetbeltuxtugmyrpel\
30− /syptermebsetdutdegtexsurfeltudnuxruxrenwytnubmed\
31− /lytdusnebrumtynseglyxpunresredfunrevrefmectedrus\
32− /bexlebduxrynnumpyxrygryxfeptyrtustyclegnemfermer\
33− /tenlusnussyltecmexpubrymtucfyllepdebbermughuttun\
34− /bylsudpemdevlurdefbusbeprunmelpexdytbyttyplevmyl\
35− /wedducfurfexnulluclennerlexrupnedlecrydlydfenwel\
36− /nydhusrelrudneshesfetdesretdunlernyrsebhulryllud\
37− /remlysfynwerrycsugnysnyllyndyndemluxfedsedbecmun\
38− /lyrtesmudnytbyrsenwegfyrmurtelreptegpecnelnevfes'
39− |%
40−
41−Provides the phonetic syllables and name generators for the Urbit naming
42−system. The two faces, `sis` and `dex` are available to the arms
43−contained in this section.
44−
45−
46−------------------------------------------------------------------------
47−
48−### `++ind`
49−
50−Parse prefix
51−
52−Produces the byte of the right-hand syllable `a`.
53−
54−Accepts
55−-------
56−
57−`a` is an [atom]().
58−
59−Produces
60−--------
61−
62−A [`++unit`]() of an atom.
63−
64−Source
65−------
66−
67− ++ ind ~/ %ind :: parse prefix
68− |= a=@
69− =+ b=0
70− |- ^- (unit ,@)
71− ?:(=(256 b) ~ ?:(=(a (tod b)) [~ b] $(b +(b))))
72−
73−Examples
74−--------
75−
76− ~zod/try=> (ind:po 'zod')
77− [~ 0]
78− ~zod/try=> (ind:po 'zam')
79− ~
80− ~zod/try=> (ind:po 'del')
81− [~ 37]
82−
83−------------------------------------------------------------------------
84−
85−### `++ins`
86−
87−Parse suffix
88−
89−Produces the byte of the left-hand phonetic syllable `b`.
90−
91−Accepts
92−-------
93−
94−`a` is an [atom]().
95−
96−Produces
97−--------
98−A [`++unit`]() of an atom.
99−
100−Source
101−------
102−
103− ++ ins ~/ %ins :: parse suffix
104− |= a=@
105− =+ b=0
106− |- ^- (unit ,@)
107− ?:(=(256 b) ~ ?:(=(a (tos b)) [~ b] $(b +(b))))
108−
109−Examples
110−--------
111−
112− ~zod/try=> (ins:po 'mar')
113− [~ 1]
114− ~zod/try=> (ins:po 'son')
115− [~ 164]
116− ~zod/try=> (ins:po 'pit')
117− [~ 242]
118− ~zod/try=> (ins:po 'pok')
119− ~
120−
121−------------------------------------------------------------------------
122−
123−### `++tod`
124−
125−Fetch prefix
126−
127−Produces the phonetic prefix syllable from index `a` within `dex` as an
128−[atom]().
129−
130−Accepts
131−-------
132−
133−`a` is an atom
134−
135−Produces
136−--------
137−
138−An atom.
139−
140−
141−Source
142−------
143−
144− ++ tod ~/ %tod :: fetch prefix
145− |=(a=@ ?>((lth a 256) (cut 3 [(mul 3 a) 3] dex)))
146−
147−Examples
148−--------
149−
150− ~zod/try=> `@t`(tod:po 1)
151− 'nec'
152− ~zod/try=> `@t`(tod:po 98)
153− 'dec'
154− ~zod/try=> `@t`(tod:po 0)
155− 'zod'
156− ~zod/try=> `@t`(tod:po 150)
157− 'ryg'
158− ~zod/try=> `@t`(tod:po 255)
159− 'fes'
160− ~zod/try=> `@t`(tod:po 256)
161− ! exit
162−
163−------------------------------------------------------------------------
164−
165−### `++tos`
166−
167−Fetch suffix
168−
169−Produces the phonetic prefix syllable from index `a` within `sis` as an
170−[atom]().
171−
172−Accepts
173−-------
174−
175−`a` is an atom.
176−
177−Produces
178−--------
179−
180−An atom.
181−
182−Source
183−------
184−
185− ++ tos ~/ %tos :: fetch suffix
186− |=(a=@ ?>((lth a 256) (cut 3 [(mul 3 a) 3] sis)))
187−
188−Examples
189−--------
190−
191− ~zod/try=> `@t`(tos:po 0)
192− 'doz'
193− ~zod/try=> `@t`(tos:po 120)
194− 'fab'
195− ~zod/try=> `@t`(tos:po 43)
196− 'pid'
197− ~zod/try=> `@t`(tos:po 253)
198− 'mat'
199−
200−------------------------------------------------------------------------
docs/system/hoon/library/core/poja.mddeleted−715
@@ -1,715 +0,0 @@
1−### `++poja`
2−
3−JSON parser core
4−
5−JSON parser core: parses a [`++cord`]() `a` to the hoon structure for JSON,
6−a [`++json`]().
7−
8−Accepts
9−-------
10−
11−`a` is [`++cord`]().
12−
13−Produces
14−--------
15−
16−
17−A `(like json)`.
18−
19−Source
20−------
21−
22− ++ poja :: JSON parser core
23− =< |=(a=cord (rush a apex))
24− |%
25−
26−Examples
27−--------
28−
29− ~zod/try=> (poja '[1,2,3]')
30− [~ [%a p=~[[%n p=~.1] [%n p=~.2] [%n p=~.3]]]]
31− ~zod/try=> (poja 'null')
32− [~ ~]
33− ~zod/try=> (poja 'invalid{json')
34− ~
35−
36−### `++tops`
37−
38−Parse object
39−
40−Top level parsing [`++rule`](). Parses either a single JSON object, or an array
41−of JSON objects to a [`++json`](). See also: [`++abox`](), [`++obox`]().
42−
43−Accepts
44−-------
45−
46−A [`++nail`]().
47−
48−Produces
49−--------
50−
51−A `(like json)`.
52−
53−Source
54−------
55−
56− ++ apex ;~(pose abox obox) :: JSON object
57−
58−Examples
59−--------
60−
61− ~zod/try=> (rash '[1,2]' apex:poja)
62− [%a p=~[[%n p=~.1] [%n p=~.2]]]
63− ~zod/try=> (rash '{"sam": "kot"}' apex:poja)
64− [%o p={[p=~.sam q=[%s p=~.kot]]}]
65− ~zod/try=> (rash 'null' apex:poja)
66− ! {1 1}
67− ! exit
68−
69−### `++apex`
70−
71−Parse value
72−
73−Parsing [`++rule`](). Parses JSON values to [`++json`]().
74−
75−Accepts
76−-------
77−
78−A [`++nail`]().
79−
80−Produces
81−--------
82−
83−A `(like json)`.
84−
85−Source
86−------
87−
88− ++ valu :: JSON value
89− %+ knee *json |. ~+
90− ;~ pfix spac
91− ;~ pose
92− (cold ~ (jest 'null'))
93− (jify %b bool)
94− (jify %s stri)
95− (cook |=(s=tape [%n p=(rap 3 s)]) numb)
96− abox
97− obox
98− ==
99− ==
100−
101−Examples
102−--------
103−
104− ~zod/try=> (rash '[1,2]' valu:poja)
105− [%a p=~[[%n p=~.1] [%n p=~.2]]]
106− ~zod/try=> (rash '{"sam": "kot"}' valu:poja)
107− [%o p={[p='sam' q=[%s p=~.kot]]}]
108− ~zod/try=> (rash 'null' valu:poja)
109− ~
110− ~zod/try=> (rash '20' valu:poja)
111− [%n p=~.20]
112− ~zod/try=> (rash '"str"' valu:poja)
113− [%s p=~.str]
114− ~zod/try=> (rash 'true' valu:poja)
115− [%b p=%.y]
116−
117−### `++abox`
118−
119−Parse array
120−
121−Parsing rule. Parses a JSON array with values enclosed within `[]` and
122−delimited by a `,`.
123−
124−Accepts
125−-------
126−
127−A [`++nail`]().
128−
129−Produces
130−--------
131−
132−A `(like json)`.
133−
134−Source
135−------
136−
137− ++ abox (stag %a (ifix [sel (ws ser)] (more (ws com) valu)))
138−
139−Examples
140−--------
141−
142− ~zod/try=> (rash '[1, 2,4]' abox:poja)
143− [[%n p=~.1] ~[[%n p=~.2] [%n p=~.4]]]
144−
145−JSON Objects
146−------------
147−
148−### `++pair`
149−
150−Parse key value pair
151−
152−Parsing rule. Parses a [`++json`]() from a JSON key-value pair of a
153−string and value delimited by `:`.
154−
155−Accepts
156−-------
157−
158−A [`++nail`]().
159−
160−Produces
161−--------
162−
163−A `(like json)`.
164−
165−Source
166−------
167−
168− ++ pair ;~(plug ;~(sfix (ws stri) (ws col)) valu)
169−
170−Examples
171−--------
172−
173− ~zod/try=> (rash '"ham": 2' pair:poja)
174− ['ham' [%n p=~.2]]
175−
176−### `++obje`
177−
178−Parse array of objects
179−
180−Parsing rule. Parses a [`++json`]() from an array of JSON object
181−key-value pairs that are enclosed within `{}` and separated by `,`.
182−
183−Accepts
184−-------
185−
186−A [`++nail`]().
187−
188−Produces
189−--------
190−
191−A `(like ,[%o p=(map ,@t json)])`
192−
193−Source
194−------
195−
196− ++ obje (ifix [(ws kel) (ws ker)] (more (ws com) pair))
197−
198−Examples
199−--------
200−
201− ~zod/try=> (rash '{"ham": 2, "lam":true}' obje:poja)
202− [['ham' [%n p=~.2]] ~[['lam' [%b p=%.y]]]]
203−
204−### `++obox`
205−
206−Parse boxed object
207−
208−Parsing rule. Parses an array of JSON objects to an object of [`++json`](). See also: [`++json`]().
209−
210−Accepts
211−-------
212−
213−A [`++nail`]().
214−
215−Produces
216−--------
217−
218−A `(like ,[%o p=(map ,@t json)])`
219−
220−Source
221−------
222−
223− ++ obox (stag %o (cook mo obje))
224−
225−Examples
226−--------
227−
228− ~zod/try=> (rash '{"ham": 2, "lam":true}' obox:poja)
229− [%o {[p='lam' q=[%b p=%.y]] [p='ham' q=[%n p=~.2]]}]
230−
231−JSON Booleans
232−-------------
233−
234−### `++bool`
235−
236−Parse boolean
237−
238−Parsing rule. Parses a string of either `true` or `false` to a
239−[`++json`]() boolean.
240−
241−
242−Accepts
243−-------
244−
245−A [`++nail`]().
246−
247−Produces
248−--------
249−
250−
251−A `(like ,[%b p=?])`
252−
253−Source
254−------
255−
256− ++ bool ;~(pose (cold & (jest 'true')) (cold | (jest 'false')))
257−
258−Examples
259−--------
260−
261− ~zod/try=> (rash 'true' bool:poja)
262− %.y
263− ~zod/try=> (rash 'false' bool:poja)
264− %.n
265− ~zod/try=> (rash 'null' bool:poja)
266− ! {1 1}
267− ! exit
268−
269−JSON strings
270−------------
271−
272−### `++stri`
273−
274−Parse string
275−
276−Parsing rule. Parse a string to a [`++cord`](). A JSON string is a list
277−of characters enclosed in double quotes along with escaping `\`s, to a
278−[`++cord`](). See also [`++jcha`]().
279−
280−Accepts
281−-------
282−
283−A [`++nail`]().
284−
285−Produces
286−--------
287−
288−A `(like ,[%s p=@t])`.
289−
290−Source
291−------
292−
293− ++ stri
294− (cook crip (ifix [doq doq] (star jcha)))
295−
296−Examples
297−--------
298−
299− ~zod/try=> (rash '"ham"' stri:poja)
300− 'ham'
301− ~zod/try=> (rash '"h\\nam"' stri:poja)
302− 'h
303− am'
304− ~zod/try=> (rash '"This be \\"quoted\\""' stri:poja)
305− 'This be "quoted"'
306−
307−### `++jcha`
308−
309−Parse char from string
310−
311−Parsing rule. Parses either a literal or escaped character from a JSON
312−string to a [`++cord`]().
313−
314−
315−Accepts
316−-------
317−
318−A [`++nail`]().
319−
320−Produces
321−--------
322−
323−A `(like cord)`.
324−
325−Source
326−------
327−
328− ++ jcha ;~(pose ;~(less doq bas prn) esca) :: character in string
329−
330−Examples
331−--------
332−
333− ~zod/try=> (rash 'a' jcha:poja)
334− 'a'.
335− ~zod/try=> (rash '!' jcha:poja)
336− '!'
337− ~zod/try=> (rash '\\"' jcha:poja)
338− '"'
339− ~zod/try=> (rash '\\u00a4' jcha:poja)
340− '¤'
341− ~zod/try=> (rash '\\n' jcha:poja)
342− '
343− '
344−
345−### `++esca`
346−
347−Parse escaped char
348−
349−Parsing rule. Parses a backslash-escaped special character, low ASCII,
350−or UTF16 codepoint, to a [`++cord`]().
351−
352−
353−Accepts
354−-------
355−
356−A [`++nail`]().
357−
358−Produces
359−--------
360−
361−A `(like cord)`.
362−
363−Source
364−------
365−
366− ++ esca :: Escaped character
367− ;~ pfix bas
368− ;~ pose
369− doq fas soq bas
370− (sear ~(get by `(map ,@t ,@)`(mo b/8 t/9 n/10 f/12 r/13 ~)) low)
371− ;~(pfix (just 'u') (cook tuft qix:ab)) :: 4-digit hex to UTF-8
372− ==
373−
374−Examples
375−--------
376−
377− ~zod/try=> (rash 'b' esca:poja)
378− ! {1 1}
379− ! exit
380− ~zod/try=> (rash '\n' esca:poja)
381− ~ <syntax error at [1 9]>
382− ~zod/try=> (rash '\\n' esca:poja)
383− '
384− '
385− ~zod/try=> `@`(rash '\\r' esca:poja)
386− 13
387− ~zod/try=> (rash '\\u00c4' esca:poja)
388− 'Ä'
389− ~zod/try=> (rash '\\u00df' esca:poja)
390− 'ß'
391−
392−JSON numbers
393−------------
394−
395−A JSON numbers are stored as cords internally in lieu of full float
396−support, so ++numb and subarms are really more *validators* than parsers
397−per se.
398−
399−### `++numb`
400−
401−Parse number
402−
403−Parsing rule. Parses decimal numbers with an optional `-`, fractional
404−part, or exponent part, to a [`++tape`]().
405−
406−Accepts
407−-------
408−
409−A [`++nail`]().
410−
411−Produces
412−--------
413−
414−An [`++edge`]() of a [`++tape`]().
415−
416−Source
417−------
418−
419− ++ numb
420− ;~ (comp twel)
421− (mayb (piec hep))
422− ;~ pose
423− (piec (just '0'))
424− ;~(plug (shim '1' '9') digs)
425− ==
426− (mayb frac)
427− (mayb expo)
428− ==
429−
430−Examples
431−--------
432−
433− ~zod/try=> (rash '0' numb:poja)
434− ~[~~0]
435− ~zod/try=> (rash '1' numb:poja)
436− ~[~~1]
437− ~zod/try=> `tape`(rash '1' numb:poja)
438− "1"
439− ~zod/try=> `tape`(rash '12.6' numb:poja)
440− "12.6"
441− ~zod/try=> `tape`(rash '-2e20' numb:poja)
442− "-2e20"
443− ~zod/try=> `tape`(rash '00e20' numb:poja)
444− ! {1 2}
445− ! exit
446−
447−### `++digs`
448−
449−Parse 1-9
450−
451−Parsing rule. Parses digits `0` through `9` to a [`++tape`]().
452−
453−Accepts
454−-------
455−
456−A [`++nail`]().
457−
458−Produces
459−--------
460−
461−The [`++edge`]() of a `++tape`.
462−
463−Source
464−------
465−
466− ++ digs (star (shim '0' '9'))
467−
468−Examples
469−--------
470−
471− ~zod/try=> (rash '' digs:poja)
472− ""
473− ~zod/try=> (rash '25' digs:poja)
474− "25"
475− ~zod/try=> (rash '016' digs:poja)
476− "016"
477− ~zod/try=> (rash '7' digs:poja)
478− "7"
479−
480−### `++expo`
481−
482−Parse exponent part
483−
484−Parsing rule. Parses an exponent to a [`++tape`]() .An exponent is an
485−`e` or 'E', followed by an optional `+` or `-`, and then by digits.
486−
487−Accepts
488−-------
489−
490−A [`++nail`]().
491−
492−Produces
493−--------
494−
495−The [`++edge`]() of a `++tape`.
496−
497−Source
498−------
499−
500− ++ expo :: Exponent part
501− ;~ (comp twel)
502− (piec (mask "eE"))
503− (mayb (piec (mask "+-")))
504− digs
505− ==
506−
507−Examples
508−--------
509−
510− ~zod/try=> `tape`(rash 'e7' expo:poja)
511− "e7"
512− ~zod/try=> `tape`(rash 'E17' expo:poja)
513− "E17"
514− ~zod/try=> `tape`(rash 'E-4' expo:poja)
515− "E-4"
516−
517−### `++frac`
518−
519−Fractional part
520−
521−Parsing rule. Parses a dot followed by digits to a [`++cord`]().
522−
523−Accepts
524−-------
525−
526−A `++nail`.
527−
528−Produces
529−--------
530−
531−The [`++edge`]() of a `++tape`.
532−
533−Source
534−------
535−
536− ++ frac ;~(plug dot digs) :: Fractional part
537−
538−Examples
539−--------
540−
541− ~zod/try=> (rash '.25' frac:poja)
542− [~~~. "25"]
543− ~zod/try=> (rash '.016' frac:poja)
544− [~~~. "016"]
545− ~zod/try=> (rash '.7' frac:poja)
546− [~~~. "7"]
547−
548−whitespace
549−----------
550−
551−### `++spac`
552−
553−Parse whitespace
554−
555−Parsing rule. Parses a whitespace to a [`++tape`]().
556−
557−Accepts
558−-------
559−
560−A [`++nail`]().
561−
562−Produces
563−--------
564−
565−A `(like tape)`.
566−
567−Source
568−------
569−
570− ++ spac (star (mask [`@`9 `@`10 `@`13 ' ' ~]))
571−
572−Examples
573−--------
574−
575− ~zod/try=> (scan "" spac:poja)
576− ""
577− ~zod/try=> (scan " " spac:poja)
578− " "
579− ~zod/try=> `*`(scan `tape`~[' ' ' ' ' ' `@`9 ' ' ' ' `@`13] spac:poja)
580− [32 32 32 9 32 32 13 0]
581− ~zod/try=> (scan " m " spac:poja)
582− ! {1 4}
583− ! exit
584−
585−### `++ws`
586−
587−Allow prefix whitespace
588−
589−Parser modifier. Produces a rule that allows for a whitespace before
590−applying `sef`.
591−
592−Accepts
593−-------
594−
595−`sef` is a [`++rule`]().
596−
597−Produces
598−--------
599−
600−A `++rule`.
601−
602−Source
603−------
604−
605− ++ ws |*(sef=_rule ;~(pfix spac sef))
606−
607−Examples
608−--------
609−
610− ~zod/try=> (rash ' 4' digs:poja)
611− ! {1 1}
612− ! exit
613− ~zod/try=> (rash ' 4' (ws digs):poja)
614− "4"
615− ~zod/try=> (rash '''
616−
617− 4
618− ''' (ws digs):poja)
619− "4"
620−
621−Plumbing
622−--------
623−
624−### `++mayb`
625−
626−Maybe parse
627−
628−Parser modifier. Need to document, an example showing failure.
629−
630−Accepts
631−-------
632−
633−XX
634−
635−Produces
636−--------
637−
638−XX
639−
640−Source
641−------
642−
643− ++ mayb |*(bus=_rule ;~(pose bus (easy "")))
644−
645−Examples
646−--------
647−
648− ~zod/try=> (abox:poja 1^1 "not-an-array")
649− [p=[p=1 q=1] q=~]
650− ~zod/try=> ((mayb abox):poja 1^1 "not-an-array")
651− [p=[p=1 q=1] q=[~ [p="" q=[p=[p=1 q=1] q="not-an-array"]]]]
652−
653−### `++twel`
654−
655−Weld two tapes
656−
657−Concatenates two tapes, `a` and `b`, producing a [`++tape`]().
658−
659−Accepts
660−-------
661−
662−`a` is a [`++tape`]().
663−
664−`b` is a [`++tape`]().
665−
666−Produces
667−--------
668−
669−The [`++edge`]() of a `++tape`.
670−
671−Source
672−------
673−
674− ++ twel |=([a=tape b=tape] (weld a b))
675−
676−Examples
677−--------
678−
679− ~zod/try=> (twel "sam" "hok"):poja
680− ~[~~s ~~a ~~m ~~h ~~o ~~k]
681− ~zod/try=> (twel "kre" ""):poja
682− ~[~~k ~~r ~~e]
683−
684−### `++piec`
685−
686−Parse char to list
687−
688−Parser modifer. Parses an atom with `bus` and then wraps it in a
689−[`++list`]().
690−
691−Accepts
692−-------
693−
694−`bus` is a [`++rule`]().
695−
696−Produces
697−--------
698−
699−A `++rule`.
700−
701−Source
702−------
703−
704− ++ piec
705− |* bus=_rule
706− (cook |=(a=@ [a ~]) bus)
707− ::
708−
709−Examples
710−--------
711−
712− d~zod/try=> (scan "4" (piec:poja dem:ag))
713− [4 ~]
714−
715−
docs/system/hoon/library/core/poxa.mddeleted−440
@@ -1,440 +0,0 @@
1−### `++poxa`
2−
3−Parse XML
4−
5−Parses an XML node from a [`++cord`](), producing a [`++unit`]() [`++manx`]().
6−
7−Accepts
8−-------
9−
10−`a` is a [`++cord`]().
11−
12−Produces
13−--------
14−
15−A `(unit manx)`.
16−
17−Source
18−------
19−
20− ++ poxa :: xml parser
21− =< |=(a=cord (rush a apex))
22− |%
23−
24−Examples
25−--------
26−
27− ~zod/try=> (poxa '<div />')
28− [~ [g=[n=%div a=~] c=~]]
29− ~zod/try=> (poxa '<html><head/> <body/></html>')
30− [~ [g=[n=%html a=~] c=~[[g=[n=%head a=~] c=~] [g=[n=%body a=~] c=~]]]]
31− ~zod/try=> (poxa '<script src="/gep/hart.js"/>')
32− [~ [g=[n=%script a=~[[n=%src v="/gep/hart.js"]]] c=~]]
33− ~zod/try=> (poxa '<<<<')
34− ~
35−
36−### `++apex`
37−
38−Top level parser
39−
40−Parses a node of XML, type [`++manx`]().
41−
42−Accepts
43−-------
44−
45−A [`++nail`]().
46−
47−Produces
48−--------
49−
50−A `++manx`.
51−
52−Source
53−------
54−
55− ++ apex
56− =+ spa=;~(pose comt whit)
57− %+ knee *manx |. ~+
58− %+ ifix [(star spa) (star spa)]
59− ;~ pose
60− %+ sear |=([a=marx b=marl c=mane] ?.(=(c n.a) ~ (some [a b])))
61− ;~(plug head (more (star comt) ;~(pose apex chrd)) tail)
62− empt
63− ==
64− ::
65−
66−Examples
67−--------
68−
69− ~zod/try=> (rash '<div />' apex:poxa)
70− [g=[n=%div a=~] c=~]
71− ~zod/try=> (rash '<html><head/> <body/></html>' apex:poxa)
72− [g=[n=%html a=~] c=~[[g=[n=%head a=~] c=~] [g=[n=%body a=~] c=~]]]
73− ~zod/try=> (rash '<script src="/gep/hart.js"/>' apex:poxa)
74− [g=[n=%script a=~[[n=%src v="/gep/hart.js"]]] c=~]
75− ~zod/try=> (rash '<<<<' apex:poxa)
76− ! {1 2}
77− ! exit
78−
79−### `++attr`
80−
81−Parse XML attributes
82−
83−Parses the list of attributes inside the opening XML tag, which is zero
84−or more space-prefixed name to string values.
85−
86−Accepts
87−-------
88−
89−A [`++nail`]().
90−
91−Produces
92−--------
93−
94−A [`++mart`]().
95−
96−Source
97−------
98−
99− ++ attr :: attributes
100− %+ knee *mart |. ~+
101− %- star
102− ;~ plug
103− ;~(sfix name tis)
104− ;~ pose
105− (ifix [doq doq] (star ;~(less doq escp)))
106− (ifix [soq soq] (star ;~(less soq escp)))
107− ==
108− ==
109− ::
110−
111−Examples
112−--------
113−
114− ~zod/try=> (rash '' attr:poxa)
115− ~
116− ~zod/try=> (rash 'sam=""' attr:poxa)
117− ! {1 1}
118− ! exit
119− ~zod/try=> (rash ' sam=""' attr:poxa)
120− ~[[n=%sam v=""]]
121− ~zod/try=> (rash ' sam="hek"' attr:poxa)
122− ~[[n=%sam v="hek"]]
123− ~zod/try=> (rash ' sam="hek" res="actor"' attr:poxa)
124− ~[[n=%sam v="hek"] [n=%res v="actor"]]
125− ~zod/try=> (rash ' sam=\'hek\' res="actor"' attr:poxa)
126− ~[[n=%sam v="hek"] [n=%res v="actor"]]
127− ~zod/try=> (rash ' sam=\'hek" res="actor"' attr:poxa)
128− ! {1 23}
129− ! exit
130−
131−### `++chrd`
132−
133−Parse character data
134−
135−Parsing rule. Parses XML character data.
136−
137−Accepts
138−-------
139−
140−A [`++nail`]().
141−
142−Produces
143−--------
144−
145−A [`++mars`]().
146−
147−Source
148−------
149−
150− ++ chrd :: character data
151− %+ cook |=(a=tape ^-(mars :/(a)))
152− (plus ;~(less soq doq ;~(pose (just `@`10) escp)))
153− ::
154−
155−Examples
156−--------
157−
158− ~zod/try=> (rash 'asa' chrd:poxa)
159− [g=[n=%$ a=~[[n=%$ v="asa"]]] c=~]
160− ~zod/try=> (rash 'asa > are' chrd:poxa)
161− [g=[n=%$ a=~[[n=%$ v="asa > are"]]] c=~]
162− ~zod/try=> (rash 'asa > are' chrd:poxa)
163− ! {1 6}
164− ! exit
165−
166−### `++comt`
167−
168−Parses comments
169−
170−Parsing rule. Parses XML comment blocks.
171−
172−Accepts
173−-------
174−
175−A [`++nail`]().
176−
177−Produces
178−--------
179−
180−A [`++like`]().
181−
182−Source
183−------
184−
185− ++ comt :: comments
186− =- (ifix [(jest '<!--') (jest '-->')] (star -))
187− ;~ pose
188− ;~(less hep prn)
189− whit
190− ;~(less (jest '-->') hep)
191− ==
192− ::
193−A [`++unit`]() of.
194−
195−Examples
196−--------
197−
198− ~zod/try=> (rash '<!-- bye -->' comt:poxa)
199− " bye "
200− ~zod/try=> (rash '<!-- bye ><<<>< - - -->' comt:poxa)
201− " bye ><<<>< - - "
202− ~zod/try=> (rash '<!-- invalid -->-->' comt:poxa)
203− ! {1 18}
204− ! exit
205−
206−### `++escp`
207−
208−Parse (possibly) escaped char
209−
210−Parsing rule. Parses a nonspecial or escaped character. Result type
211−[`++char`]()
212−
213−Accepts
214−-------
215−
216−A [`++nail`]().
217−
218−Produces
219−--------
220−
221−The [`++edge`]() of a [`++cord`]().
222−
223−Source
224−------
225−
226− ++ escp
227− ;~ pose
228− ;~(less gal gar pam prn)
229− (cold '>' (jest '>'))
230− (cold '<' (jest '<'))
231− (cold '&' (jest '&'))
232− (cold '"' (jest '"'))
233− (cold '\'' (jest '''))
234− ==
235−
236−Examples
237−--------
238−
239− ~zod/try=> (rash 'a' escp:poxa)
240− 'a'
241− ~zod/try=> (rash 'ab' escp:poxa)
242− ! {1 2}
243− ! exit
244− ~zod/try=> (rash '.' escp:poxa)
245− '.'
246− ~zod/try=> (rash '!' escp:poxa)
247− '!'
248− ~zod/try=> (rash '>' escp:poxa)
249− ! {1 2}
250− ! exit
251− ~zod/try=> (rash '>' escp:poxa)
252− '>'
253− ~zod/try=> (rash '"' escp:poxa)
254− '"'
255−
256−### `++empt`
257−
258−Parse self-closing tag
259−
260−Parsing rule. Parses self-closing XML tags that end in `/>`.
261−
262−Accepts
263−-------
264−
265−A [`++nail`]().
266−
267−Produces
268−--------
269−
270−
271−A `(like tape)`.
272−
273−Source
274−------
275−
276− ++ empt :: self-closing tag
277− %+ ifix [gal (jest '/>')]
278− ;~(plug ;~(plug name attr) (cold ~ (star whit)))
279− ::
280−
281−Examples
282−--------
283−
284− ~zod/try=> (rash '<div/>' empt:poxa)
285− [[%div ~] ~]
286− ~zod/try=> (rash '<pre color="#eeffee" />' empt:poxa)
287− [[%pre ~[[n=%color v="#eeffee"]]] ~]
288− ~zod/try=> (rash '<pre color="#eeffee"></pre>' empt:poxa)
289− ! {1 21}
290− ! exit
291−
292−### `++head`
293−
294−Parse opening tag
295−
296−Parsing rule. Parses the opening tag of an XML node. Result type
297−[`++marx`]()
298−
299−Accepts
300−-------
301−
302−A [`++nail`]().
303−
304−Produces
305−--------
306−
307−A `(like marx)`.
308−
309−Source
310−------
311−
312− ++ head :: opening tag
313− (ifix [gal gar] ;~(plug name attr))
314− ::
315−
316−Examples
317−--------
318−
319− ~zod/try=> (rash '<a>' head:poxa)
320− [n=%a a=~]
321− ~zod/try=> (rash '<div mal="tok">' head:poxa)
322− [n=%div a=~[[n=%mal v="tok"]]]
323− ~zod/try=> (rash '<div mal="tok" />' head:poxa)
324− ! {1 16}
325− ! exit
326−
327−### `++name`
328−
329−Parse tag name
330−
331−Parsing rule. Parses the name of an XML tag.
332−
333−Accepts
334−-------
335−
336−A [`++nail`]().
337−
338−Produces
339−--------
340−
341−An [`++edge`]() of a [`++mane`]().
342−
343−Source
344−------
345−
346− ++ name :: tag name
347− %+ knee *mane |. ~+
348− =+ ^= chx
349− %+ cook crip
350− ;~ plug
351− ;~(pose cab alf)
352− (star ;~(pose cab dot alp))
353− ==
354− ;~(pose ;~(plug ;~(sfix chx col) chx) chx)
355− ::
356−
357−Examples
358−--------
359−
360− ~zod/try=> (scan "ham" name:poxa)
361− %ham
362− ~zod/try=> (scan "ham:tor" name:poxa)
363− [%ham %tor]
364− ~zod/try=> (scan "ham-tor" name:poxa)
365− %ham-tor
366− ~zod/try=> (scan "ham tor" name:poxa)
367− ! {1 4}
368− ! exit
369−
370−### `++tail`
371−
372−Parse closing tag
373−
374−Parsing rule. Parses an XML closing tag.
375−
376−Accepts
377−-------
378−
379−A [`++nail`]().
380−
381−Produces
382−--------
383−
384−A `(like tail)`.
385−
386−Source
387−------
388−
389− ++ tail (ifix [(jest '</') gar] name) :: closing tag
390−
391−Examples
392−--------
393−
394− ~zod/try=> (scan "</div>" tail:poxa)
395− %div
396− ~zod/try=> (scan "</a>" tail:poxa)
397− %a
398− ~zod/try=> (scan "</>" tail:poxa)
399− ! {1 3}
400− ! exit
401−
402−### `++whit`
403−
404−Parse whitespace, etc.
405−
406−Parsing rule. Parses newlines, tabs, and spaces.
407−
408−Accepts
409−-------
410−
411−A [`++nail`]().
412−
413−Produces
414−--------
415−
416−A `(like char)`.
417−
418−Source
419−------
420−
421− ++ whit (mask ~[' ' `@`0x9 `@`0xa]) :: whitespace
422− ::
423−
424−Examples
425−--------
426−
427− ~zod/try=> `@`(scan " " whit:poxa)
428− 32
429− ~zod/try=> `@`(scan " " whit:poxa)
430− ! {1 2}
431− ! exit
432− ~zod/try=> `@`(scan "\0a" whit:poxa)
433− 10
434− ~zod/try=> `@`(scan "\09" whit:poxa)
435− 9
436− ~zod/try=> `@`(scan "\08" whit:poxa)
437− ! {1 1}
438− ! exit
439−
440−
docs/system/hoon/library/core/poxo.mddeleted−255
@@ -1,255 +0,0 @@
1−### `++poxo`
2−
3−Print XML
4−
5−Renders a `++manx` `a` as a [`++tape`]().
6−
7−Accepts
8−-------
9−
10−`a` is a [`++manx`]().
11−
12−Produces
13−--------
14−
15−A `++tape`.
16−
17−Source
18−------
19−
20− ++ poxo :: node to tape
21− =< |=(a=manx `tape`(apex a ~))
22− |_ unq=? :: unq
23−
24−Examples
25−--------
26−
27− ~zod/try=> (poxo ;div;)
28− "<div></div>"
29− ~zod/try=> (poxo ;div:(p a))
30− "<div><p></p><a></a></div>"
31− ~zod/try=> (poxo ;div:(p:"tree > text" a))
32− "<div><p>tree > text</p><a></a></div>"
33−
34−
35−### `++apex`
36−
37−Inner XML printer
38−
39−Renders a [`++manx`]() as a [`++tape`](), appending a suffix `rez`.
40−
41−XX is `rez/` a typo or is the `/` intentional
42−
43−Accepts
44−-------
45−
46−`rez` is a [`++tape`]().
47−
48−Produces
49−--------
50−
51−A `++tape`.
52−
53−Source
54−------
55−
56− ++ apex :: top level
57− |= [mex=manx rez=tape]
58− ^- tape
59− ?: ?=([%$ [[%$ *] ~]] g.mex)
60− (escp v.i.a.g.mex rez)
61− =+ man=`mane`n.g.mex
62− =. unq |(unq =(%script man) =(%style man))
63− =+ tam=(name man)
64− =. rez :(weld "</" tam ">" rez)
65− =+ att=`mart`a.g.mex
66− :- '<'
67− %+ welp tam
68− =. rez ['>' (many c.mex rez)]
69− ?~(att rez [' ' (attr att rez)])
70− ::
71−
72−Examples
73−--------
74−
75− ~zod/try=> (apex:poxo ;div; "")
76− "<div></div>"
77− ~zod/try=> (apex:poxo ;div:(p a) "").
78− "<div><p></p><a></a></div>"
79− ~zod/try=> (apex:poxo ;div:(p a) "--sfix")
80− "<div><p></p><a></a></div>--sfix"
81− ~zod/try=> (apex:poxo ;div:(p:"tree > text" a) "")
82− "<div><p>tree > text</p><a></a></div>"
83− ~zod/try=> (~(apex poxo &) ;div:(p:"tree > text" a) "")
84− "<div><p>tree > text</p><a></a></div>"
85−
86−### `++attr`
87−
88−Print attributes
89−
90−Render XML attributes as a [`++tape`]().
91−
92−Accepts
93−-------
94−
95−`tat` is a [`++mart`]().
96−
97−`rez` is a `++tape`.
98−
99−Produces
100−--------
101−
102−A `++tape`.
103−
104−Source
105−------
106−
107− ++ attr :: attributes to tape
108− |= [tat=mart rez=tape]
109− ^- tape
110− ?~ tat rez
111− =. rez $(tat t.tat)
112− ;: weld
113− (name n.i.tat)
114− "=\""
115− (escp(unq |) v.i.tat '"' ?~(t.tat rez [' ' rez]))
116− ==
117−
118−Examples
119−--------
120−
121− ~zod/try=> (attr:poxo ~ "")
122− ""
123− ~zod/try=> (crip (attr:poxo ~[sam/"hem" [%tok %ns]^"reptor"] ""))
124− 'sam="hem" tok:ns="reptor"'
125− ~zod/try=> (crip (attr:poxo ~[sam/"hem" [%tok %ns]^"reptor"] "|appen"))
126− 'sam="hem" tok:ns="reptor"|appen'
127−
128−### `++escp`
129−
130−Escape XML
131−
132−Escapes the XML special characters `"`, `&`, `'`, `<`, `>`.
133−
134−Accepts
135−-------
136−
137−`tex`is a [`++tape`]().
138−
139−`rez` is a `++tape`.
140−
141−Produces
142−--------
143−
144−`++tape`.
145−
146−Source
147−------
148−
149− ++ escp :: escape for xml
150− |= [tex=tape rez=tape]
151− ?: unq
152− (weld tex rez)
153− =+ xet=`tape`(flop tex)
154− |- ^- tape
155− ?~ xet rez
156− %= $
157− xet t.xet
158− rez ?- i.xet
159− 34 ['&' 'q' 'u' 'o' 't' ';' rez]
160− 38 ['&' 'a' 'm' 'p' ';' rez]
161− 39 ['&' '#' '3' '9' ';' rez]
162− 60 ['&' 'l' 't' ';' rez]
163− 62 ['&' 'g' 't' ';' rez]
164− * [i.xet rez]
165− ==
166− ==
167− ::
168−
169−Examples
170−--------
171−
172− ~zod/try=> (escp:poxo "astra" ~)
173− ~[~~a ~~s ~~t ~~r ~~a]
174− ~zod/try=> `tape`(escp:poxo "astra" ~)
175− "astra"
176− ~zod/try=> `tape`(escp:poxo "x > y" ~)
177− "x > y"
178− ~zod/try=> `tape`(~(escp poxo &) "x > y" ~)
179− "x > y"
180−
181−### `++name`
182−
183−Print name
184−
185−Renders a [`++mane`]() as a [`++tape`]().
186−
187−Accepts
188−-------
189−
190−`man` is a `++mane`.
191−
192−Produces
193−--------
194−
195−A `++tape`.
196−
197−Source
198−------
199−
200− ++ name :: name to tape
201− |= man=mane ^- tape
202− ?@ man (trip man)
203− (weld (trip -.man) `tape`[':' (trip +.man)])
204− ::
205−
206−Examples
207−--------
208−
209− ~zod/try=> (name:poxo %$)
210− ""
211− ~zod/try=> (name:poxo %ham)
212− "ham"
213− ~zod/try=> (name:poxo %ham^%tor)
214− "ham:tor"
215−
216−### `++many`
217−
218−Print node list
219−
220−Renders multiple XML nodes as a [`++tape`]().
221−
222−Accepts
223−-------
224−
225−`lix` is a [`++list`]() of [`++manx`]().
226−
227−`rez` is a `++tape`.
228−
229−Produces
230−--------
231−
232−A `++tape`.
233−
234−Source
235−------
236−
237− ++ many :: nodelist to tape
238− |= [lix=(list manx) rez=tape]
239− |- ^- tape
240− ?~ lix rez
241− (apex i.lix $(lix t.lix))
242− ::
243−
244−Examples
245−--------
246−
247− ~zod/try=> (many:poxo ~ "")
248− ""
249− ~zod/try=> (many:poxo ;"hare" "")
250− "hare"
251− ~zod/try=> (many:poxo ;"hare;{lep}ton" "")
252− "hare<lep></lep>ton"
253− ~zod/try=> ;"hare;{lep}ton"
254− [[[%~. [%~. "hare"] ~] ~] [[%lep ~] ~] [[%~. [%~. "ton"] ~] ~] ~]
255−
docs/system/hoon/library/core/re.mddeleted−260
@@ -1,260 +0,0 @@
1−### `++re`
2−
3−Pretty-printing engine
4−
5−Pretty-printing engine that accepts a [`++tank`](/doc/hoon/library/1#++tank) [sample]() and contains arms that perform computation on it.
6−
7−Accepts
8−-------
9−
10−`tac` is a `++tank`.
11−
12−Produces
13−--------
14−
15− ++ re
16− |_ tac=tank
17−
18−Examples
19−--------
20−
21− /~zod/try=> ~(. re leaf/"ham")
22− <2.ghl [[%leaf ""] <414.gly 100.xkc 1.ypj %164>]>
23−
24−### `++ram`
25−
26−Flatten to tape
27−
28−Flatten [`++tank`]() out into a [`++tape`]().
29−
30−Accepts
31−-------
32−
33−`tac` is a `++tank`, taken from [sample]() of `++re` [core]().
34−
35−Produces
36−--------
37−
38−A `++tape`.
39−
40−Source
41−------
42−
43− ++ ram
44− ^- tape
45− ?- -.tac
46− %leaf p.tac
47− %palm ram(tac [%rose [p.p.tac (weld q.p.tac r.p.tac) s.p.tac] q.tac])
48− %rose
49− %+ weld
50− q.p.tac
51− |- ^- tape
52− ?~ q.tac
53− r.p.tac
54− =+ voz=$(q.tac t.q.tac)
55− (weld ram(tac i.q.tac) ?~(t.q.tac voz (weld p.p.tac voz)))
56− ==
57− ::
58−
59−Examples
60−--------
61−
62− /~zod/try=> ~(ram re leaf/"foo")
63− "foo"
64− /~zod/try=> ~(ram re rose/["." "(" ")"]^~[leaf/"bar" leaf/"baz" leaf/"bam"])
65− "(bar.baz.bam)"
66−
67−### `++win`
68−
69−Render at indent
70−
71−Render at indent level `tab` and width `edg`.
72−
73−Accepts
74−-------
75−
76−`tac` is a `++tank`, taken from [sample]() of `++re` [core]().
77−
78−`tab` and `edg` are atoms.
79−
80−Produces
81−--------
82−
83−A [`++wall`]() ([`++list`]() of [`++tapes`]()).
84−
85−Source
86−------
87−
88− ++ win
89− |= [tab=@ edg=@]
90− =+ lug=`wall`~
91− |^ |- ^- wall
92− ?- -.tac
93− %leaf (rig p.tac)
94− %palm
95− ?: fit
96− (rig ram)
97− ?~ q.tac
98− (rig q.p.tac)
99− ?~ t.q.tac
100− (rig(tab (add 2 tab), lug $(tac i.q.tac)) q.p.tac)
101− => .(q.tac `(list tank)`q.tac)
102− =+ lyn=(mul 2 (lent q.tac))
103− =+ ^= qyr
104− |- ^- wall
105− ?~ q.tac
106− lug
107− %= ^$
108− tac i.q.tac
109− tab (add tab (sub lyn 2))
110− lug $(q.tac t.q.tac, lyn (sub lyn 2))
111− ==
112− (wig(lug qyr) q.p.tac)
113− ::
114− %rose
115− ?: fit
116− (rig ram)
117− =+ ^= gyl
118− |- ^- wall
119− ?~ q.tac
120− ?:(=(%$ r.p.tac) lug (rig r.p.tac))
121− ^$(tac i.q.tac, lug $(q.tac t.q.tac), tab din)
122− ?: =(%$ q.p.tac)
123− gyl
124− (wig(lug gyl) q.p.tac)
125− ==
126− ::
127−
128−Examples
129−--------
130−
131− /~zod/try=> (~(win re leaf/"samoltekon-lapdok") 0 20)
132− <<"samoltekon-lapdok">>
133− /~zod/try=> (~(win re leaf/"samoltekon-lapdok") 0 10)
134− <<"\/samolt\/" " ekon-l" " apdok" "\/ \/">>
135− /~zod/try=> (~(win re rose/["--" "[" "]"]^~[leaf/"1423" leaf/"2316"]) 0 20)
136− <<"[1423--2316]">>
137− /~zod/try=> (~(win re rose/["--" "[" "]"]^~[leaf/"1423" leaf/"2316"]) 0 10)
138− <<"[ 1423" " 2316" "]">>
139−
140−### `++din`
141−
142−XX document
143−
144−Accepts
145−-------
146−
147−Produces
148−--------
149−
150−Source
151−------
152−
153− ++ din (mod (add 2 tab) (mul 2 (div edg 3)))
154−
155−
156−----------------------------------------------------------------------
157−
158−### `++fit`
159−
160−Fit on one line test
161−
162−Determine whether `tac` fits on one line. Internal to `++win`
163−
164−Accepts
165−-------
166−
167−Produces
168−--------
169−
170−Source
171−------
172−
173−++ fit (lte (lent ram) (sub edg tab))
174−
175−
176−Examples
177−--------
178−
179−
180−
181−
182−----------------------------------------------------------------------
183−
184−### `++rig`
185−
186−Wrap in `\/`
187−
188−Wrap [`++tape`]() in `\/` if it doesn't fit at current indentation. Internal to
189−[`++win`]()
190−
191−Accepts
192−-------
193−
194−`tac` is a `++tank`, taken from [sample]() of `++re` [core]().
195−
196−`hom` is a `++tape`.
197−
198−Produces
199−--------
200−
201−A [`++wall`]() (list of `++tape`s).
202−
203−Source
204−------
205−
206− ++ rig
207− |= hom=tape
208− ^- wall
209− ?: (lte (lent hom) (sub edg tab))
210− [(runt [tab ' '] hom) lug]
211− => .(tab (add tab 2), edg (sub edg 2))
212− =+ mut=(trim (sub edg tab) hom)
213− :- (runt [(sub tab 2) ' '] ['\\' '/' (weld p.mut `_hom`['\\' '/' ~])])
214− => .(hom q.mut)
215− |-
216− ?~ hom
217− :- %+ runt
218− [(sub tab 2) ' ']
219− ['\\' '/' (runt [(sub edg tab) ' '] ['\\' '/' ~])]
220− lug
221− => .(mut (trim (sub edg tab) hom))
222− [(runt [tab ' '] p.mut) $(hom q.mut)]
223− ::
224−
225−Examples
226−--------
227−
228−### `++wig`
229−
230−`++win` render tape
231−
232−Render [`++tape`](). Internal to [`++win`]().
233−
234−Accepts
235−-------
236−
237−`tac` is a `++tank`, taken from [sample]() of `++re` [core]().
238−
239−`hom` is a `++tape`.
240−
241−Produces
242−--------
243−
244− ++ wig
245− |= hom=tape
246− ^- wall
247− ?~ lug
248− (rig hom)
249− =+ lin=(lent hom)
250− =+ wug=:(add 1 tab lin)
251− ?. =+ mir=i.lug
252− |- ?~ mir
253− |
254− ?|(=(0 wug) ?&(=(' ' i.mir) $(mir t.mir, wug (dec wug))))
255− (rig hom) :: ^ XX regular form?
256− [(runt [tab ' '] (weld hom `tape`[' ' (slag wug i.lug)])) t.lug]
257− --
258− --
259−
260−
docs/system/hoon/library/core/si.mddeleted−478
@@ -1,478 +0,0 @@
1−### `++si`
2−
3− ++ si !: :: signed integer
4− |%
5−
6−Container core for the signed integer functions.
7−
8−------------------------------------------------------------------------
9−
10−### `++abs`
11−
12−Absolute value
13−
14−Produces the absolute value of a signed integer.
15−
16−Accepts
17−-------
18−
19−`a` is a signed integer, [`@s`]().
20−
21−Produces
22−--------
23−
24−An [atom]().
25−
26−Source
27−------
28−
29− ++ abs |=(a=@s (add (end 0 1 a) (rsh 0 1 a))) :: absolute value
30−
31−Examples
32−--------
33−
34− ~zod/try=> (abs:si -2)
35− 2
36− ~zod/try=> (abs:si -10.000)
37− 10.000
38− ~zod/try=> (abs:si --2)
39− 2
40−
41−------------------------------------------------------------------------
42−
43−### `++dif`
44−
45−Difference
46−
47−Produces the difference between two signed integers `b` and `c`.
48−
49−Accepts
50−-------
51−
52−`a` is a signed integer, [`@s`]().
53−
54−`b` is a signed integer, `@s`.
55−
56−Produces
57−--------
58−
59−A [`@s`]().
60−
61−
62−Source
63−------
64−
65− ++ dif |= [a=@s b=@s] :: subtraction
66− (sum a (new !(syn b) (abs b)))
67−
68−Examples
69−--------
70−
71− ~zod/try=> (dif:si --10 -7)
72− --17
73− ~zod/try=> (dif:si --10 --7)
74− --3
75− ~zod/try=> (dif:si `@s`0 --7)
76− -7
77− ~zod/try=> (dif:si `@s`0 `@s`7)
78− --4
79−
80−------------------------------------------------------------------------
81−
82−### `++dul`
83−
84−Modulus
85−
86−Produces the modulus of two signed integers.
87−
88−Accepts
89−-------
90−
91−`a` is a signed integer, `@s`.
92−
93−`b` is an [atom]().
94−
95−Produces
96−--------
97−
98−An atom.
99−
100−Source
101−------
102−
103− ++ dul |= [a=@s b=@] :: modulus
104− =+(c=(old a) ?:(-.c (mod +.c b) (sub b +.c)))
105−
106−Examples
107−--------
108−
109− ~zod/try=> (dul:si --9 3)
110− 0
111− ~zod/try=> (dul:si --9 4)
112− 1
113− ~zod/try=> (dul:si --9 5)
114− 4
115− ~zod/try=> (dul:si --9 6)
116− 3
117− ~zod/try=> (dul:si --90 --10)
118− 10
119−
120−------------------------------------------------------------------------
121−
122−### `++fra`
123−
124−Divide
125−
126−Produces the quotient of two signed integers.
127−
128−Accepts
129−-------
130−
131−`a` is a signed integer, [`@s`].
132−
133−`b` is a signed integer, `@s`.
134−
135−Produces
136−--------
137−
138−An [atom]().
139−
140−Source
141−------
142−
143− ++ fra |= [a=@s b=@s] :: divide
144− (new =(0 (mix (syn a) (syn b))) (div (abs a) (abs b)))
145−
146−Examples
147−--------
148−
149− ~zod/try=> (fra:si --10 -2)
150− -5
151− ~zod/try=> (fra:si -20 -5)
152− --4
153−
154−------------------------------------------------------------------------
155−
156−### `++new`
157−
158−Signed integer
159−
160−Produces a signed integer from a loobean sign value `a` and an [atom]() `b`.
161−
162−Accepts
163−-------
164−
165−`a` is a loobean.
166−
167−`b` is an atom.
168−
169−Produces
170−--------
171−
172−A [`@s`]()
173−
174−Source
175−------
176−
177− ++ new |= [a=? b=@] :: [sign value] to @s
178− `@s`?:(a (mul 2 b) ?:(=(0 b) 0 +((mul 2 (dec b)))))
179−
180−Examples
181−--------
182−
183− ~zod/try=> (new:si [& 10])
184− --10
185− ~zod/try=> (new:si [| 10])
186− -10
187− ~zod/try=> (new:si [%.y 7])
188− --7
189−
190−------------------------------------------------------------------------
191−
192−### `++old`
193−
194−[sign value]
195−
196−Produces the cell `[sign value]` representations of a signed integer.
197−
198−Accepts
199−-------
200−
201−`a` is a [`@s`]().
202−
203−Produces
204−--------
205−
206−A cell of a boolean and an [atom]().
207−
208−Source
209−------
210−
211− ++ old |=(a=@s [(syn a) (abs a)]) :: [sign value]
212−
213−Examples
214−--------
215−
216− ~zod/try=> (old:si 7)
217− ! type-fail
218− ! exit
219− ~zod/try=> (old:si -7)
220− [%.n 7]
221− ~zod/try=> (old:si --7)
222− [%.y 7]
223− ~zod/try=> (old:si `@s`7)
224− [%.n 4]
225− ~zod/try=> (old:si -0)
226− [%.y 0]
227−
228−------------------------------------------------------------------------
229−
230−### `++pro`
231−
232−Multiply
233−
234−Produces the product of two signed integers.
235−
236−Accepts
237−-------
238−
239−`a` is a [`@s`]().
240−
241−`b` is a `@s`.
242−
243−Produces
244−--------
245−
246−A `@s`.
247−
248−Source
249−------
250−
251− ++ pro |= [a=@s b=@s] :: multiplication
252− (new =(0 (mix (syn a) (syn b))) (mul (abs a) (abs b)))
253−
254−Examples
255−--------
256−
257− ~zod/try=> (pro:si -4 --2)
258− -8
259− ~zod/try=> (pro:si -4 -2)
260− --8
261− ~zod/try=> (pro:si --10.000.000 -10)
262− -100.000.000
263− ~zod/try=> (pro:si -1.337 --0)
264− --0
265−
266−------------------------------------------------------------------------
267−
268−### `++rem`
269−
270−Remainder
271−
272−Produces the remainder from a division of two signed integers.
273−
274−Accepts
275−-------
276−
277−`a` is a [`@s`]().
278−
279−`b` is a `@s`.
280−
281−Produces
282−--------
283−
284−A `@sd`.
285−
286−Source
287−------
288−
289− ++ rem |=([a=@s b=@s] (dif a (pro b (fra a b)))) :: remainder
290−
291−Examples
292−--------
293−
294− ~zod/try=> (rem:si -10 -4)
295− -2
296− ~zod/try=> (rem:si --10 --4)
297− --2
298− ~zod/try=> (rem:si --10 -4)
299− --2
300− ~zod/try=> (rem:si --7 --3)
301− --1
302− ~zod/try=> (rem:si --0 --10.000)
303− --0
304−
305−------------------------------------------------------------------------
306−
307−### `++sum`
308−
309−Add
310−
311−Sum two signed integers.
312−
313−Accepts
314−-------
315−
316−`b` is a [`@s`]().
317−
318−`c` is a signed integer `@s`.
319−
320−Produces
321−--------
322−
323−A `@s`.
324−
325−Source
326−------
327−
328− ++ sum |= [a=@s b=@s] :: addition
329− ~| %si-sum
330− =+ [c=(old a) d=(old b)]
331− ?: -.c
332− ?: -.d
333− (new & (add +.c +.d))
334− ?: (gte +.c +.d)
335− (new & (sub +.c +.d))
336− (new | (sub +.d +.c))
337− ?: -.d
338− ?: (gte +.c +.d)
339− (new | (sub +.c +.d))
340− (new & (sub +.d +.c))
341− (new | (add +.c +.d))
342−
343−Examples
344−--------
345−
346− ~zod/try=> (sum:si --10 --10)
347− --20
348− ~zod/try=> (sum:si --10 -0)
349− --10
350− ~zod/try=> (sum:si -10 -7)
351− -17
352− ~zod/try=> (sum:si -10 --7)
353− -3
354−
355−------------------------------------------------------------------------
356−
357−### `++sun`
358−
359−Signed from unsigned
360−
361−Produces a signed integer from an unsigned integer.
362−
363−Note that the result must be manually cast to some [`@s`]() odor to be
364−inferred as an unsigned integer in the type system.
365−
366−Accepts
367−-------
368−
369−`a` is a [`@u`]().
370−
371−Produces
372−--------
373−
374−A [`@s`]().
375−
376−Source
377−------
378−
379− ++ sun |=(a=@u (mul 2 a)) :: @u to @s
380−
381−Examples
382−--------
383−
384− ~zod/try=> `@s`10
385− --5
386− ~zod/try=> (sun:si 10)
387− 20
388− ~zod/try=> `@s`(sun:si 10)
389− --10
390− ~zod/try=> `@sd`(sun:si 10)
391− --10
392− ~zod/try=> `@sd`(sun:si 12.345)
393− --12.345
394−
395−------------------------------------------------------------------------
396−
397−### `++syn`
398−
399−Sign
400−
401−Produce the sign of a signed integer, where `&` is posiitve, and `|` is negative.
402−
403−Accepts
404−-------
405−
406−`a` is a [`@s`]().
407−
408−Produces
409−--------
410−
411−A boolean.
412−
413−Source
414−------
415−
416− ++ syn |=(a=@s =(0 (end 0 1 a))) :: sign test
417−
418−Examples
419−--------
420−
421− ~zod/try=> (syn:si -2)
422− %.n
423− ~zod/try=> (syn:si --2)
424− %.y
425− ~zod/try=> (syn:si -0)
426− %.y
427−
428−------------------------------------------------------------------------
429−
430−### `++cmp`
431−
432−Compare
433−
434−Compare two signed integers.
435−
436−Accepts
437−-------
438−
439−`b` is a [`@s`]().
440−
441−`c` is a `@s`.
442−
443−Produces
444−--------
445−
446−A `@s`.
447−
448−Source
449−------
450−
451− ++ cmp |= [a=@s b=@s] :: compare
452− ^- @s
453− ?: =(a b)
454− --0
455− ?: (syn a)
456− ?: (syn b)
457− ?: (gth a b)
458− --1
459− -1
460− --1
461− ?: (syn b)
462− -1
463− ?: (gth a b)
464− -1
465− --1
466−
467−Examples
468−--------
469−
470− ~zod/try=> (cmp:si --10 --10)
471− --0
472− ~zod/try=> (cmp:si --10 -0)
473− --1
474− ~zod/try=> (cmp:si -10 -7)
475− -1
476− ~zod/try=> (cmp:si -10 --7)
477− -1
478−
docs/system/hoon/library/core/so.mddeleted−476
@@ -1,476 +0,0 @@
1−### `++so`
2−
3−Coin parser engine
4−
5−Core containing arms that parse [`++coin`]s.
6−
7−Accepts
8−-------
9−
10−Produces
11−--------
12−
13−Source
14−------
15−
16− ++ so
17− |%
18−
19−Examples
20−--------
21−
22− ~zod/try=> so
23− <10.mkn 414.hhh 100.xkc 1.ypj %164>
24−
25−------------------------------------------------------------------------
26−
27−### `++bisk`
28−
29−Parse odor-atom pair
30−
31−Parsing rule. Parses an unsigned integer of any permitted base,
32−producing a [`++dime`]().
33−
34−Accepts
35−-------
36−
37−Produces
38−--------
39−
40−Source
41−------
42−
43− ++ bisk
44− ;~ pose
45− ;~ pfix (just '0')
46− ;~ pose
47− (stag %ub ;~(pfix (just 'b') bay:ag))
48− (stag %ui ;~(pfix (just 'i') dim:ag))
49− (stag %ux ;~(pfix (just 'x') hex:ag))
50− (stag %uv ;~(pfix (just 'v') viz:ag))
51− (stag %uw ;~(pfix (just 'w') wiz:ag))
52− ==
53− ==
54− (stag %ud dem:ag)
55− ==
56−
57−Examples
58−--------
59−
60− ~zod/try=> (scan "25" bisk:so)
61− [%ud q=25]
62− ~zod/try=> (scan "0x12.6401" bisk:so)
63− [%ux q=1.205.249]
64−
65−------------------------------------------------------------------------
66−
67−### `++crub`
68−
69−Parse `@da`, `@dr`, `@p`, `@t`
70−
71−Parsing rule. Parses any atom of any of the following odors after a
72−leading sig, `~` into a [`++dime`](): [`@da`](), [`@dr`](), [`@p`](),
73−and [`@t`](), producing a [`++dime`]().
74−
75−Accepts
76−-------
77−
78−Produces
79−--------
80−
81−Source
82−------
83−
84− ++ crub
85− ;~ pose
86− %+ cook
87− |=(det=date `dime`[%da (year det)])
88− ;~ plug
89− %+ cook
90− |=([a=@ b=?] [b a])
91− ;~(plug dim:ag ;~(pose (cold | hep) (easy &)))
92− ;~(pfix dot dim:ag) :: month
93− ;~(pfix dot dim:ag) :: day
94− ;~ pose
95− ;~ pfix
96− ;~(plug dot dot)
97− ;~ plug
98− dum:ag
99− ;~(pfix dot dum:ag)
100− ;~(pfix dot dum:ag)
101− ;~(pose ;~(pfix ;~(plug dot dot) (most dot qix:ab)) (easy ~))
102− ==
103− ==
104− (easy [0 0 0 ~])
105− ==
106− ==
107− ::
108− %+ cook
109− |= [a=(list ,[p=?(%d %h %m %s) q=@]) b=(list ,@)]
110− =+ rop=`tarp`[0 0 0 0 b]
111− |- ^- dime
112− ?~ a
113− [%dr (yule rop)]
114− ?- p.i.a
115− %d $(a t.a, d.rop (add q.i.a d.rop))
116− %h $(a t.a, h.rop (add q.i.a h.rop))
117− %m $(a t.a, m.rop (add q.i.a m.rop))
118− %s $(a t.a, s.rop (add q.i.a s.rop))
119− ==
120− ;~ plug
121− %+ most
122− dot
123− ;~ pose
124− ;~(pfix (just 'd') (stag %d dim:ag))
125− ;~(pfix (just 'h') (stag %h dim:ag))
126− ;~(pfix (just 'm') (stag %m dim:ag))
127− ;~(pfix (just 's') (stag %s dim:ag))
128− ==
129− ;~(pose ;~(pfix ;~(plug dot dot) (most dot qix:ab)) (easy ~))
130− ==
131− ::
132− (stag %p fed:ag)
133− ;~(pfix dot (stag %ta urs:ab))
134− ;~(pfix sig (stag %t (cook woad urs:ab)))
135− ;~(pfix hep (stag %c (cook turf (cook woad urs:ab))))
136− ==
137−
138−Examples
139−--------
140−
141− ~zod/try=> (scan "1926.5.12" crub:so)
142− [p=~.da q=170.141.184.449.747.016.871.285.095.307.149.312.000]
143− ~zod/try=> (,[%da @da] (scan "1926.5.12" crub:so))
144− [%da ~1926.5.12]
145− ~zod/try=> (scan "s10" crub:so)
146− [p=~.dr q=184.467.440.737.095.516.160]
147− ~zod/try=> (,[%dr @dr] (scan "s10" crub:so))
148− [%dr ~s10]
149− ~zod/try=> (scan "doznec" crub:so)
150− [%p 256]
151− ~zod/try=> (scan ".mas" crub:so)
152− [%ta 7.561.581]
153−
154−------------------------------------------------------------------------
155−
156−### `++nuck`
157−
158−Top-level coin parser
159−
160−Parsing rule. Switches on the first character and applies the
161−corresponding [`++coin`]() parser.
162−
163−Accepts
164−-------
165−
166−Produces
167−--------
168−
169−Source
170−------
171−
172− ++ nuck
173− %+ knee *coin |. ~+
174− %- stew
175− ^. stet ^. limo
176− :~ :- ['a' 'z'] (cook |=(a=@ta [~ %tas a]) sym)
177− :- ['0' '9'] (stag ~ bisk)
178− :- '-' (stag ~ tash)
179− :- '.' ;~(pfix dot perd)
180− :- '~' ;~(pfix sig ;~(pose twid (easy [~ %n 0])))
181− ==
182−
183−Examples
184−--------
185−
186− ~zod/try=> (scan "~pillyt" nuck:so)
187− [% p=[p=~.p q=32.819]]
188− ~zod/try=> (scan "0x12" nuck:so)
189− [% p=[p=~.ux q=18]]
190− ~zod/try=> (scan ".127.0.0.1" nuck:so)
191− [% p=[p=~.if q=2.130.706.433]]
192− ~zod/try=> `@ud`.127.0.0.1
193− 2.130.706.433
194− ~zod/try=> (scan "._20_0w25_sam__" nuck:so)
195− [ %many
196− p
197− ~[[% p=[p=~.ud q=20]] [% p=[p=~.uw q=133]] [% p=[p=~.tas q=7.168.371]]]
198− ]
199− ~zod/try=> `@`%sam
200− 7.168.371
201− ~zod/try=> (scan "~0ph" nuck:so)
202− [%blob p=[1 1]]
203− ~zod/try=> ~0ph
204− [1 1]
205− ~zod/try=> `@uv`(jam [1 1])
206− 0vph
207−
208−------------------------------------------------------------------------
209−
210−### `++nusk`
211−
212−Parse coin literal with escapes
213−
214−Parsing rule. Parses a coin literal with escapes. (See also: xx tuple
215−formatting).
216−
217−Accepts
218−-------
219−
220−Produces
221−--------
222−
223−Source
224−------
225−
226− ++ nusk
227− (sear |=(a=@ta (rush (wick a) nuck)) urt:ab)
228−
229−Examples
230−--------
231−
232− ~zod/try=> ~.asd_a
233− ~.asd_a
234− ~zod/try=> ._1_~~.asd~-a__
235− [1 ~.asd_a]
236− ~zod/try=> (scan "~~.asd~-a" nusk:so)
237− [% p=[p=~.ta q=418.212.246.369]]
238− ~zod/try=> (,[~ %ta @ta] (scan "~~.asd~-a" nusk:so))
239− [~ %ta ~.asd_a]
240−
241−------------------------------------------------------------------------
242−
243−### `++perd`
244−
245−Parsing rule.
246−
247−Parsing rule. Parses a dime or tuple without their respective standard
248−prefixes.
249−
250−Accepts
251−-------
252−
253−Produces
254−--------
255−
256−Source
257−------
258−
259− ++ perd
260− ;~ pose
261− (stag ~ zust)
262− (stag %many (ifix [cab ;~(plug cab cab)] (more cab nusk)))
263− ==
264−
265−Examples
266−--------
267−
268− ~zod/try=> (scan "y" perd:so)
269− [~ [%f %.y]]
270− ~zod/try=> (scan "n" perd:so)
271− [~ [%f %.n]]
272− ~zod/try=> |
273− %.n
274− ~zod/try=> (scan "_20_x__" perd:so)
275− [%many [[% p=[p=~.ud q=20]] ~[[% p=[p=~.tas q=120]]]]]
276−
277−------------------------------------------------------------------------
278−
279−### `++royl`
280−
281−Parse dime float
282−
283−Parsing rule. Parses a number into a [`++dime`]() float.
284−
285−Accepts
286−-------
287−
288−Produces
289−--------
290−
291−Source
292−------
293−
294− ++ royl
295− =+ ^= zer
296− (cook lent (star (just '0')))
297− =+ ^= voy
298− %+ cook royl-cell
299− ;~ plug
300− ;~(pose (cold | hep) (easy &))
301− ;~(plug dim:ag ;~(pose ;~(pfix dot ;~(plug zer dim:ag)) (easy [0 0])))
302− ;~ pose
303− ;~ pfix
304− (just 'e')
305− (cook some ;~(plug ;~(pose (cold | hep) (easy &)) dim:ag))
306− ==
307− (easy ~)
308− ==
309− ==
310− ;~ pose
311− (stag %rh (cook rylh ;~(pfix ;~(plug sig sig) voy)))
312− (stag %rq (cook rylq ;~(pfix ;~(plug sig sig sig) voy)))
313− (stag %rd (cook ryld ;~(pfix sig voy)))
314− (stag %rs (cook ryls voy)
315− ==
316−
317−Examples
318−--------
319−
320− ~zod/try=> (scan "~3.14" royl:so)
321− [%rd .~3.13999999999999]
322− ~zod/try=> .~3.14
323− .~3.13999999999999
324−
325−------------------------------------------------------------------------
326−
327−### `++royl-cell`
328−
329−XX still not fully functional
330−
331−Intermediate parsed float convereter
332−
333−------------------------------------------------------------------------
334−
335−### `++tash`
336−
337−Parse signed dime
338−
339−Accepts
340−-------
341−
342−Accepts
343−-------
344−
345−Produces
346−--------
347−
348−Produces
349−--------
350−
351−Parsing rule. Parses a signed number into a [`++dime`]().
352−
353−Source
354−------
355−
356− ++ royl-cell
357− |= [a=? b=[c=@ d=@ e=@] f=(unit ,[h=? i=@])]
358− ^- [? @ @ @ (unit ,@s)]
359− ?~ f
360− [a c.b d.b e.b ~]
361− ?: h.u.f
362− [a c.b d.b e.b [~ (mul i.u.f 2)]]
363− [a c.b d.b e.b [~ (dec (mul i.u.f 2))]]
364−
365−Examples
366−--------
367−
368−Source
369−------
370−
371− ++ tash
372− =+ ^= neg
373− |= [syn=? mol=dime] ^- dime
374− ?> =('u' (end 3 1 p.mol))
375− [(cat 3 's' (rsh 3 1 p.mol)) (new:si syn q.mol)]
376− ;~ pfix hep
377− ;~ pose
378− (cook |=(a=dime (neg | a)) bisk)
379− ;~(pfix hep (cook |=(a=dime (neg & a)) bisk))
380− ==
381− ==
382−
383−Examples
384−--------
385−
386− ~zod/try=> (scan "-20" tash:so)
387− [p=~.sd q=39]
388− ~zod/try=> (,[%sd @sd] (scan "-20" tash:so))
389− [%sd -20]
390− ~zod/try=> (,[%sd @sd] (scan "--20" tash:so))
391− [%sd --20]
392− ~zod/try=> (,[%sx @sx] (scan "--0x2e" tash:so))
393− [%sx --0x2e]
394−
395−------------------------------------------------------------------------
396−
397−### `++twid`
398−
399−Parse coins without `~` prefix
400−
401−Parsing rule. Parses coins after a leading sig, `~`.
402−
403−Accepts
404−-------
405−
406−Produces
407−--------
408−
409−Source
410−------
411−
412− ++ twid
413− ;~ pose
414− (cook |=(a=@ [%blob (cue a)]) ;~(pfix (just '0') vum:ag))
415− (stag ~ crub)
416− ==
417− ::
418−
419−Examples
420−--------
421−
422− ~zod/try=> (scan "zod" twid:so)
423− [~ [%p 0]]
424− ~zod/try=> (scan ".sam" twid:so)
425− [~ [%ta 7.168.371]]
426− ~zod/try=> `@ud`~.sam
427− 7.168.371
428− ~zod/try=> `@t`~.sam
429− 'sam'
430− ~zod/try=> (scan "0ph" twid:so)
431− [%blob [1 1]]
432−
433−------------------------------------------------------------------------
434−
435−### `++zust`
436−
437−Parse prefixed dimes from `@if`, `@f`, `@rd`
438−
439−Parsing rule. Parses an atom of either [`@if`]() (IP address), [`@f`]()
440−(loobean), or [`rf`]()(floating point) into a [`++dime`]().
441−
442−Accepts
443−-------
444−
445−Produces
446−--------
447−
448−Source
449−------
450−
451− ++ zust
452− ;~ pose
453− (stag %is bip:ag)
454− (stag %if lip:ag)
455− (stag %f ;~(pose (cold & (just 'y')) (cold | (just 'n'))))
456− royl
457− ==
458− --
459−
460−Examples
461−--------
462−
463− ~zod/try=> (scan "127.0.0.1" zust:so)
464− [%if q=2.130.706.433]
465− ~zod/try=> (scan "af.0.0.0.0.e7a5.30d2.7" zust:so)
466− [%is q=908.651.950.243.594.834.993.091.554.288.205.831]
467− ~zod/try=> (,[%is @is] (scan "af.0.0.0.0.e7a5.30d2.7" zust:so))
468− [%is .af.0.0.0.0.e7a5.30d2.7]
469− ~zod/try=> (,[%is @ux] (scan "af.0.0.0.0.e7a5.30d2.7" zust:so))
470− [%is 0xaf.0000.0000.0000.0000.e7a5.30d2.0007]
471− ~zod/try=> (scan "y" zust:so)
472− [%f %.y]
473− ~zod/try=> (scan "12.09" zust:so)
474− [%rd .~12.00999999999999]
475−
476−
docs/system/hoon/library/core/to.mddeleted−331
@@ -1,331 +0,0 @@
1−### `++to`
2−
3−Queue operations
4−
5−Container arm for queue operation arms. The contained arms inherit its
6−[sample]() `++qeu` `a`.
7−
8−Accepts
9−-------
10−
11−`a` is a queue, [++qeu]().
12−
13−Source
14−------
15−
16− ++ to :: queue engine
17− |/ a=(qeu)
18−
19−### `+-bal:to`
20−
21−Balance
22−
23−Vertically rebalances queue `a`.
24−
25−Accepts
26−-------
27−
28−`a` is a [queue]().
29−
30−Produces
31−--------
32−
33−A [queue]().
34−
35−Source
36−------
37−
38− +- bal
39− |- ^+ a
40− ?~ a ~
41− ?. |(?=(~ l.a) (vor n.a n.l.a))
42− $(a [n.l.a l.l.a $(a [n.a r.l.a r.a])])
43− ?. |(?=(~ r.a) (vor n.a n.r.a))
44− $(a [n.r.a $(a [n.a l.a l.r.a]) r.r.a])
45− a
46− ::
47−
48−Examples
49−--------
50−
51− ~zod/try=> `(qeu tape)`["a" ~ "b" ~ "c" ~ "d" ~ "e" ~ "f" ~ "g" ~ ~]
52− {"a" "b" "c" "d" "e" "f" "g"}
53− ~zod/try=> `*`["a" ~ "b" ~ "c" ~ "d" ~ "e" ~ "f" ~ "g" ~ ~]
54− [[97 0] 0 [98 0] 0 [99 0] 0 [100 0] 0 [101 0] 0 [102 0] 0 [103 0] 0 0]
55− ~zod/try=> ~(bal to `(qeu tape)`["a" ~ "b" ~ "c" ~ "d" ~ "e" ~ "f" ~ "g" ~ ~])
56− {"a" "b" "c" "d" "e" "f" "g"}
57− ~zod/try=> `*`~(bal to `(qeu tape)`["a" ~ "b" ~ "c" ~ "d" ~ "e" ~ "f" ~ "g" ~ ~])
58− [[100 0] [[99 0] [[98 0] [[97 0] 0 0] 0] 0] [101 0] 0 [102 0] 0 [103 0] 0 0]
59−
60−------------------------------------------------------------------------
61−
62−### `+-dep:to`
63−
64−Maximum Depth
65−
66−Produces the maximum depth of leaves (r.a and l.a) in queue `a`.
67−
68−Accepts
69−-------
70−
71−`a` is a [queue]().
72−
73−Produces
74−--------
75−
76−An atom.
77−
78−Source
79−------
80−
81− +- dep :: max depth of queue
82− |- ^- @
83− ?~ a 0
84− +((max $(a l.a) $(a r.a)))
85− ::
86−
87−Examples
88−--------
89−
90− ~zod/try=> =a (~(gas to `(qeu ,@)`~) `(list ,@)`[1 2 3 4 5 6 7 ~])
91− ~zod/try=> ~(dep to a)
92− 4
93− ~zod/try=> =a (~(gas to `(qeu ,@)`~) `(list ,@)`[1 2 3 4 ~])
94− ~zod/try=> ~(dep to a)
95− 3
96− ~zod/try=> =a (~(gas to `(qeu ,@)`~) `(list ,@)`[1 2 ~])
97− ~zod/try=> ~(dep to a)
98− 2
99− ~zod/try=> ~(dep to `(qeu tape)`["a" ~ "b" ~ "c" ~ "d" ~ "e" ~ "f" ~ "g" ~ ~])
100− 7
101− ~zod/try=> ~(dep to ~(bal to `(qeu tape)`["a" ~ "b" ~ "c" ~ "d" ~ "e" ~ "f" ~ "g" ~ ~]))
102− 4
103−
104−------------------------------------------------------------------------
105−
106−### `+-gas`
107−
108−Push list
109−
110−Push all elements of [`++list`]() `b` into the [`++queue`]().
111−
112−Accepts
113−-------
114−
115−`a` is a queue.
116−
117−`b` is a list.
118−
119−Produces
120−--------
121−
122−A queue.
123−
124−Source
125−------
126−
127− +- gas :: insert list to queue
128− |= b=(list ,_?>(?=(^ a) n.a))
129− |- ^+ a
130− ?~(b a $(b t.b, a (put(+< a) i.b)))
131− ::
132−
133−Examples
134−--------
135−
136− ~zod/try=> (~(gas to `(qeu ,@)`~) `(list ,@)`[1 2 3 ~])
137− {3 2 1}
138− ~zod/try=> =a (~(gas to `(qeu ,@)`~) `(list ,@)`[1 2 3 ~])
139− ~zod/try=> =b `(list ,@)`[4 5 6 ~]
140− ~zod/try=> (~(gas to a) b)
141− {6 5 4 3 2 1}
142−
143−------------------------------------------------------------------------
144−
145−### `+-get:to`
146−
147−Pop
148−
149−Produces the head and tail [`++queue`]() of `a`.
150−
151−Accepts
152−-------
153−
154−`a` is a queue.
155−
156−Produces
157−--------
158−
159−The last element in `a` along with the rest of queue `a`.
160−
161−Source
162−------
163−
164− +- get :: head-tail pair
165− |- ^+ [p=?>(?=(^ a) n.a) q=a]
166− ?~ a
167− !!
168− ?~ r.a
169− [n.a l.a]
170− =+ b=$(a r.a)
171− :- p.b
172− ?: |(?=(~ q.b) (vor n.a n.q.b))
173− [n.a l.a q.b]
174− [n.q.b [n.a l.a l.q.b] r.q.b]
175− ::
176−
177−Examples
178−--------
179−
180− ~zod/try=> =s (~(gas to *(qeu ,@)) `(list ,@)`~[1 2 3])
181− ~zod/try=> ~(get to s)
182− [p=1 q={3 2}]
183− ~zod/try=> ~(get to ~)
184− ! exit
185−
186−------------------------------------------------------------------------
187−
188−### `+-nap:to`
189−
190−Remove last element
191−
192−Removes the head of [`++queue`]() `a`, producing the resulting queue.
193−
194−Accepts
195−-------
196−
197−`a` is a [queue]().
198−
199−Produces
200−--------
201−
202−A queue.
203−
204−Source
205−------
206−
207− +- nap :: removes head
208− ?> ?=(^ a)
209− ?: =(~ l.a) r.a
210− =+ b=get(+< l.a)
211− bal(+< ^+(a [p.b q.b r.a]))
212− ::
213−
214−Examples
215−--------
216−
217− ~zod/try=> =a (~(gas to `(qeu ,@)`~) `(list ,@)`[1 2 3 4 5 6 ~])
218− ~zod/try=> -.a
219− n=6
220− ~zod/try=> =b ~(nap to a)
221− ~zod/try=> -.b
222− n=2
223− ~zod/try=> b
224− {5 4 3 2 1}
225− ~zod/try=> a
226− {6 5 4 3 2 1}
227−
228−------------------------------------------------------------------------
229−
230−### `+-put:to`
231−
232−Insert
233−
234−Accept any [noun]() `b` and adds to [`++queue`]() `a` as the head, producing the
235−resulting queue.
236−
237−Accepts
238−-------
239−
240−`a` is a [queue]().
241−
242−`b` is any noun.
243−
244−Produces
245−--------
246−
247−A queue.
248−
249−Source
250−------
251−
252− +- put :: insert new tail
253− |* b=*
254− |- ^+ a
255− ?~ a
256− [b ~ ~]
257− bal(+< a(l $(a l.a)))
258− ::
259−
260−Examples
261−--------
262−
263− ~zod/try=> (~(gas to `(qeu ,@)`~) `(list ,@)`[3 1 2 4 5 6 ~])
264− ~zod/try=> (~(put to a) 7)
265− {7 6 5 4 2 1 3}
266−
267−------------------------------------------------------------------------
268−
269−### `+-tap:to`
270−
271−Queue to list
272−
273−Produces [`++queue`]() `a` as a [`++list`]() from front to back.
274−
275−Accepts
276−-------
277−
278−`a` is a [queue]().
279−
280−Source
281−------
282−
283− +- tap :: queue to list
284− |= b=(list ,_?>(?=(^ a) n.a))
285− ^+ b
286− ?~ a
287− b
288− $(a r.a, b [n.a $(a l.a)])
289− ::
290−
291−Examples
292−--------
293−
294− ~zod/try=> =a (~(gas to `(qeu ,@)`~) `(list ,@)`[3 1 2 4 5 6 ~])
295− ~zod/try=> `*`a
296− [6 0 2 [4 [5 0 0] 0] 1 0 3 0 0]
297− ~zod/try=> (~(tap to a) `(list ,@)`[99 100 101 ~])
298− ~[3 1 2 4 5 6 99 100 101]
299−
300−------------------------------------------------------------------------
301−
302−### `+-top:to`
303−
304−Produces the head of [`++queue`]() `a` as a [`++unit`]() (an empty queue has no head).
305−
306−Accepts
307−-------
308−
309−`a` is a [queue]().
310−
311−Produces
312−--------
313−
314−A unit.
315−
316−Source
317−------
318−
319− +- top :: produces head
320− |- ^- (unit ,_?>(?=(^ a) n.a))
321− ?~ a ~
322− ?~(r.a [~ n.a] $(a r.a))
323−
324−Examples
325−--------
326−
327− ~zod/try=> =a (~(gas to `(qeu ,@)`~) `(list ,@)`[1 2 3 4 5 6 ~])
328− ~zod/try=> ~(top to a)
329− [~ 1]
330−
331−
docs/system/hoon/library/core/un.mddeleted−364
@@ -1,364 +0,0 @@
1−### `++un`
2−
3−Reversible scrambling core
4−
5− ++ un :: =(x (wred (wren x)))
6− |%
7−
8−A core that contains arms that perform reversible scrambling operations.
9−Used in the `@p` phonetic base.
10−
11−------------------------------------------------------------------------
12−
13−### `++wren`
14−
15−Conceal structure
16−
17−Scrambles a bytestring `pyn` by adding the current position to each
18−byte, looking it up in an s-box, and then performing the XOR operation
19−on the result, pushing it forward. Produces an atom.
20−
21−Accepts
22−-------
23−
24−`pyn` is an [atom]().
25−
26−
27−Produces
28−--------
29−
30−Source
31−------
32−
33− ++ wren :: conceal structure
34− |= pyn=@ ^- @
35− =+ len=(met 3 pyn)
36− ?: =(0 len)
37− 0
38− => .(len (dec len))
39− =+ mig=(zaft (xafo len (cut 3 [len 1] pyn)))
40− %+ can 3
41− %- flop ^- (list ,[@ @])
42− :- [1 mig]
43− |- ^- (list ,[@ @])
44− ?: =(0 len)
45− ~
46− => .(len (dec len))
47− =+ mog=(zyft :(mix mig (end 3 1 len) (cut 3 [len 1] pyn)))
48− [[1 mog] $(mig mog)]
49− ::
50−
51−Examples
52−--------
53−
54− ~zod/try=> `@ux`(wren:un 'testing')
55− 0x30.bf6a.b9fe.7d8f
56− ~zod/try=> `@ux`'testing'
57− 0x67.6e69.7473.6574
58− ~zod/try=> `@da`(wred:un (wren:un ~2001.2.5))
59− ~2001.2.5
60−
61−------------------------------------------------------------------------
62−
63−### `++wred`
64−
65−Restore structure
66−
67−Unscrambles a bytestring `cry` by subtracting the current position from
68−each byte, looking it up in an s-box, and performing the XOR operation
69−on the result, pushing it forward. Produces an atom.
70−
71−Accepts
72−-------
73−
74−`cry` is an [atom]().
75−
76−Produces
77−--------
78−
79−Source
80−------
81−
82− ++ wred :: restore structure
83− |= cry=@ ^- @
84− =+ len=(met 3 cry)
85− ?: =(0 len)
86− 0
87− => .(len (dec len))
88− =+ mig=(cut 3 [len 1] cry)
89− %+ can 3
90− %- flop ^- (list ,[@ @])
91− :- [1 (xaro len (zart mig))]
92− |- ^- (list ,[@ @])
93− ?: =(0 len)
94− ~
95− => .(len (dec len))
96− =+ mog=(cut 3 [len 1] cry)
97− [[1 :(mix mig (end 3 1 len) (zyrt mog))] $(mig mog)]
98− ::
99−
100−Examples
101−--------
102−
103− ~zod/try=> (wred:un 0x30.bf6a.b9fe.7d8f)
104− 29.113.321.805.538.676
105− ~zod/try=> `@t`(wred:un 0x30.bf6a.b9fe.7d8f)
106− 'testing'
107− ~zod/try=> (wred:un (wren:un 200.038.426))
108− 200.038.426
109−
110−------------------------------------------------------------------------
111−
112−### `++xafo`
113−
114−Add modulo 255
115−
116−Produces the sum of two atoms modulo 255, encoded as a nonzero byte.
117−
118−Accepts
119−-------
120−
121−A cell of two atoms, `a` and `b`.
122−
123−Source
124−------
125−
126− ++ xafo |=([a=@ b=@] +((mod (add (dec b) a) 255)))
127−
128−Examples
129−--------
130−
131− ~zod/try=> (xafo:un 5 6)
132− 11
133− ~zod/try=> (xafo:un 256 20)
134− 21
135−
136−------------------------------------------------------------------------
137−
138−### `++xaro`
139−
140−Subtract modulo 255
141−
142−Produces the difference between two atoms modulo 255, encoded as a
143−nonzero byte.
144−
145−Accepts
146−-------
147−
148−A cell of two atoms, `a` and `b`.
149−
150−Produces
151−--------
152−
153−An atom.
154−
155−Source
156−------
157−
158− ++ xaro |=([a=@ b=@] +((mod (add (dec b) (sub 255 (mod a 255))) 255)))
159−
160−Examples
161−--------
162−
163− ~zod/try=> (xaro:un 17 57)
164− 40
165− ~zod/try=> (xaro:un 265 12)
166− 2
167−
168−------------------------------------------------------------------------
169−
170−### `++zaft`
171−
172−Look up in 255 sub box
173−
174−The inverse of [`++zart`](). Looks up a nonzero byte`a\` in a substiution
175−box with 255 values, producing a unique nonzero byte.
176−
177−Accepts
178−-------
179−
180−`a` is an atom of one byte in length.
181−
182−
183−Produces
184−--------
185−
186−An atom.
187−
188−Source
189−------
190−
191− ++ zaft :: forward 255-sbox
192− |= a=@D
193− =+ ^= b
194− 0xcc.75bc.86c8.2fb1.9a42.f0b3.79a0.92ca.21f6.1e41.cde5.fcc0.
195− 7e85.51ae.1005.c72d.1246.07e8.7c64.a914.8d69.d9f4.59c2.8038.
196− 1f4a.dca2.6fdf.66f9.f561.a12e.5a16.f7b0.a39f.364e.cb70.7318.
197− 1de1.ad31.63d1.abd4.db68.6a33.134d.a760.edee.5434.493a.e323.
198− 930d.8f3d.3562.bb81.0b24.43cf.bea5.a6eb.52b4.0229.06b2.6704.
199− 78c9.45ec.d75e.58af.c577.b7b9.c40e.017d.90c3.87f8.96fa.1153.
200− 0372.7f30.1c32.ac83.ff17.c6e4.d36d.6b55.e2ce.8c71.8a5b.b6f3.
201− 9d4b.eab5.8b3c.e7f2.a8fe.9574.5de0.bf20.3f15.9784.9939.5f9c.
202− e609.564f.d8a4.b825.9819.94aa.2c08.8e4c.9b22.477a.2840.3ed6.
203− 3750.6ef1.44dd.89ef.6576.d00a.fbda.9ed2.3b6c.7b0c.bde9.2ade.
204− 5c88.c182.481a.1b0f.2bfd.d591.2726.57ba
205− (cut 3 [(dec a) 1] b)
206− ::
207−
208−Examples
209−--------
210−
211− ~zod/try=> (zaft:un 0x12)
212− 42
213− ~zod/try=> (zaft:un 0xff)
214− 204
215− ~zod/try=> (zaft:un 0x0)
216− ! decrement-underflow
217− ! exit
218−
219−------------------------------------------------------------------------
220−
221−### `++zart`
222−
223−Reverse look up in 255 sub box
224−
225−The inverse of [`++zaft`](). Looks up the index of a nonzero byte `a` in
226−the substitution box with 255 values, producing a unique nonzero byte.
227−
228−Accepts
229−-------
230−
231−`a` is an atom of one byte in length.
232−
233−Produces
234−--------
235−
236−An atom.
237−
238−Source
239−------
240−
241− ++ zart :: reverse 255-sbox
242− |= a=@D
243− =+ ^= b
244− 0x68.4f07.ea1c.73c9.75c2.efc8.d559.5125.f621.a7a8.8591.5613.
245− dd52.40eb.65a2.60b7.4bcb.1123.ceb0.1bd6.3c84.2906.b164.19b3.
246− 1e95.5fec.ffbc.f187.fbe2.6680.7c77.d30e.e94a.9414.fd9a.017d.
247− 3a7e.5a55.8ff5.8bf9.c181.e5b6.6ab2.35da.50aa.9293.3bc0.cdc6.
248− f3bf.1a58.4130.f844.3846.744e.36a0.f205.789e.32d8.5e54.5c22.
249− 0f76.fce7.4569.0d99.d26e.e879.dc16.2df4.887f.1ffe.4dba.6f5d.
250− bbcc.2663.1762.aed7.af8a.ca20.dbb4.9bc7.a942.834c.105b.c4d4.
251− 8202.3e61.a671.90e6.273d.bdab.3157.cfa4.0c2e.df86.2496.f7ed.
252− 2b48.2a9d.5318.a343.d128.be9c.a5ad.6bb5.6dfa.c5e1.3408.128d.
253− 2c04.0339.97a1.2ff0.49d0.eeb8.6c0a.0b37.b967.c347.d9ac.e072.
254− e409.7b9f.1598.1d3f.33de.8ce3.8970.8e7a
255− (cut 3 [(dec a) 1] b)
256− ::
257−
258−Examples
259−--------
260−
261− ~zod/try=> `@ux`(zart:un 204)
262− 0xff
263− ~zod/try=> `@ux`(zart:un 42)
264− 0x12
265−
266−------------------------------------------------------------------------
267−
268−### `++zyft`
269−
270−Lookup byte in 256 sub box
271−
272−The inverse of [`++zyrt`](). Looks up a byte `a` in a substituion box
273−with 256 values, producing a byte.
274−
275−Accepts
276−-------
277−
278−`a` is an [atom]() of one byte in length.
279−
280−Produces
281−--------
282−
283−An atom.
284−
285−Source
286−------
287−
288− ++ zyft :: forward 256-sbox
289− |= a=@D
290− =+ ^= b
291− 0xbb49.b71f.b881.b402.17e4.6b86.69b5.1647.115f.dddb.7ca5.
292− 8371.4bd5.19a9.b092.605d.0d9b.e030.a0cc.78ba.5706.4d2d.
293− 986a.768c.f8e8.c4c7.2f1c.effe.3cae.01c0.253e.65d3.3872.
294− ce0e.7a74.8ac6.daac.7e5c.6479.44ec.4143.3d20.4af0.ee6c.
295− c828.deca.0377.249f.ffcd.7b4f.eb7d.66f2.8951.042e.595a.
296− 8e13.f9c3.a79a.f788.6199.9391.7fab.6200.4ce5.0758.e2f1.
297− 7594.c945.d218.4248.afa1.e61a.54fb.1482.bea4.96a2.3473.
298− 63c2.e7cb.155b.120a.4ed7.bfd8.b31b.4008.f329.fca3.5380.
299− 9556.0cb2.8722.2bea.e96e.3ac5.d1bc.10e3.2c52.a62a.b1d6.
300− 35aa.d05e.f6a8.0f3b.31ed.559d.09ad.f585.6d21.fd1d.8d67.
301− 370b.26f4.70c1.b923.4684.6fbd.cf8b.5036.0539.9cdc.d93f.
302− 9068.1edf.8f33.b632.d427.97fa.9ee1
303− (cut 3 [a 1] b)
304− ::
305−
306−Examples
307−--------
308−
309− ~zod/try=> (zyft:un 0x12)
310− 57
311− ~zod/try=> (zyft:un 0x0)
312− 225
313− ~zod/try=> (zyft:un 0xff)
314− 187
315−
316−------------------------------------------------------------------------
317−
318−### `++zyrt`
319−
320−Reverse lookup byte in 256 sub box
321−
322−The inverse of [`++zyft`](/doc/hoon/library/2en#++zyft). Looks up a byte `a` in a substituion box
323−with 256 values, producing a byte.
324−
325−Accepts
326−-------
327−
328−`a` is an [atom]() of one byte in length.
329−
330−Produces
331−--------
332−
333−An atom.
334−
335−Source
336−------
337−
338− ++ zyrt :: reverse 256-sbox
339− |= a=@D
340− =+ ^= b
341− 0x9fc8.2753.6e02.8fcf.8b35.2b20.5598.7caa.c9a9.30b0.9b48.
342− 47ce.6371.80f6.407d.00dd.0aa5.ed10.ecb7.0f5a.5c3a.e605.
343− c077.4337.17bd.9eda.62a4.79a7.ccb8.44cd.8e64.1ec4.5b6b.
344− 1842.ffd8.1dfb.fd07.f2f9.594c.3be3.73c6.2cb6.8438.e434.
345− 8d3d.ea6a.5268.72db.a001.2e11.de8c.88d3.0369.4f7a.87e2.
346− 860d.0991.25d0.16b9.978a.4bf4.2a1a.e96c.fa50.85b5.9aeb.
347− 9dbb.b2d9.a2d1.7bba.66be.e81f.1946.29a8.f5d2.f30c.2499.
348− c1b3.6583.89e1.ee36.e0b4.6092.937e.d74e.2f6f.513e.9615.
349− 9c5d.d581.e7ab.fe74.f01b.78b1.ae75.af57.0ec2.adc7.3245.
350− 12bf.2314.3967.0806.31dc.cb94.d43f.493c.54a6.0421.c3a1.
351− 1c4a.28ac.fc0b.26ca.5870.e576.f7f1.616d.905f.ef41.33bc.
352− df4d.225e.2d56.7fd6.1395.a3f8.c582
353− (cut 3 [a 1] b)
354−
355−Examples
356−--------
357−
358− ~zod/try=> `@ux`(zyrt:un 57)
359− 0x12
360− ~zod/try=> `@ux`(zyrt:un 225)
361− 0x0
362− ~zod/try=> `@ux`(zyrt:un 187)
363− 0xff
364−
docs/system/hoon/library/core/yo.mddeleted−256
@@ -1,256 +0,0 @@
1−### `++yo`
2−
3− ++ yo :: time constants core
4−
5−Useful constants for interacting with earth time.
6−
7−### `++cet`
8−
9−Days in a century. Derived by multiplying the number of days in a year
10−(365) by the number of years in a century (100), then adding the number
11−days from leap years in a century (24).
12−
13−Produces
14−--------
15−
16−An [atom]().
17−
18−Source
19−------
20−
21− |% ++ cet 36.524 :: (add 24 (mul 100 365))
22−
23−Examples
24−--------
25−
26− ~zod/try=> cet:yo
27− 36.524
28− ~zod/try=> (add 365 cet:yo)
29− 36.889
30− ~zod/try=> (sub (add 24 (mul 100 365)) cet:yo)
31− 0
32−
33−------------------------------------------------------------------------
34−
35−### `++day`
36−
37−Number of seconds in a day.
38−
39−Produces
40−--------
41−
42−An [atom]().
43−
44−Source
45−------
46−
47− ++ day 86.400 :: (mul 24 hor)
48−
49−Examples
50−--------
51−
52− ~zod/try=> day:yo
53− 86.400
54− ~zod/try=> (add 60 day:yo)
55− 86.460
56−
57−------------------------------------------------------------------------
58−
59−### `++era`
60−
61−XX Revisit
62−
63−Produces
64−--------
65−
66−An [atom]().
67−
68−Source
69−------
70−
71− ++ era 146.097 :: (add 1 (mul 4 cet))
72−
73−Examples
74−--------
75−
76−
77−------------------------------------------------------------------------
78−
79−### `++hor`
80−
81−Seconds in hour
82−
83−The number of seconds in an hour. Derived by multiplying the number of
84−seconds in a minute by the minutes in an hour.
85−
86−Produces
87−--------
88−
89−An [atom]().
90−
91−Source
92−------
93−
94− ++ hor 3.600 :: (mul 60 mit)
95−
96−Examples
97−--------
98−
99− ~zod/try=> hor:yo
100− 3.600
101− ~zod/try=> (div hor:yo 60)
102− 60
103−
104−------------------------------------------------------------------------
105−
106−### `++jes`
107−
108−XX Revisit
109−
110−Produces
111−--------
112−
113−An atom.
114−
115−Source
116−------
117−
118− ++ jes 106.751.991.084.417 :: (mul 730.692.561 era)
119−
120−Examples
121−--------
122−
123− ~zod/try=> jes:yo
124− 106.751.991.084.417
125−
126−------------------------------------------------------------------------
127−
128−### `++mit`
129−
130−Seconds in minute
131−
132−The number of seconds in a minute.
133−
134−Produces
135−--------
136−
137−An [atom]().
138−
139−Source
140−------
141−
142− ++ mit 60
143−
144−Examples
145−--------
146−
147− ~zod/try=> mit:yo
148− 60
149−
150−------------------------------------------------------------------------
151−
152−### `++moh`
153−
154−Days in month
155−
156−The days in each month of the Gregorian common year. A list of unsigned
157−decimal atoms (Either 28, 30, or 31) denoting the number of days in the
158−month at the year at that index.
159−
160−Produces
161−--------
162−
163−A [`++list`]() of [`@ud`]()
164−
165−Source
166−------
167−
168− ++ moh `(list ,@ud)`[31 28 31 30 31 30 31 31 30 31 30 31 ~]
169−
170−Examples
171−--------
172−
173− ~zod/try=> moh:yo
174− ~[31 28 31 30 31 30 31 31 30 31 30 31]
175− ~zod/try=> (snag 4 moh:yo)
176− 31
177−
178−------------------------------------------------------------------------
179−
180−### `++moy`
181−
182−Moh with leapyear
183−
184−The days in each month of the Gregorian leap-year. A list of unsigned
185−decimal atoms (Either 29,30, or 31) denoting the number of days in the
186−month at the leap-year at that index.
187−
188−Examples
189−--------
190−
191−A [`++list`]() of [`@ud`]()
192−
193−Source
194−------
195−
196− ++ moy `(list ,@ud)`[31 29 31 30 31 30 31 31 30 31 30 31 ~]
197−
198−Examples
199−--------
200−
201− ~zod/try=> moy:yo
202− ~[31 29 31 30 31 30 31 31 30 31 30 31]
203− ~zod/try=> (snag 1 moy:yo)
204− 29
205−
206−------------------------------------------------------------------------
207−
208−### `++qad`
209−
210−Seconds in 4 years
211−
212−The number of seconds in four years. Derived by adding one second to the
213−number of seconds in four years.
214−
215−Produces
216−--------
217−
218−An [atom]().
219−
220−Source
221−------
222−
223− ++ qad 126.144.001 :: (add 1 (mul 4 yer))
224−
225−Examples
226−--------
227−
228− ~zod/try=> qad:yo
229− 126.144.001
230−
231−------------------------------------------------------------------------
232−
233−### `++yer`
234−
235−Seconds in year
236−
237−The number of seconds in a year. Derived by multiplying the number of
238−seconds in a day by 365.
239−
240−Produces
241−--------
242−
243−An [atom]().
244−
245−Source
246−------
247−
248− ++ yer 31.536.000 :: (mul 365 day)
249−
250−Examples
251−--------
252−
253− ~zod/try=> yer:yo
254− 31.536.000
255−
256−
docs/system/hoon/library/core/yu.mddeleted−212
@@ -1,212 +0,0 @@
1−### `++yu`
2−
3−UTC format constants
4−
5−Source
6−------
7−
8− ++ yu :: UTC format constants
9− |%
10−
11− ~zod/try=/hom> yu
12− <4.pgn 250.tmw 41.cmo 414.rvm 101.jzo 1.ypj %164>
13−
14−------------------------------------------------------------------------
15−
16−### `++mon`
17−
18−Months
19−
20−Produces a list of [`++tapes`]() containing the 12 months of the year.
21−
22−Produces
23−--------
24−
25−A `++list` of `++tape`s.
26−
27−Source
28−------
29−
30− ++ mon ^- (list tape)
31− :~ "January" "February" "March" "April" "May" "June" "July"
32− "August" "September" "October" "November" "December"
33− ==
34− ::
35−
36−Examples
37−--------
38−
39− ~zod/try=/hom> mon:yu
40− <<
41− "January"
42− "February"
43− "March"
44− "April"
45− "May"
46− "June"
47− "July"
48− "August"
49− "September"
50− "October"
51− "November"
52− "December"
53− >>
54− ~zod/try=/hom> (snag 1 mon:yu)
55− "February"
56−
57−------------------------------------------------------------------------
58−
59−### `++wik`
60−
61−Weeks
62−
63−Produces a list of [tapes]() containing the 7 days of the week,
64−beginning with Sunday.
65−
66−Source
67−------
68−
69− ++ wik ^- (list tape)
70− :~ "Sunday" "Monday" "Tuesday" "Wednesday" "Thursday"
71− "Friday" "Saturday"
72− ==
73− ::
74−
75−Examples
76−--------
77−
78− ~zod/try=/hom> wik:yu
79− <<"Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" "Friday" "Saturday">>
80− ~zod/try=/hom> (snag 2 wik:yu)
81− "Tuesday"
82− ~zod/try=/hom> (snag (daws (yore -<-)) wik:yu)
83− "Tuesday"
84−
85−------------------------------------------------------------------------
86−
87−### `++les`
88−
89−Leap second dates
90−
91−Produces a [`++list`]() of the (absolute) dates ([`@da`]) of the 25 leap seconds.
92−
93−Produces
94−--------
95−
96−A `++list` of atoms of odor `@da`.
97−
98−Source
99−------
100−
101− ++ les ^- (list ,@da)
102− :~ ~2015.7.1 ~2012.7.1 ~2009.1.1 ~2006.1.1 ~1999.1.1 ~1997.7.1
103− ~1996.1.1 ~1994.7.1 ~1993.7.1 ~1992.7.1 ~1991.1.1 ~1990.1.1
104− ~1988.1.1 ~1985.7.1 ~1983.7.1 ~1982.7.1 ~1981.7.1 ~1980.1.1
105− ~1979.1.1 ~1978.1.1 ~1977.1.1 ~1976.1.1 ~1975.1.1 ~1974.1.1
106− ~1973.1.1 ~1972.7.1
107− ==
108−
109−Examples
110−--------
111−
112− ~zod/try=/hom> les:yu
113− ~[
114− ~2015.7.1
115− ~2012.7.1
116− ~2009.1.1
117− ~2006.1.1
118− ~1999.1.1
119− ~1997.7.1
120− ~1996.1.1
121− ~1994.7.1
122− ~1993.7.1
123− ~1992.7.1
124− ~1991.1.1
125− ~1990.1.1
126− ~1988.1.1
127− ~1985.7.1
128− ~1983.7.1
129− ~1982.7.1
130− ~1981.7.1
131− ~1980.1.1
132− ~1979.1.1
133− ~1978.1.1
134− ~1977.1.1
135− ~1976.1.1
136− ~1975.1.1
137− ~1974.1.1
138− ~1973.1.1
139− ~1972.7.1
140− ]
141− ~zod/try=/hom> (snag 2 les:yu)
142− ~2006.1.1
143−
144−------------------------------------------------------------------------
145−
146−### `++lef`
147−
148−Back-shifted leap second dates
149−
150−Produces a [`++list`]() of absolute dates ([`@da`]()s) that represent the Urbit
151−Galactc Time equivalents of the UTC leap second dates in [`++les`](/doc/hoon/library/3bc#++les).
152−
153−Produces
154−--------
155−
156−A `++list` of atoms of odor `@da`.
157−
158−Source
159−------
160−
161− ++ lef ^- (list ,@da)
162− :~ ~2015.6.30..23.59.59 ~2012.6.30..23.59.59
163− ~2008.12.31..23.59.58 ~2005.12.31..23.59.57
164− ~1998.12.31..23.59.56 ~1997.6.30..23.59.55
165− ~1995.12.31..23.59.54 ~1994.6.30..23.59.53
166− ~1993.6.30..23.59.52 ~1992.6.30..23.59.51
167− ~1990.12.31..23.59.50 ~1989.12.31..23.59.49
168− ~1987.12.31..23.59.48 ~1985.6.30..23.59.47
169− ~1983.6.30..23.59.46 ~1982.6.30..23.59.45
170− ~1981.6.30..23.59.44 ~1979.12.31..23.59.43
171− ~1978.12.31..23.59.42 ~1977.12.31..23.59.41
172− ~1976.12.31..23.59.40 ~1975.12.31..23.59.39
173− ~1974.12.31..23.59.38 ~1973.12.31..23.59.37
174− ~1972.12.31..23.59.36 ~1972.6.30..23.59.35
175− ==
176− ::
177−
178−Examples
179−--------
180−
181− ~zod/try=/hom> lef:yu
182− ~[
183− ~2015.6.30..23.59.59
184− ~2012.6.30..23.59.59
185− ~2008.12.31..23.59.58
186− ~2005.12.31..23.59.57
187− ~1998.12.31..23.59.56
188− ~1997.6.30..23.59.55
189− ~1995.12.31..23.59.54
190− ~1994.6.30..23.59.53
191− ~1993.6.30..23.59.52
192− ~1992.6.30..23.59.51
193− ~1990.12.31..23.59.50
194− ~1989.12.31..23.59.49
195− ~1987.12.31..23.59.48
196− ~1985.6.30..23.59.47
197− ~1983.6.30..23.59.46
198− ~1982.6.30..23.59.45
199− ~1981.6.30..23.59.44
200− ~1979.12.31..23.59.43
201− ~1978.12.31..23.59.42
202− ~1977.12.31..23.59.41
203− ~1976.12.31..23.59.40
204− ~1975.12.31..23.59.39
205− ~1974.12.31..23.59.38
206− ~1973.12.31..23.59.37
207− ~1972.12.31..23.59.36
208− ~1972.6.30..23.59.35
209− ]
210− ~zod/try=/hom> (snag 2 lef:yu)
211− ~2005.12.31..23.59.57
212−
docs/system/hoon/library/gate/ace.mddeleted−24
@@ -1,24 +0,0 @@
1−### `++ace`
2−
3−Parse space
4−
5−Parses ASCII character 32, space.
6−
7−Source
8−------
9−
10− ++ ace (just ' ')
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan " " ace)
16− ~~.
17− ~zod/try=> `cord`(scan " " ace)
18− ' '
19− ~zod/try=> (ace [[1 1] " "])
20− [p=[p=1 q=2] q=[~ [p=~~. q=[p=[p=1 q=2] q=""]]]]
21− ~zod/try=> (ace [[1 1] " abc "])
22− [p=[p=1 q=2] q=[~ [p=~~. q=[p=[p=1 q=2] q="abc "]]]]
23−
24−
docs/system/hoon/library/gate/add.mddeleted−39
@@ -1,39 +0,0 @@
1−### `++add`
2−
3−Add
4−
5−Produces the sum of `a` and `b`.
6−
7−Accepts
8−-------
9−
10−`a` is an [atom]().
11−
12−`b` is an atom.
13−
14−Produces
15−--------
16−
17−An atom.
18−
19−Source
20−------
21−
22− ++ add :: add
23− ~/ %add
24− |= [a=@ b=@]
25− ^- @
26− ?: =(0 a) b
27− $(a (dec a), b +(b))
28−
29−Examples
30−--------
31−
32− ~zod/try=> (add 2 2)
33− 4
34− ~zod/try=> (add 1 1.000.000)
35− 1.000.001
36− ~zod/try=> (add 1.333 (mul 2 2))
37− 1.337
38−
39−
docs/system/hoon/library/gate/alf.mddeleted−22
@@ -1,22 +0,0 @@
1−### `++alf`
2−
3−Alphabetic characters
4−
5−Parse alphabetic characters, both upper and lowercase.
6−
7−Source
8−------
9−
10− ++ alf ;~(pose low hig) :: alphabetic
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "a" alf)
16− ~~a
17− ~zod/try=> (scan "A" alf)
18− ~~~41.
19− ~zod/try=> (scan "AaBbCc" (star alf))
20− "AaBbCc"
21−
22−
docs/system/hoon/library/gate/aln.mddeleted−22
@@ -1,22 +0,0 @@
1−### `++aln`
2−
3−Alphanumeric characters
4−
5−Parse alphanumeric characters - both alphabetic characters and numbers.
6−
7−Source
8−------
9−
10− ++ aln ;~(pose low hig nud) :: alphanumeric
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "0" aln)
16− ~~0
17− ~zod/try=> (scan "alf42" (star aln))
18− "alf42"
19− ~zod/try=> (scan "0123456789abcdef" (star aln))
20− "0123456789abcdef"
21−
22−
docs/system/hoon/library/gate/alp.mddeleted−22
@@ -1,22 +0,0 @@
1−### `++alp`
2−
3−Alphanumeric and `-`
4−
5−Parse alphanumeric strings and hep, "-".
6−
7−Source
8−------
9−
10− ++ alp ;~(pose low hig nud hep) :: alphanumeric and -
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "7" alp)
16− ~~7
17− ~zod/try=> (scan "s" alp)
18− ~~s
19− ~zod/try=> (scan "123abc-" (star alp))
20− "123abc-"
21−
22−
docs/system/hoon/library/gate/aor.mddeleted−61
@@ -1,61 +0,0 @@
1−### `++aor`
2−
3−Alphabetic order
4−
5−Computes whether `a` and `b` are in alphabetical order, producing a
6−boolean.
7−
8−Accepts
9−-------
10−
11−`a` is a [noun]().
12−
13−`b` is a noun.
14−
15−Produces
16−--------
17−
18−A boolean atom.
19−
20−
21−Source
22−------
23−
24− ++ aor :: alphabetic-order
25− ~/ %aor
26− |= [a=* b=*]
27− ^- ?
28− ?: =(a b) &
29− ?. ?=(@ a)
30− ?: ?=(@ b) |
31− ?: =(-.a -.b)
32− $(a +.a, b +.b)
33− $(a -.a, b -.b)
34− ?. ?=(@ b) &
35− |-
36− =+ [c=(end 3 1 a) d=(end 3 1 b)]
37− ?: =(c d)
38− $(a (rsh 3 1 a), b (rsh 3 1 b))
39− (lth c d)
40−
41−Examples
42−--------
43−
44− ~zod/try=> (aor 'a' 'b')
45− %.y
46− ~zod/try=> (aor 'b' 'a')
47− %.n
48− ~zod/try=> (aor "foo" "bar")
49− %.n
50− ~zod/try=> (aor "bar" "foo")
51− %.y
52− ~zod/try=> (aor "abcdefz" "abcdefa")
53− %.n
54− ~zod/try=> (aor "abcdefa" "abcdefz")
55− %.y
56− ~zod/try=> (aor 10.000 17.000)
57− %.y
58− ~zod/try=> (aor 10 9)
59− %.n
60−
61−
docs/system/hoon/library/gate/bar.mddeleted−24
@@ -1,24 +0,0 @@
1−### `++bar`
2−
3−Parse vertical bar
4−
5−Parses ASCII character 124, the vertical bar.
6−
7−Source
8−------
9−
10− ++ bar (just '|')
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "|" bar)
16− ~~~7c.
17− ~zod/try=> `cord`(scan "|" bar)
18− '|'
19− ~zod/try=> (bar [[1 1] "|"])
20− [p=[p=1 q=2] q=[~ [p=~~~7c. q=[p=[p=1 q=2] q=""]]]]
21− ~zod/try=> (bar [[1 1] "|="])
22− [p=[p=1 q=2] q=[~ [p=~~~7c. q=[p=[p=1 q=2] q="="]]]]
23−
24−
docs/system/hoon/library/gate/bas.mddeleted−28
@@ -1,28 +0,0 @@
1−### `++bas`
2−
3−Parse backslash
4−
5−Parses ASCII character 92, the backslash. Note the extra `\` in the calling of
6−`bas` with [`++just`](/doc/hoon/library/2ec#++just) is to escape the escape
7−character, `\`.
8−
9−Source
10−------
11−
12− ++ bas (just '\\')
13−
14−Examples
15−--------
16−
17− ~zod/try=> (scan "\\" bas)
18− ~~~5c.
19− ~zod/try=> `cord`(scan "\\" bas)
20− '\'
21− ~zod/try=> (bas [[1 1] "\"])
22− ~ <syntax error at [1 18]>
23− ~zod/try=> (bas [[1 1] "\\"])
24− [p=[p=1 q=2] q=[~ [p=~~~5c. q=[p=[p=1 q=2] q=""]]]]
25− ~zod/try=> (bas [[1 1] "\""])
26− [p=[p=1 q=1] q=~]
27−
28−
docs/system/hoon/library/gate/bass.mddeleted−40
@@ -1,40 +0,0 @@
1−### `++bass`
2−
3−Parser modifier: [LSB](http://en.wikipedia.org/wiki/Least_significant_bit)
4−ordered [`++list`]() as atom of a [`++base`]().
5−
6−Accepts
7−-------
8−
9−`wuc` is an atom.
10−
11−`tyd` is a [`++rule`]().
12−
13−Produces
14−--------
15−
16−A [`++rule`]().
17−
18−Source
19−------
20−
21− ++ bass
22− |* [wuc=@ tyd=_rule]
23− %+ cook
24− |= waq=(list ,@)
25− %+ roll
26− waq
27− =|([p=@ q=@] |.((add p (mul wuc q))))
28− tyd
29−
30−Examples
31−--------
32−
33− ~zod/try=> (scan "123" (bass 10 (star dit)))
34− q=123
35− ~zod/try=> (scan "123" (bass 8 (star dit)))
36− q=83
37− ~zod/try=> `@ub`(scan "123" (bass 8 (star dit)))
38− 0b101.0011
39−
40−
docs/system/hoon/library/gate/bend.mddeleted−62
@@ -1,62 +0,0 @@
1−### `++bend`
2−
3−Conditional composer
4−
5−Parsing composer: connects the [`++edge`]() `vex` with the subsequent [`++rule`]() `sab`
6−as an optional suffix, using [gate]() `raq` to compose or reject its
7−result. If there is no suffix, or if the suffix fails to be composed
8−with the current result, the current result is produced. Used to map a
9−group of rules to a specified output.
10−
11−Accepts
12−-------
13−
14−`raq` is a [gate]().
15−
16−`sab` is a [rule]().
17−
18−`vex` is an [edge]().
19−
20−Produces
21−--------
22−
23−A [`++rule`]().
24−
25−Source
26−------
27−
28− ++ bend :: conditional comp
29− ~/ %bend
30− |* raq=_|*([a=* b=*] [~ u=[a b]])
31− ~/ %fun
32− |* [vex=edge sab=_rule]
33− ?~ q.vex
34− vex
35− =+ yit=(sab q.u.q.vex)
36− =+ yur=(last p.vex p.yit)
37− ?~ q.yit
38− [p=yur q=q.vex]
39− =+ vux=(raq p.u.q.vex p.u.q.yit)
40− ?~ vux
41− [p=yur q=q.vex]
42− [p=yur q=[~ u=[p=u.vux q=q.u.q.yit]]]
43− ::
44−
45−Examples
46−--------
47−
48− ~zod/try=> (;~((bend |=([a=char b=char] ?.(=(a b) ~ (some +(a))))) prn prn) [1 1] "qs")
49− [p=[p=1 q=3] q=[~ u=[p=~~q q=[p=[p=1 q=2] q="s"]]]]
50− ~zod/try=> (;~((bend |=([a=char b=char] ?.(=(a b) ~ (some +(a))))) prn prn) [1 1] "qqq")
51− [p=[p=1 q=3] q=[~ u=[p=~~r q=[p=[p=1 q=3] q="q"]]]]
52− ~zod/try=> (scan "aa" ;~((bend |=([a=char b=char] ?.(=(a b) ~ (some +(a))))) prn prn))
53− ~~b
54− ~zod/try=> (scan "ba" ;~((bend |=([a=char b=char] ?.(=(a b) ~ (some +(a))))) prn prn))
55− ! {1 3}
56− ! exit
57− ~zod/try=> `(unit ,@tas)`(scan "" ;~((bend) (easy ~) sym))
58− ~
59− ~zod/try=> `(unit ,@tas)`(scan "sep" ;~((bend) (easy ~) sym))
60− [~ %sep]
61−
62−
docs/system/hoon/library/gate/bet.mddeleted−21
@@ -1,21 +0,0 @@
1−
2−### `++bet`
3−
4−Axis syntax `-`, `+`
5−
6−Parse the hep and lus axis syntax.
7−
8−Source
9−------
10−
11− ++ bet ;~(pose (cold 2 hep) (cold 3 lus)) :: axis syntax - +
12−
13−Examples
14−--------
15−
16− ~zod/try=> (scan "-" bet)
17− 2
18− ~zod/try=> (scan "+" bet)
19− 3
20−
21−
docs/system/hoon/library/gate/bex.mddeleted−37
@@ -1,37 +0,0 @@
1−### `++bex`
2−
3−Binary exponent
4−
5−Computes the result of `2^a`, producing an [atom]().
6−
7−Accepts
8−-------
9−
10−`a` is an atom.
11−
12−Produces
13−--------
14−
15−An atom.
16−
17−Source
18−------
19−
20− ++ bex :: binary exponent
21− ~/ %bex
22− |= a=@
23− ^- @
24− ?: =(0 a) 1
25− (mul 2 $(a (dec a)))
26−
27−Examples
28−--------
29−
30− ~zod/try=> (bex 4)
31− 16
32− ~zod/try=> (bex (add 19 1))
33− 1.048.576
34− ~zod/try=> (bex 0)
35− 1
36−
37−
docs/system/hoon/library/gate/biff.mddeleted−36
@@ -1,36 +0,0 @@
1−### `++biff`
2−
3−Unit as argument
4−
5−Applies a function `b` that produces a unit to the unwrapped value of [++unit]()
6−`a` (`u.a`). If `a` is empty, `~` is produced.
7−
8−Accepts
9−-------
10−
11−`a` is a unit.
12−
13−`b` is a function that accepts a noun and produces a unit.
14−
15−Produces
16−--------
17−
18−A unit.
19−
20−Source
21−------
22−
23− ++ biff :: apply
24− |* [a=(unit) b=$+(* (unit))]
25− ?~ a ~
26− (b u.a)
27−
28−Examples
29−--------
30−
31− ~zod/try=> (biff (some 5) |=(a=@ (some (add a 2))))
32− [~ u=7]
33− ~zod/try=> (biff ~ |=(a=@ (some (add a 2))))
34− ~
35−
36−
docs/system/hoon/library/gate/bin.mddeleted−24
@@ -1,24 +0,0 @@
1−### `++bin`
2−
3−Binary to atom
4−
5−Parse a tape of binary (0s and 1s) and produce its atomic representation.
6−
7−Source
8−------
9−
10− ++ bin (bass 2 (most gon but)) :: binary to atom
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "0000" bin)
16− 0
17− ~zod/try=> (scan "0001" bin)
18− 1
19− ~zod/try=> (scan "0010" bin)
20− 2
21− ~zod/try=> (scan "100000001111" bin)
22− 2.063
23−
24−
docs/system/hoon/library/gate/bind.mddeleted−38
@@ -1,38 +0,0 @@
1−### `++bind`
2−
3−Non-unit function to unit, producing unit
4−
5−Applies a function `b` to the value (`u.a`) of a [++unit]() `a`, producing
6−a unit. Used when you want a function that does not accept or produce a
7−unit to both accept and produce a unit.
8−
9−Accepts
10−-------
11−
12−`a` is a unit.
13−
14−`b` is a function.
15−
16−Produces
17−--------
18−
19−A unit.
20−
21−Source
22−------
23−
24− ++ bind :: argue
25− |* [a=(unit) b=gate]
26− ?~ a ~
27− [~ u=(b u.a)]
28−
29−Examples
30−--------
31−
32− ~zod/try=> (bind ((unit ,@) [~ 97]) ,@t)
33− [~ `a`]
34− ~zod/try=> =a |=(a=@ (add a 1))
35− ~zod/try=> (bind ((unit ,@) [~ 2]) a)
36− [~ 3]
37−
38−
docs/system/hoon/library/gate/bond.mddeleted−39
@@ -1,39 +0,0 @@
1−### `++bond`
2−
3−Replace null
4−
5−Replaces an empty [++unit]() `b` with the product of a called [trap]()
6−`a`. If the unit is not empty, then the original unit is produced.
7−
8−Accepts
9−-------
10−
11−`a` is a trap.
12−
13−`b` is a unit.
14−
15−Produces
16−--------
17−
18−Either the product of `a` or the value inside of unit `b`.
19−
20−Source
21−------
22−
23− ++ bond :: replace
24− |* a=trap
25− |* b=(unit)
26− ?~ b $:a
27− u.b
28−
29−Examples
30−--------
31−
32− ~zod/try=> (bex 10)
33− 1.024
34− ~zod/try=> ((bond |.((bex 10))) ~)
35− 1.024
36− ~zod/try=> ((bond |.((bex 10))) (slaw %ud '123'))
37− 123
38−
39−
docs/system/hoon/library/gate/boss.mddeleted−40
@@ -1,40 +0,0 @@
1−
2−### `++boss`
3−
4−Parser modifier: [LSB](http://en.wikipedia.org/wiki/Least_significant_bit)
5−ordered [`++list`]() as atom of a [`++base`]().
6−
7−Accepts
8−-------
9−
10−`wuc` is an atom.
11−
12−`tyd` is a [`++rule`]().
13−
14−Produces
15−--------
16−
17−A [`++rule`]().
18−
19−Source
20−------
21−
22− ++ boss
23− |* [wuc=@ tyd=_rule]
24− %+ cook
25− |= waq=(list ,@)
26− %+ reel
27− waq
28− =|([p=@ q=@] |.((add p (mul wuc q))))
29− tyd
30−
31−Examples
32−--------
33−
34− ~zod/try=> (scan "123" (boss 10 (star dit)))
35− q=321
36− ~zod/try=> `@t`(scan "bam" (boss 256 (star alp)))
37− 'bam'
38− ~zod/try=> `@ux`(scan "bam" (boss 256 (star alp)))
39− 0x6d.6162
40−
docs/system/hoon/library/gate/both.mddeleted−37
@@ -1,37 +0,0 @@
1−### `++both`
2−
3−Group unit values into pair
4−
5−Produces `~` if either `a` or `b` are empty. Otherwise, produces a
6−[++unit]() whose value is a cell of the values of two input units `a` and
7−`b`.
8−
9−Accepts
10−-------
11−
12−`a` is a unit.
13−
14−`b` is a unit.
15−
16−Produces
17−--------
18−
19−A unit of the two initial values.
20−
21−Source
22−------
23−
24− ++ both :: all the above
25− |* [a=(unit) b=(unit)]
26− ?~ a ~
27− ?~ b ~
28− [~ u=[u.a u.b]]
29−
30−Examples
31−--------
32−
33− ~zod/try=> (both (some 1) (some %b))
34− [~ u=[1 %b]]
35− ~zod/try=> (both ~ (some %b))
36− ~
37−
docs/system/hoon/library/gate/buc.mddeleted−24
@@ -1,24 +0,0 @@
1−### `++buc`
2−
3−Parse dollar sign
4−
5−Parses ASCII character 36, the dollar sign.
6−
7−Source
8−------
9−
10− ++ buc (just '$')
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "$" buc)
16− ~~~24.
17− ~zod/try=> `cord`(scan "$" buc)
18− '$'
19− ~zod/try=> (buc [[1 1] "$"])
20− [p=[p=1 q=2] q=[~ [p=~~~24. q=[p=[p=1 q=2] q=""]]]]
21− ~zod/try=> (buc [[1 1] "$%"])
22− [p=[p=1 q=2] q=[~ [p=~~~24. q=[p=[p=1 q=2] q="%"]]]]
23−
24−
docs/system/hoon/library/gate/but.mddeleted−26
@@ -1,26 +0,0 @@
1−### `++but`
2−
3−Binary digit
4−
5−Parse a single binary digit.
6−
7−Source
8−------
9−
10− ++ but (cook |=(a=@ (sub a '0')) (shim '0' '1')) :: binary digit
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "0" but)
16− 0
17− ~zod/try=> (scan "1" but)
18− 1
19− ~zod/try=> (scan "01" but)
20− ! {1 2}
21− ! 'syntax-error'
22− ! exit
23− ~zod/try=> (scan "01" (star but))
24− ~[0 1]
25−
26−
docs/system/hoon/library/gate/cab.mddeleted−24
@@ -1,24 +0,0 @@
1−### `++cab`
2−
3−Parse underscore
4−
5−Parses ASCII character 95, the underscore.
6−
7−Source
8−------
9−
10− ++ cab (just '_')
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "_" cab)
16− ~~~5f.
17− ~zod/try=> `cord`(scan "_" cab)
18− '_'
19− ~zod/try=> (cab [[1 1] "_"])
20− [p=[p=1 q=2] q=[~ [p=~~~5f. q=[p=[p=1 q=2] q=""]]]]
21− ~zod/try=> (cab [[1 1] "|_"])
22− [p=[p=1 q=1] q=~]
23−
24−
docs/system/hoon/library/gate/can.mddeleted−47
@@ -1,47 +0,0 @@
1−
2−### `++can`
3−
4−Assemble
5−
6−Produces an [atom]() from a list `b` of length-value pairs `p` and `q`,
7−where `p` is the length in bloqs of size `a`, and `q` is an atomic
8−value.
9−
10−Accepts
11−-------
12−
13−`a` is a block size (see [`++bloq`]()).
14−
15−`b` is a [`++list`]() of length value pairs, `p` and `q`.
16−
17−Produces
18−--------
19−
20−An atom.
21−
22−Source
23−------
24−
25− ++ can :: assemble
26− ~/ %can
27− |= [a=bloq b=(list ,[p=@ q=@])]
28− ^- @
29− ?~ b 0
30− (mix (end a p.i.b q.i.b) (lsh a p.i.b $(b t.b)))
31−
32−Examples
33−--------
34−
35− ~zod/try=> `@ub`(can 3 ~[[1 1]])
36− 0b1
37− ~zod/try=> `@ub`(can 0 ~[[1 255]])
38− 0b1
39− ~zod/try=> `@ux`(can 3 [3 0xc1] [1 0xa] ~)
40− 0xa00.00c1
41− ~zod/try=> `@ux`(can 3 [3 0xc1] [1 0xa] [1 0x23] ~)
42− 0x23.0a00.00c1
43− ~zod/try=> `@ux`(can 4 [3 0xc1] [1 0xa] [1 0x23] ~)
44− 0x23.000a.0000.0000.00c1
45− ~zod/try=> `@ux`(can 3 ~[[1 'a'] [2 'bc']])
46− 0x63.6261
47−
docs/system/hoon/library/gate/cap.mddeleted−44
@@ -1,44 +0,0 @@
1−### `++cap`
2−
3−Tree head
4−
5−Tests whether an `a` is in the head or tail of a [noun](). Produces the
6−[cube]() `%2` if it is within the head, or the cube `%3` if it is
7−within the tail.
8−
9−Accepts
10−-------
11−
12−`a` is an atom.
13−
14−Produces
15−--------
16−
17−A [cube]().
18−
19−Source
20−------
21−
22− ++ cap :: tree head
23− ~/ %cap
24− |= a=@
25− ^- ?(%2 %3)
26− ?- a
27− %2 %2
28− %3 %3
29− ?(%0 %1) !!
30− * $(a (div a 2))
31− ==
32− ::
33−
34−Examples
35−--------
36−
37− ~zod/try=> (cap 4)
38− %2
39− ~zod/try=> (cap 6)
40− %3
41− ~zod/try=> (cap (add 10 9))
42− %2
43−
44−
docs/system/hoon/library/gate/cass.mddeleted−38
@@ -1,38 +0,0 @@
1−
2−### `++cass`
3−
4−To lowercase
5−
6−Produce the case insensitive (all lowercase) [`++cord`]() of a [`++tape`]().
7−
8−Accepts
9−-------
10−
11−`vib` is a `++tape`.
12−
13−Produces
14−--------
15−
16−A `++cord`.
17−
18−Source
19−------
20−
21− ++ cass :: lowercase
22− |= vib=tape
23− %+ rap 3
24− (turn vib |=(a=@ ?.(&((gte a 'A') (lte a 'Z')) a (add 32 a))))
25− ::
26−
27−Examples
28−--------
29−
30− ~zod/try=> (cass "john doe")
31− 7.309.170.810.699.673.450
32− ~zod/try=> `cord`(cass "john doe")
33− 'john doe'
34− ~zod/try=> (cass "abc, 123, !@#")
35− 2.792.832.775.110.938.439.066.079.945.313
36− ~zod/try=> `cord`(cass "abc, 123, !@#")
37− 'abc, 123, !@#'
38−
docs/system/hoon/library/gate/cat.mddeleted−52
@@ -1,52 +0,0 @@
1−### `++cat`
2−
3−Concatenate
4−
5−Concatenates two [atom]()s, `b` and `c`, according to bloq size `a`, producing an
6−atom.
7−
8−Accepts
9−-------
10−
11−`a` is a block size (see [`++bloq`]()).
12−
13−`b` is an atom.
14−
15−`c` is an atom.
16−
17−Produces
18−--------
19−
20−An atom.
21−
22−Source
23−------
24−
25− ++ cat :: concatenate
26− ~/ %cat
27− |= [a=bloq b=@ c=@]
28− (add (lsh a (met a b) c) b)
29−
30−Examples
31−--------
32−
33− ~zod/try=> `@ub`(cat 3 1 0)
34− 0b1
35− ~zod/try=> `@ub`(cat 0 1 1)
36− 0b11
37− ~zod/try=> `@ub`(cat 0 2 1)
38− 0b110
39− ~zod/try=> `@ub`(cat 2 1 1)
40− 0b1.0001
41− ~zod/try=> `@ub`256
42− 0b1.0000.0000
43− ~zod/try=> `@ub`255
44− 0b1111.1111
45− ~zod/try=> `@ub`(cat 3 256 255)
46− 0b1111.1111.0000.0001.0000.0000
47− ~zod/try=> `@ub`(cat 2 256 255)
48− 0b1111.1111.0001.0000.0000
49− ~zod/try=> (cat 3 256 255)
50− 16.711.936
51−
52−
docs/system/hoon/library/gate/cen.mddeleted−24
@@ -1,24 +0,0 @@
1−### `++cen`
2−
3−Parses percent sign
4−
5−Parses ASCII character 37, the percent sign.
6−
7−Source
8−------
9−
10− ++ cen (just '%')
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "%" cen)
16− ~~~25.
17− ~zod/try=> `cord`(scan "%" cen)
18− '%'
19− ~zod/try=> (cen [[1 1] "%"])
20− [p=[p=1 q=2] q=[~ [p=~~~25. q=[p=[p=1 q=2] q=""]]]]
21− ~zod/try=> (cen [[1 1] "%^"])
22− [p=[p=1 q=2] q=[~ [p=~~~25. q=[p=[p=1 q=2] q="^"]]]]
23−
24−
docs/system/hoon/library/gate/cit.mddeleted−26
@@ -1,26 +0,0 @@
1−### `++cit`
2−
3−Octal digit
4−
5−Parse a single octal digit.
6−
7−Source
8−------
9−
10− ++ cit (cook |=(a=@ (sub a '0')) (shim '0' '7')) :: octal digit
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "1" cit)
16− 1
17− ~zod/try=> (scan "7" cit)
18− 7
19− ~zod/try=> (scan "8" cit)
20− ! {1 1}
21− ! 'syntax-error'
22− ! exit
23− ~zod/try=> (scan "60" (star cit))
24− ~[6 0]
25−
26−
docs/system/hoon/library/gate/clan.mddeleted−40
@@ -1,40 +0,0 @@
1−### `++clan`
2−
3−Ship class
4−
5−Accepts
6−-------
7−
8−`who` is a [`++ship`]()
9−
10−Produces
11−--------
12−
13−A [`%cube`]().
14−
15−Source
16−------
17−
18− ++ clan :: ship to rank
19− |= who=ship ^- rank
20− =+ wid=(met 3 who)
21− ?: (lte wid 1) %czar
22− ?: =(2 wid) %king
23− ?: (lte wid 4) %duke
24− ?: (lte wid 8) %earl
25− ?> (lte wid 16) %pawn
26− ::
27−
28−Examples
29−--------
30−
31− ~zod/main=> (clan ~zod)
32− %czar
33− ~zod/main=> (clan ~tyr)
34− %czar
35− ~zod/main=> (clan ~doznec)
36− %king
37− ~zod/main=> (clan ~tasfyn-partyv)
38− %duke
39−
40−
docs/system/hoon/library/gate/clap.mddeleted−44
@@ -1,44 +0,0 @@
1−### `++clap`
2−
3−Apply function to two units
4−
5−Applies a binary function `c`--which does not usually accept or produce a [`++unit`]()--
6−to the values of two units, `a` and `b`, producing a unit.
7−
8−Accepts
9−-------
10−
11−`a` is a unit.
12−
13−`b` is a unit.
14−
15−`c` is a function that performs a binary operation.
16−
17−Produces
18−--------
19−
20−A unit.
21−
22−Source
23−------
24−
25− ++ clap :: combine
26− |* [a=(unit) b=(unit) c=_|=(^ +<-)]
27− ?~ a b
28− ?~ b a
29− [~ u=(c u.a u.b)]
30−
31−Examples
32−--------
33−
34− ~zod/try=> =u ((unit ,@t) [~ 'a'])
35− ~zod/try=> =v ((unit ,@t) [~ 'b'])
36− ~zod/try=> (clap u v |=([a=@t b=@t] (welp (trip a) (trip b))))
37− [~ u="ab"]
38− ~zod/try=> =a ((unit ,@u) [~ 1])
39− ~zod/try=> =b ((unit ,@u) [~ 2])
40− ~zod/try=> =c |=([a=@ b=@] (add a b))
41− ~zod/try=> (clap a b c)
42− [~ 3]
43−
44−
docs/system/hoon/library/gate/col.mddeleted−24
@@ -1,24 +0,0 @@
1−### `++col`
2−
3−Parse colon
4−
5−Parses ASCII character 58, the colon
6−
7−Source
8−------
9−
10− ++ col (just ':')
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan ":" col)
16− ~~~3a.
17− ~zod/try=> `cord`(scan ":" col)
18− ':'
19− ~zod/try=> (col [[1 1] ":"])
20− [p=[p=1 q=2] q=[~ [p=~~~3a. q=[p=[p=1 q=2] q=""]]]]
21− ~zod/try=> (col [[1 1] ":-"])
22− [p=[p=1 q=2] q=[~ [p=~~~3a. q=[p=[p=1 q=2] q="-"]]]]
23−
24−
docs/system/hoon/library/gate/cold.mddeleted−42
@@ -1,42 +0,0 @@
1−### `++cold`
2−
3−Replace with constant
4−
5−Parser modifier. Accepts a [`++rule`]() `sef` and produces a parser that
6−produces a constant `cus`, assuming `sef` is successful.
7−
8−Accepts
9−-------
10−
11−`cus` is a constant [noun]().
12−
13−`sef` is a `++rule`.
14−
15−Produces
16−--------
17−
18−An [`++edge`]().
19−
20−Source
21−------
22−
23− ++ cold :: replace w/ constant
24− ~/ %cold
25− |* [cus=* sef=_rule]
26− ~/ %fun
27− |= tub=nail
28− =+ vex=(sef tub)
29− ?~ q.vex
30− vex
31− [p=p.vex q=[~ u=[p=cus q=q.u.q.vex]]]
32− ::
33−
34−Examples
35−--------
36−
37− ~zod/try=> ((cold %foo (just 'a')) [[1 1] "abc"])
38− [p=[p=1 q=2] q=[~ u=[p=%foo q=[p=[p=1 q=2] q="bc"]]]]
39− ~zod/try=> ((cold %foo (just 'a')) [[1 1] "bc"])
40− [p=[p=1 q=1] q=~]
41−
42−
docs/system/hoon/library/gate/com.mddeleted−24
@@ -1,24 +0,0 @@
1−### `++com`
2−
3−Parse comma
4−
5−Parses ASCII character 44, the comma.
6−
7−Source
8−------
9−
10− ++ com (just ',')
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "," com)
16− ~~~2c.
17− ~zod/try=> `cord`(scan "," com)
18− ','
19− ~zod/try=> (com [[1 1] ","])
20− [p=[p=1 q=2] q=[~ [p=~~~2c. q=[p=[p=1 q=2] q=""]]]]
21− ~zod/try=> (com [[1 1] "not com"])
22− [p=[p=1 q=1] q=~]
23−
24−
docs/system/hoon/library/gate/comp.mddeleted−48
@@ -1,48 +0,0 @@
1−### `++comp`
2−
3−Arbitrary compose
4−
5−Parsing composer: connects the [`++edge`]() `vex` with a following [`++rule`]() `sab`,
6−combining the contents of `vex` with the result of `sab` using a binary
7−[gate]() `raq`. Used to fold over the results of several `++rules`.
8−
9−Accepts
10−-------
11−
12−`raq` is a gate that accepts a cell of two [nouns](), `a` and `b`, and
13−produces a cell of two nouns.
14−
15−`sab` is a rule.
16−
17−`vex` is an edge.
18−
19−Produces
20−--------
21−
22−A [`++rule`]().
23−
24−Source
25−------
26−
27− ++ comp
28− ~/ %comp
29− |* raq=_|*([a=* b=*] [a b]) :: arbitrary compose
30− ~/ %fun
31− |* [vex=edge sab=_rule]
32− ?~ q.vex
33− vex
34− =+ yit=(sab q.u.q.vex)
35− =+ yur=(last p.vex p.yit)
36− ?~ q.yit
37− [p=yur q=q.yit]
38− [p=yur q=[~ u=[p=(raq p.u.q.vex p.u.q.yit) q=q.u.q.yit]]]
39− ::
40−
41−Examples
42−--------
43−
44− ~zod/try=> (scan "123" ;~((comp |=([a=@u b=@u] (add a b))) dit dit dit))
45− 6
46− ~zod/try=> (scan "12" ;~((comp |=([a=@u b=@u] (add a b))) dit dit dit))
47− ! {1 3}
48− ! exit
docs/system/hoon/library/gate/con.mddeleted−56
@@ -1,56 +0,0 @@
1−### `++con`
2−
3−Binary OR
4−
5−Computes the bit-wise logical OR of two [atom]()s, `a` and `b`, producing an
6−atom.
7−
8−Accepts
9−-------
10−
11−`a` is an atom
12−
13−`b` is an atom
14−
15−Produces
16−--------
17−
18−An atom.
19−
20−Source
21−------
22−
23− ++ con :: binary or
24− ~/ %con
25− |= [a=@ b=@]
26− =+ [c=0 d=0]
27− |- ^- @
28− ?: ?&(=(0 a) =(0 b)) d
29− %= $
30− a (rsh 0 1 a)
31− b (rsh 0 1 b)
32− c +(c)
33− d %+ add d
34− %^ lsh 0 c
35− ?& =(0 (end 0 1 a))
36− =(0 (end 0 1 b))
37− ==
38− ==
39−
40−Examples
41−--------
42−
43− ~zod/try=> (con 0b0 0b1)
44− 1
45− ~zod/try=> (con 0 1)
46− 1
47− ~zod/try=> (con 0 0)
48− 0
49− ~zod/try=> `@ub`(con 0b1111.0000 0b1.0011)
50− 0b1111.0011
51− ~zod/try=> (con 4 4)
52− 4
53− ~zod/try=> (con 10.000 234)
54− 10.234
55−
56−
docs/system/hoon/library/gate/cook.mddeleted−46
@@ -1,46 +0,0 @@
1−### `++cook`
2−
3−Apply gate
4−
5−Parser modifier. Produces a parser that takes a (successful) result of a
6−[`++rule`]() `sef` and slams it through `poq`.
7−
8−Accepts
9−-------
10−
11−`poq` is a [gate]().
12−
13−`sef` is a [`++rule`]().
14−
15−Produces
16−--------
17−
18−An [`++rule`]().
19−
20−Source
21−------
22−
23− ++ cook :: apply gate
24− ~/ %cook
25− |* [poq=_,* sef=_rule]
26− ~/ %fun
27− |= tub=nail
28− =+ vex=(sef tub)
29− ?~ q.vex
30− vex
31− [p=p.vex q=[~ u=[p=(poq p.u.q.vex) q=q.u.q.vex]]]
32− ::
33−
34−Examples
35−--------
36−
37− ~zod/try=> ((cook ,@ud (just 'a')) [[1 1] "abc"])
38− [p=[p=1 q=2] q=[~ u=[p=97 q=[p=[p=1 q=2] q="bc"]]]]
39− ~zod/try=> ((cook ,@tas (just 'a')) [[1 1] "abc"])
40− [p=[p=1 q=2] q=[~ u=[p=%a q=[p=[p=1 q=2] q="bc"]]]]
41− ~zod/try=> ((cook |=(a=@ +(a)) (just 'a')) [[1 1] "abc"])
42− [p=[p=1 q=2] q=[~ u=[p=98 q=[p=[p=1 q=2] q="bc"]]]]
43− ~zod/try=> ((cook |=(a=@ `@t`+(a)) (just 'a')) [[1 1] "abc"])
44− [p=[p=1 q=2] q=[~ u=[p='b' q=[p=[p=1 q=2] q="bc"]]]]
45−
46−
docs/system/hoon/library/gate/cork.mddeleted−25
@@ -1,25 +0,0 @@
1−### `++cork`
2−
3−Build `f` such that `(f x) .= (b (a x))`.
4−
5−`a` is a noun.
6−
7−`b` is a gate.
8−
9−Source
10−------
11−
12− ++ cork |*([a=_,* b=gate] (corl b a)) :: compose forward
13−
14−Examples
15−--------
16−
17− ~zod/try=> (:(cork dec dec dec) 20)
18− 17
19− ~zod/try=> =mal (mo (limo a/15 b/23 ~))
20− ~zod/try=> ((cork ~(got by mal) dec) %a)
21− 14
22− ~zod/try=> ((cork ~(got by mal) dec) %b)
23− 22
24−
25−
docs/system/hoon/library/gate/corl.mddeleted−25
@@ -1,25 +0,0 @@
1−### `++corl`
2−
3−Gate compose
4−
5−XX Revisit
6−
7−`a` is a gate.
8−
9−`b` is a noun.
10−
11−Source
12−------
13−
14− ++ corl :: compose backwards
15− |* [a=gate b=_,*]
16− |= c=_+<.b
17− (a (b c))
18−
19−Examples
20−--------
21−
22− ~zod/try=> ((corl (lift bex) (slat %ud)) '2')
23− [~ 4]
24−
25−
docs/system/hoon/library/gate/crip.mddeleted−31
@@ -1,31 +0,0 @@
1−### `++crip`
2−
3−Tape to cord
4−
5−Produce a [`++cord`]() from a [`++tape`]().
6−
7−Accepts
8−-------
9−
10−`a` is a `++tape`.
11−
12−Produces
13−--------
14−
15−A `++cord`.
16−
17−Source
18−------
19−
20− ++ crip |=(a=tape `@t`(rap 3 a)) :: tape to cord
21−
22−Examples
23−--------
24−
25− ~zod/try=> (crip "john doe")
26− 'john doe'
27− ~zod/try=> (crip "abc 123 !@#")
28− 'abc 123 !@#'
29− ~zod/try=> `@ud`(crip "abc")
30− 6.513.249
31−
docs/system/hoon/library/gate/cue.mddeleted−53
@@ -1,53 +0,0 @@
1−### `++cue`
2−
3−Unpack atom to noun
4−
5−Produces a noun unpacked from atom `a`. The inverse of jam.
6−
7−Accepts
8−-------
9−
10−`a` is an [atom]().
11−
12−Produces
13−--------
14−
15−A [`++noun`]().
16−
17−Source
18−------
19−
20− ++ cue :: unpack atom to noun
21− ~/ %cue
22− |= a=@
23− ^- *
24− =+ b=0
25− =+ m=`(map ,@ ,*)`~
26− =< q
27− |- ^- [p=@ q=* r=_m]
28− ?: =(0 (cut 0 [b 1] a))
29− =+ c=(rub +(b) a)
30− [+(p.c) q.c (~(put by m) b q.c)]
31− =+ c=(add 2 b)
32− ?: =(0 (cut 0 [+(b) 1] a))
33− =+ u=$(b c)
34− =+ v=$(b (add p.u c), m r.u)
35− =+ w=[q.u q.v]
36− [(add 2 (add p.u p.v)) w (~(put by r.v) b w)]
37− =+ d=(rub c a)
38− [(add 2 p.d) (need (~(get by m) q.d)) m]
39− ::
40−
41−
42−Examples
43−--------
44−
45− ~zod/try=> (cue 12)
46− 1
47− ~zod/try=> (cue 817)
48− [1 1]
49− ~zod/try=> (cue 4.657)
50− [1 2]
51− ~zod/try=> (cue 39.689)
52− [0 19]
53−
docs/system/hoon/library/gate/curr.mddeleted−35
@@ -1,35 +0,0 @@
1−### `++curr`
2−
3−Right curry
4−
5−Right curry a gate, binding the tail of its sample
6−
7−Accepts
8−-------
9−
10−`a` is a [gate]().
11−
12−`c` is a [noun]().
13−
14−Produces
15−--------
16−
17−
18−Source
19−------
20−
21− ++ curr
22− |* [a=_|=(^ _*) c=*]
23− |* b=_+<+.a
24− (a b c)
25−
26−Examples
27−--------
28−
29− ~zod/try=> =tep (curr scan sym)
30− ~zod/try=> `@t`(tep "asd")
31− 'asd'
32− ~zod/try=> `@t`(tep "lek-om")
33− 'lek-om'
34−
35−
docs/system/hoon/library/gate/cury.mddeleted−34
@@ -1,34 +0,0 @@
1−### `++cury`
2−
3−Curry a gate, binding the head of its sample
4−
5−Accepts
6−-------
7−
8−`a` is a [gate]().
9−
10−`b` is a [noun]().
11−
12−Produces
13−--------
14−
15−A [gate]().
16−
17−Source
18−------
19−
20− ++ cury
21− |* [a=_|=(^ _*) b=*]
22− |* c=_+<+.a
23− (a b c)
24−
25−Examples
26−--------
27−
28− ~zod/try=> =mol (cury add 2)
29− ~zod/try=> (mol 4)
30− 6
31− ~zod/try=> (mol 7)
32− 9
33−
34−
docs/system/hoon/library/gate/cuss.mddeleted−39
@@ -1,39 +0,0 @@
1−### `++cuss`
2−
3−To uppercase
4−
5−Turn all occurances of lowercase letters in any [`++tape`]() into uppercase
6−letters, as a [`++cord`]().
7−
8−Accepts
9−-------
10−
11−`vib` is a `++tape`.
12−
13−Produces
14−--------
15−
16−A `++cord`.
17−
18−Source
19−------
20−
21− ++ cuss :: uppercase
22− |= vib=tape
23− ^- @t
24− %+ rap 3
25− (turn vib |=(a=@ ?.(&((gte a 'a') (lte a 'z')) a (sub a 32))))
26− ::
27−
28−Examples
29−--------
30−
31− ~zod/try=> (cuss "john doe")
32− 'JOHN DOE'
33− ~zod/try=> (cuss "abc ABC 123 !@#")
34− 'ABC ABC 123 !@#'
35− ~zod/try=> `@ud`(cuss "abc")
36− 4.407.873
37− ~zod/try=> (cuss "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsQqRrVvWwXxYyZz")
38− 'AABBCCDDEEFFGGHHIIJJKKLLMMNNOOPPQQRRSSQQRRVVWWXXYYZZ'
39−
docs/system/hoon/library/gate/cut.mddeleted−49
@@ -1,49 +0,0 @@
1−### `++cut`
2−
3−Slice
4−
5−Slices `c` blocks of size `a` that are `b` blocks from the end of `d`.
6−
7−Accepts
8−-------
9−
10−`a` is a block size (see [++bloq]()).
11−
12−`b` is an [atom]().
13−
14−`c` is an atom.
15−
16−Produces
17−--------
18−
19−An atom.
20−
21−Source
22−------
23−
24− ++ cut :: slice
25− ~/ %cut
26− |= [a=bloq [b=@ c=@] d=@]
27− (end a c (rsh a b d))
28−
29−Examples
30−--------
31−
32− ~zod/try=> (cut 0 [1 1] 2)
33− 1
34− ~zod/try=> (cut 0 [2 1] 4)
35− 1
36− ~zod/try=> `@t`(cut 3 [0 3] 'abcdefgh')
37− 'abc'
38− ~zod/try=> `@t`(cut 3 [1 3] 'abcdefgh')
39− 'bcd'
40− ~zod/try=> `@ub`(cut 0 [0 3] 0b1111.0000.1101)
41− 0b101
42− ~zod/try=> `@ub`(cut 0 [0 6] 0b1111.0000.1101)
43− 0b1101
44− ~zod/try=> `@ub`(cut 0 [4 6] 0b1111.0000.1101)
45− 0b11.0000
46− ~zod/try=> `@ub`(cut 0 [3 6] 0b1111.0000.1101)
47− 0b10.0001
48−
49−
docs/system/hoon/library/gate/dawn.mddeleted−39
@@ -1,39 +0,0 @@
1−### `++dawn`
2−
3−Weekday of Jan 1
4−
5−Computes which day of the week January 1st falls on for a year `yer`,
6−producing an atom. Weeks are zero-indexed beginning on Sunday.
7−
8−Accepts
9−-------
10−
11−`yer` is an unsigned decimal, [`@ud`]().
12−
13−Produces
14−--------
15−
16−An atom.
17−
18−Source
19−------
20−
21− ++ dawn :: weekday of jan 1
22− |= yer=@ud
23− =+ yet=(sub yer 1)
24− %- mod :_ 7
25− :(add 1 (mul 5 (mod yet 4)) (mul 4 (mod yet 100)) (mul 6 (mod yet 400)))
26− ::
27−
28−Examples
29−--------
30−
31− ~zod/try=> (dawn 2.015)
32− 4
33− ~zod/try=> (dawn 1)
34− 1
35− ~zod/try=> (dawn 0)
36− ! subtract-underflow
37− ! exit
38−
39−
docs/system/hoon/library/gate/daws.mddeleted−37
@@ -1,37 +0,0 @@
1−### `++daws`
2−
3−Weekday of date
4−
5−Produces the day of the week of a given date `yed` as an atom. Weeks are
6−zero-indexed beginning on Sunday.
7−
8−Accepts
9−-------
10−
11−`yed` is a [`++date`]().
12−
13−Produces
14−--------
15−
16−An atom.
17−
18−Source
19−------
20−
21− ++ daws :: weekday of date
22− |= yed=date
23− %- mod :_ 7
24− (add (dawn y.yed) (sub (yawn [y.yed m.yed d.t.yed]) (yawn y.yed 1 1)))
25− ::
26−
27−Examples
28−--------
29−
30− ~zod/try=> (daws [[a=%.y y=2.014] m=6 t=[d=6 h=21 m=9 s=15 f=~[0xa16]]])
31− 5
32− ~zod/try=> (daws (yore -<-))
33− 2
34−
35−(second example always returns the current date).
36−
37−
docs/system/hoon/library/gate/deal.mddeleted−44
@@ -1,44 +0,0 @@
1−### `++deal`
2−
3−Add leap seconds
4−
5−Produces a [`++date`]() with the 25 leap seconds added.
6−
7−Accepts
8−-------
9−
10−`yer` is an absolute date, [`@da`]().
11−
12−Produces
13−--------
14−
15−A `++date`.
16−
17−Source
18−------
19−
20− ++ deal :: to leap sec time
21− |= yer=@da
22− =+ n=0
23− =+ yud=(yore yer)
24− |- ^- date
25− ?: (gte yer (add (snag n lef:yu) ~s1))
26− (yore (year yud(s.t (add n s.t.yud))))
27− ?: &((gte yer (snag n lef:yu)) (lth yer (add (snag n lef:yu) ~s1)))
28− yud(s.t (add +(n) s.t.yud))
29− ?: =(+(n) (lent lef:yu))
30− (yore (year yud(s.t (add +(n) s.t.yud))))
31− $(n +(n))
32− ::
33−
34−Examples
35−--------
36−
37− ~zod/try=> (yore (bex 127))
38− [[a=%.y y=226] m=12 t=[d=5 h=15 m=30 s=8 f=~]]
39− ~zod/try=> (deal `@da`(bex 127))
40− [[a=%.y y=226] m=12 t=[d=5 h=15 m=30 s=33 f=~]]
41− ~zod/try=> (yore (bex 126))
42− [[a=%.n y=146.138.512.088] m=6 t=[d=19 h=7 m=45 s=4 f=~]]
43−
44−
docs/system/hoon/library/gate/dec.mddeleted−40
@@ -1,40 +0,0 @@
1−### `++dec`
2−
3−Decrement
4−
5−Decrements `a` by `1`.
6−
7−Accepts
8−-------
9−
10−`a` is an [atom]().
11−
12−Produces
13−--------
14−
15−An atom.
16−
17−Source
18−------
19−
20− ++ dec :: decrement
21− ~/ %dec
22− |= a=@
23− ~| %decrement-underflow
24− ?< =(0 a)
25− =+ b=0
26− |- ^- @
27− ?: =(a +(b)) b
28− $(b +(b))
29− ::
30−
31−Examples
32−--------
33−
34− ~zod/try=> (dec 7)
35− 6
36− ~zod/try=> (dec 0)
37− ! decrement-underflow
38− ! exit
39−
40−
docs/system/hoon/library/gate/deft.mddeleted−48
@@ -1,48 +0,0 @@
1−### `++deft`
2−
3−Import URL path
4−
5−Parse the extension the from last element of url, which is delimited
6−either by a `.` or a `/`.
7−
8−Accepts
9−-------
10−
11−`rax` is a [`++list`]() of [`@t`]().
12−
13−Produces
14−--------
15−
16−A [`++pork`]().
17−
18−Source
19−------
20−
21− ++ deft :: import url path
22− |= rax=(list ,@t)
23− |- ^- pork
24− ?~ rax
25− [~ ~]
26− ?~ t.rax
27− =+ den=(trip i.rax)
28− =+ ^= vex
29− %- %- full
30− ;~(plug sym ;~(pose (stag ~ ;~(pfix dot sym)) (easy ~)))
31− [[1 1] (trip i.rax)]
32− ?~ q.vex
33− [~ [i.rax ~]]
34− [+.p.u.q.vex [-.p.u.q.vex ~]]
35− =+ pok=$(rax t.rax)
36− :- p.pok
37− [i.rax q.pok]
38− ::
39−
40−Examples
41−--------
42−
43− ~zod/try=> (deft /foo/bar/'baz.txt')
44− [p=[~ ~.txt] q=<|foo bar baz|>]
45− ~zod/try=> (deft /foo/bar/baz)
46− [p=~ q=<|foo bar baz|>]
47−
48−
docs/system/hoon/library/gate/dem.mddeleted−24
@@ -1,24 +0,0 @@
1−### `++dem`
2−
3−Decimal to atom
4−
5−Parse a decimal number to an atom.
6−
7−Source
8−------
9−
10− ++ dem (bass 10 (most gon dit)) :: decimal to atom
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "7" dem)
16− 7
17− ~zod/try=> (scan "42" dem)
18− 42
19− ~zod/try=> (scan "150000000" dem)
20− 150.000.000
21− ~zod/try=> (scan "12456" dem)
22− 12.456
23−
24−
docs/system/hoon/library/gate/dis.mddeleted−60
@@ -1,60 +0,0 @@
1−### `++dis`
2−
3−Binary AND
4−
5−Computes the bit-wise logical AND of two [atom]()s `a` and `b`, producing an
6−atom.
7−
8−Accepts
9−-------
10−
11−`a` is an atom.
12−
13−`b` is an atom.
14−
15−Produces
16−--------
17−
18−An atom.
19−
20−Source
21−------
22−
23− ++ dis :: binary and
24− ~/ %dis
25− |= [a=@ b=@]
26− =| [c=@ d=@]
27− |- ^- @
28− ?: ?|(=(0 a) =(0 b)) d
29− %= $
30− a (rsh 0 1 a)
31− b (rsh 0 1 b)
32− c +(c)
33− d %+ add d
34− %^ lsh 0 c
35− ?| =(0 (end 0 1 a))
36− =(0 (end 0 1 b))
37− ==
38− ==
39−
40−Examples
41−--------
42−
43− ~zod/try=> `@ub`9
44− 0b1001
45− ~zod/try=> `@ub`5
46− 0b101
47− ~zod/try=> `@ub`(dis 9 5)
48− 0b1
49− ~zod/try=> (dis 9 5)
50− 1
51− ~zod/try=> `@ub`534
52− 0b10.0001.0110
53− ~zod/try=> `@ub`987
54− 0b11.1101.1011
55− ~zod/try=> `@ub`(dis 534 987)
56− 0b10.0001.0010
57− ~zod/try=> (dis 534 987)
58− 530
59−
60−
docs/system/hoon/library/gate/dit.mddeleted−22
@@ -1,22 +0,0 @@
1−### `++dit`
2−
3−Decimal digit
4−
5−Parse a single decimal digit.
6−
7−Source
8−------
9−
10− ++ dit (cook |=(a=@ (sub a '0')) (shim '0' '9')) :: decimal digit
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "7" dit)
16− 7
17− ~zod/try=> (scan "42" (star dit))
18− ~[4 2]
19− ~zod/try=> (scan "26000" (star dit))
20− ~[2 6 0 0 0]
21−
22−
docs/system/hoon/library/gate/div.mddeleted−43
@@ -1,43 +0,0 @@
1−### `++div`
2−
3−Divide
4−
5−Computes `a` divided by `b`.
6−
7−Accepts
8−-------
9−
10−`a` is an [atom]().
11−
12−`b` is an [atom]().
13−
14−Produces
15−--------
16−
17−An atom.
18−
19−Source
20−------
21−
22− ++ div :: divide
23− ~/ %div
24− |= [a=@ b=@]
25− ^- @
26− ~| 'div'
27− ?< =(0 b)
28− =+ c=0
29− |-
30− ?: (lth a b) c
31− $(a (sub a b), c +(c))
32− ::
33−
34−Examples
35−--------
36−
37− ~zod/try=> (div 4 2)
38− 2
39− ~zod/try=> (div 17 8)
40− 2
41− ~zod/try=> (div 20 30)
42− 0
43−
docs/system/hoon/library/gate/dog.mddeleted−21
@@ -1,21 +0,0 @@
1−### `++dog`
2−
3−`.` optional gap
4−
5−Dot followed by an optional gap, used with numbers.
6−
7−Source
8−------
9−
10− ++ dog ;~(plug dot gay) ::
11−
12−Examples
13−--------
14−
15− /~zod/try=> 1.234.
16− 703
17− 1.234.703
18− ~zod/try=> (scan "a. " ;~(pfix alf dog))
19− [~~~. ~]
20−
21−
docs/system/hoon/library/gate/doh.mddeleted−25
@@ -1,25 +0,0 @@
1−### `++doh`
2−
3−`@p` separator
4−
5−Phonetic base phrase separator
6−
7−Source
8−------
9−
10− ++ doh ;~(plug ;~(plug hep hep) gay) ::
11−
12−Examples
13−--------
14−
15− /~zod/try=> ~nopfel-botduc-nilnev-dolfyn--haspub-natlun-lodmur-holtyd
16− ~nopfel-botduc-nilnev-dolfyn--haspub-natlun-lodmur-holtyd
17− /~zod/try=> ~nopfel-botduc-nilnev-dolfyn--
18− haspub-natlun-lodmur-holtyd
19− ~nopfel-botduc-nilnev-dolfyn--haspub-natlun-lodmur-holtyd
20− ~zod/try=> (scan "--" doh)
21− [[~~- ~~-] ~]
22− ~zod/try=> (scan "-- " doh)
23− [[~~- ~~-] ~]
24−
25−
docs/system/hoon/library/gate/doq.mddeleted−28
@@ -1,28 +0,0 @@
1−### `++doq`
2−
3−Parse double quote
4−
5−Parses ASCII character 34, the double quote.
6−
7−Source
8−------
9−
10− ++ doq (just '"')
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "\"" doq)
16− ~~~22.
17− ~zod/try=> `cord`(scan "\"" doq)
18− '"'
19− ~zod/try=> (doq [[1 1] "\""])
20− [p=[p=1 q=2] q=[~ [p=~~~22. q=[p=[p=1 q=2] q=""]]]]
21− ~zod/try=> (doq [[1 1] "not successfully parsed"])
22− [p=[p=1 q=1] q=~]
23− ~zod/try=> (scan "see?" doq)
24− ! {1 1}
25− ! 'syntax-error'
26− ! exit
27−
28−
docs/system/hoon/library/gate/dor.mddeleted−52
@@ -1,52 +0,0 @@
1−### `++dor`
2−
3−Numeric order
4−
5−Computes whether `a` and `b` are in ascending numeric order, producing a
6−boolean.
7−
8−Accepts
9−-------
10−
11−`a` is a [noun]().
12−
13−`b` is a noun.
14−
15−Produces
16−--------
17−
18−A boolean atom.
19−
20−Source
21−------
22−
23− ++ dor :: d-order
24− ~/ %dor
25− |= [a=* b=*]
26− ^- ?
27− ?: =(a b) &
28− ?. ?=(@ a)
29− ?: ?=(@ b) |
30− ?: =(-.a -.b)
31− $(a +.a, b +.b)
32− $(a -.a, b -.b)
33− ?. ?=(@ b) &
34− (lth a b)
35−
36−Examples
37−--------
38−
39− ~zod/try=> (dor 1 2)
40− %.y
41− ~zod/try=> (dor 2 1)
42− %.n
43− ~zod/try=> (dor ~[1 2 3] ~[1 2 4])
44− %.y
45− ~zod/try=> (dor ~[1 2 4] ~[1 2 3])
46− %.n
47− ~zod/try=> (dor (limo ~[99 100 10.000]) ~[99 101 10.000])
48− %.y
49− ~zod/try=> (dor ~[99 101 10.999] (limo ~[99 100 10.000]))
50− %.n
51−
52−
docs/system/hoon/library/gate/dot.mddeleted−24
@@ -1,24 +0,0 @@
1−### `++dot`
2−
3−Parse period
4−
5−Parses ASCII character 46, the period.
6−
7−Source
8−------
9−
10− ++ dot (just '.')
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "." dot)
16− ~~~.
17− ~zod/try=> `cord`(scan "." dot)
18− '.'
19− ~zod/try=> (dot [[1 1] "."])
20− [p=[p=1 q=2] q=[~ [p=~~~. q=[p=[p=1 q=2] q=""]]]]
21− ~zod/try=> (dot [[1 1] ".^"])
22− [p=[p=1 q=2] q=[~ [p=~~~. q=[p=[p=1 q=2] q="^"]]]]
23−
24−
docs/system/hoon/library/gate/drop.mddeleted−35
@@ -1,35 +0,0 @@
1−### `++drop`
2−
3−Unit to list
4−
5−Makes a [++list]() of the unwrapped value (`u.a`) of a [`++unit`]() `a`.
6−
7−Accepts
8−-------
9−
10−`a` is a unit.
11−
12−Produces
13−--------
14−
15−A list.
16−
17−Source
18−------
19−
20− ++ drop :: enlist
21− |* a=(unit)
22− ?~ a ~
23− [i=u.a t=~]
24−
25−Examples
26−--------
27−
28− ~zod/try=> =a ((unit ,@) [~ 97])
29− ~zod/try=> (drop a)
30− [i=97 t=~]
31− ~zod/try=> =a ((unit ,@) [~])
32− ~zod/try=> (drop a)
33− ~
34−
35−
docs/system/hoon/library/gate/dun.mddeleted−20
@@ -1,20 +0,0 @@
1−### `++dun`
2−
3−`--` to `~`
4−
5−Parse phep, `--`, to null, `~`.
6−
7−Source
8−------
9−
10− ++ dun (cold ~ ;~(plug hep hep)) :: -- (phep) to ~
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "--" dun)
16− ~
17− ~zod/try=> (dun [[1 1] "--"])
18− [p=[p=1 q=3] q=[~ u=[p=~ q=[p=[p=1 q=3] q=""]]]]
19−
20−
docs/system/hoon/library/gate/dust.mddeleted−42
@@ -1,42 +0,0 @@
1−### `++dust`
2−
3−Print UTC format
4−
5−Produces a [`++tape`]() of the date in UTC format.
6−
7−Accepts
8−-------
9−
10−`yed` is a [`++date`]().
11−
12−Produces
13−--------
14−
15−A `++tape`.
16−
17−Source
18−------
19−
20− ++ dust :: print UTC format
21− |= yed=date
22− ^- tape
23− =+ wey=(daws yed)
24− ;: weld
25− `tape`(snag wey (turn wik:yu |=(a=tape (scag 3 a))))
26− ", " ~(rud at d.t.yed) " "
27− `tape`(snag (dec m.yed) (turn mon:yu |=(a=tape (scag 3 a))))
28− " " (scag 1 ~(rud at y.yed)) (slag 2 ~(rud at y.yed)) " "
29− ~(rud at h.t.yed) ":" ~(rud at m.t.yed) ":" ~(rud at s.t.yed)
30− " " "+0000"
31− ==
32− ::
33−
34−Examples
35−--------
36−
37− ~zod/try=> (dust (yore ->-))
38− "Tue, 21 Oct 2014 21:35:12 +0000"
39− ~zod/try=> (dust [[a=%.y y=2.002] m=10 t=[d=11 h=12 m=20 s=55 f=~]])
40− "Fri, 11 Oct 2002 12:20:55 +0000"
41−
42−
docs/system/hoon/library/gate/duz.mddeleted−21
@@ -1,21 +0,0 @@
1−
2−### `++duz`
3−
4−`==` to `~`
5−
6−Parse stet, `==`, to null `~`.
7−
8−Source
9−------
10−
11− ++ duz (cold ~ ;~(plug tis tis)) :: == (stet) to ~
12−
13−Examples
14−--------
15−
16− ~zod/try=> (scan "==" duz)
17− ~
18− ~zod/try=> (duz [[1 1] "== |=..."])
19− [p=[p=1 q=3] q=[~ u=[p=~ q=[p=[p=1 q=3] q=" |=..."]]]]
20−
21−
docs/system/hoon/library/gate/earl.mddeleted−40
@@ -1,40 +0,0 @@
1−### `++earl`
2−
3−Localize purl
4−
5−Prepends a ship name to the spur of a [`++purl`]().
6−
7−Accepts
8−-------
9−
10−`who` is a [`@p`](), a ship name.
11−
12−`pul` is a `++purl`.
13−
14−Produces
15−--------
16−
17−A `++purl`.
18−
19−Source
20−------
21−
22− ++ earl :: localize purl
23− |= [who=@p pul=purl]
24− ^- purl
25− pul(q.q [(rsh 3 1 (scot %p who)) q.q.pul])
26− ::
27−
28−Examples
29−--------
30−
31− ~zod/main=> (need (epur 'http://123.1.1.1/me.ham'))
32− [p=[p=%.n q=~ r=[%.n p=.123.1.1.1]] q=[p=[~ ~.ham] q=<|me|>] r=~]
33− ~zod/main=> (earl ~zod (need (epur 'http://123.1.1.1/me.ham')))
34− [p=[p=%.n q=~ r=[%.n p=.123.1.1.1]] q=[p=[~ ~.ham] q=<|zod me|>] r=~]
35− ~zod/main=> (earl ~pittyp (need (epur 'http://123.1.1.1/me.ham')))
36− [p=[p=%.n q=~ r=[%.n p=.123.1.1.1]] q=[p=[~ ~.ham] q=<|pittyp me|>] r=~]
37− ~zod/main=> (earn (earl ~pittyp (need (epur 'http://123.1.1.1/me.ham'))))
38− "http://123.1.1.1/pittyp/me"
39−
40−
docs/system/hoon/library/gate/earn.mddeleted−180
@@ -1,180 +0,0 @@
1−### `++earn`
2−
3−Purl to tape
4−
5−Parses a [`++purl`]() `pul` to a [`++tape`]().
6−
7−Accepts
8−-------
9−
10−`pul` is a `++purl`.
11−
12−Produces
13−--------
14−
15−A `++tape`.
16−
17−Source
18−------
19−
20− ++ earn :: purl to tape
21− |^ |= pul=purl
22− ^- tape
23− :(weld (head p.pul) "/" (body q.pul) (tail r.pul))
24− ::
25−
26−Examples
27−--------
28−
29− ~zod/main=> (earn [| ~ [%| .127.0.0.1]] [~ ~] ~)
30− "http://127.0.0.1/"
31− ~zod/main=> (earn [| ~ `/com/google/www] [~ ~] ~)
32− "http://www.google.com/"
33− ~zod/main=> (earn [& ~ `/com/google/www] [~ ~] ~)
34− "https://www.google.com/"
35− ~zod/main=> (earn [& `200 `/com/google/www] [~ ~] ~)
36− "https://www.google.com:200/"
37− ~zod/main=> (earn [& `200 `/com/google/www] [~ /search] ~)
38− "https://www.google.com:200/search"
39− ~zod/main=> (earn [& ~ `/com/google/www] [`%html /search] ~)
40− "https://www.google.com/search"
41− ~zod/main=> (earn [& ~ `/com/google/www] [~ /search] [%q 'urbit'] ~)
42− "https://www.google.com/search?q=urbit"
43− ~zod/main=> (earn [& ~ `/com/google/www] [~ /search] [%q 'urbit escaping?'] ~)
44− "https://www.google.com/search?q=urbit%20escaping%3F"
45−
46−### `++body`
47−
48−Render URL path
49−
50−Renders URL path `pok` as a [`++tape`]().
51−
52−Accepts
53−-------
54−
55−`pok` is a [`++pork`]().
56−
57−Produces
58−--------
59−
60−A `++tape`.
61−
62−Source
63−------
64−
65− ++ body
66− |= pok=pork ^- tape
67− ?~ q.pok ~
68− |-
69− =+ seg=(trip i.q.pok)
70− ?~ t.q.pok
71− ?~(p.pok seg (welp seg '.' (trip u.p.pok)))
72− (welp seg '/' $(q.pok t.q.pok))
73− ::
74−
75−Examples
76−--------
77−
78− ~zod/main=> (body:earn ~ /foo/mol/lok)
79− "foo/mol/lok"
80− ~zod/main=> (body:earn `%htm /foo/mol/lok)
81− "foo/mol/lok.htm"
82− ~zod/main=> (body:earn `%htm /)
83− ""
84−
85−### `++head`
86−
87−Render URL beginning
88−
89−Renders a `++hart`, usually the beginning of a URL, as the [`++tape`]()
90−of a traditional URL.
91−
92−Accepts
93−-------
94−
95−`har` is a `++heart`.
96−
97−Produces
98−--------
99−
100−A `++tape`.
101−
102−Source
103−------
104−
105− ++ head
106− |= har=hart
107− ^- tape
108− ;: weld
109− ?:(&(p.har !=([& /localhost] r.har)) "https://" "http://")
110− ::
111− ?- -.r.har
112− | (trip (rsh 3 1 (scot %if p.r.har)))
113− & =+ rit=(flop p.r.har)
114− |- ^- tape
115− ?~(rit ~ (weld (trip i.rit) ?~(t.rit "" `tape`['.' $(rit t.rit)])))
116− ==
117− ::
118− ?~(q.har ~ `tape`[':' (trip (rsh 3 2 (scot %ui u.q.har)))])
119− ==
120− ::
121−
122−Examples
123−--------
124−
125− ~zod/main=> (head:earn | ~ %| .127.0.0.1)
126− "http://127.0.0.1"
127− ~zod/main=> (head:earn & ~ %| .127.0.0.1)
128− "https://127.0.0.1"
129− ~zod/main=> (head:earn & [~ 8.080] %| .127.0.0.1)
130− "https://127.0.0.1:8080"
131− ~zod/main=> (head:earn & [~ 8.080] %& /com/google/www)
132− "https://www.google.com:8080"
133−
134−### `++tail`
135−
136−Render query string
137−
138−Renders a [`++quay`](), a query string in hoon, to the [`++tape`]() of a
139−traditional query string.
140−
141−Accepts
142−-------
143−
144−`kay` is a `++quay`.
145−
146−Produces
147−--------
148−
149−A `++tape`.
150−
151−Source
152−------
153−
154− ++ tail
155− |= kay=quay
156− ^- tape
157− ?: =(~ kay) ~
158− :- '?'
159− |- ^- tape
160− ?~ kay ~
161− ;: weld
162− (urle (trip p.i.kay))
163− "="
164− (urle (trip q.i.kay))
165− ?~(t.kay ~ `tape`['&' $(kay t.kay)])
166− ==
167− --
168− ::
169−
170−Examples
171−--------
172−
173− ~zod/main=> (tail:earn ~)
174− ""
175− ~zod/main=> (tail:earn [%ask 'bid'] ~)
176− "?ask=bid"
177− ~zod/main=> (tail:earn [%ask 'bid'] [%make 'well'] ~)
178− "?ask=bid&make=well"
179−
180−
docs/system/hoon/library/gate/easy.mddeleted−40
@@ -1,40 +0,0 @@
1−### `++easy`
2−
3−Always parse
4−
5−Parser generator. Produces a parser that succeeds with given [noun]() `huf`
6−without consuming any text.
7−
8−Accepts
9−-------
10−
11−`huf` is a noun.
12−
13−Produces
14−--------
15−
16−A [`++rule`]().
17−
18−Source
19−------
20−
21− ++ easy :: always parse
22− ~/ %easy
23− |* huf=*
24− ~/ %fun
25− |= tub=nail
26− ^- (like ,_huf)
27− [p=p.tub q=[~ u=[p=huf q=tub]]]
28− ::
29−
30−Examples
31−--------
32−
33− ~zod/try=> ((easy %foo) [[1 1] "abc"])
34− [p=[p=1 q=1] q=[~ [p=%foo q=[p=[p=1 q=1] q="abc"]]]]
35− ~zod/try=> ((easy %foo) [[1 1] "bc"])
36− [p=[p=1 q=1] q=[~ [p=%foo q=[p=[p=1 q=1] q="bc"]]]]
37− ~zod/try=> ((easy 'a') [[1 1] "bc"])
38− [p=[p=1 q=1] q=[~ [p='a' q=[p=[p=1 q=1] q="bc"]]]]
39−
40−
docs/system/hoon/library/gate/egcd.mddeleted−39
@@ -1,39 +0,0 @@
1−### `++egcd`
2−
3−GCD
4−
5− ++ egcd :: schneier's egcd
6− |= [a=@ b=@]
7− =+ si
8− =+ [c=(sun a) d=(sun b)]
9− =+ [u=[c=(sun 1) d=--0] v=[c=--0 d=(sun 1)]]
10− |- ^- [d=@ u=@ v=@]
11− ?: =(--0 c)
12− [(abs d) d.u d.v]
13− :: ?> ?& =(c (sum (pro (sun a) c.u) (pro (sun b) c.v)))
14− :: =(d (sum (pro (sun a) d.u) (pro (sun b) d.v)))
15− :: ==
16− =+ q=(fra d c)
17− %= $
18− c (dif d (pro q c))
19− d c
20− u [(dif d.u (pro q c.u)) c.u]
21− v [(dif d.v (pro q c.v)) c.v]
22− ==
23− ::
24−
25−Greatest common denominator
26−
27− ~zod/try=> (egcd 20 15)
28− [d=5 u=2 v=1]
29− ~zod/try=> (egcd 24 16)
30− [d=8 u=2 v=1]
31− ~zod/try=> (egcd 7 5)
32− [d=1 u=3 v=6]
33− ~zod/try=> (egcd (shaf ~ %ham) (shaf ~ %sam))
34− [ d=1
35− u=59.983.396.314.566.203.239.184.568.129.921.874.787
36− v=38.716.650.351.034.402.960.165.718.823.532.275.722
37− ]
38−
39−
docs/system/hoon/library/gate/end.mddeleted−50
@@ -1,50 +0,0 @@
1−### `++end`
2−
3−Tail
4−
5−Produces an [atom]() by taking the last `b` blocks of size `a` from `c`.
6−
7−Accepts
8−-------
9−
10−`a` is a block size (see [`++bloq`]()).
11−
12−`b` is an atom.
13−
14−`c` is an [atom]().
15−
16−Produces
17−--------
18−
19−An atom.
20−
21−
22−Source
23−------
24−
25− ++ end :: tail
26− ~/ %end
27− |= [a=bloq b=@ c=@]
28− (mod c (bex (mul (bex a) b)))
29−
30−Examples
31−--------
32−
33− ~zod/try=> `@ub`12
34− 0b1100
35− ~zod/try=> `@ub`(end 0 3 12)
36− 0b100
37− ~zod/try=> (end 0 3 12)
38− 4
39− ~zod/try=> `@ub`(end 1 3 12)
40− 0b1100
41− ~zod/try=> (end 1 3 12)
42− 12
43− ~zod/try=> `@ux`'abc'
44− 0x63.6261
45− ~zod/try=> `@ux`(end 3 2 'abc')
46− 0x6261
47− ~zod/try=> `@t`(end 3 2 'abc')
48− 'ab'
49−
50−
docs/system/hoon/library/gate/fail.mddeleted−31
@@ -1,31 +0,0 @@
1−### `++fail`
2−
3−Never parse
4−
5−Produces an [`++edge`]() at the same text position ([`++hair`]()) with a failing
6−result (`q=~`).
7−
8−Accepts
9−-------
10−
11−`tub` is a [`++nail`]().
12−
13−Produces
14−--------
15−
16−An `++edge`.
17−
18−Source
19−------
20−
21− ++ fail |=(tub=nail [p=p.tub q=~]) :: never parse
22−
23−Examples
24−--------
25−
26− ~zod/try=> (fail [[1 1] "abc"])
27− [p=[p=1 q=1] q=~]
28− ~zod/try=> (fail [[p=1.337 q=70] "Parse me, please?"])
29− [p=[p=1.337 q=70] q=~]
30−
31−
docs/system/hoon/library/gate/fain.mddeleted−56
@@ -1,56 +0,0 @@
1−### `++fain`
2−
3−Restructure path
4−
5−Splits a concrete
6−
7−[`++spur`]() out of a full [`++path`](), producing a location [`++beam`]() and
8−a remainder [`++path`]().
9−
10−Accepts
11−-------
12−
13−`hom` is a `++path`
14−
15−Produces
16−--------
17−
18− ([pair]() beam path)
19−
20−Source
21−------
22−
23− ++ fain :: path restructure
24− |= [hom=path raw=path]
25− =+ bem=(need (tome raw))
26− =+ [mer=(flop s.bem) moh=(flop hom)]
27− |- ^- (pair beam path)
28− ?~ moh
29− [bem(s hom) (flop mer)]
30− ?> &(?=(^ mer) =(i.mer i.moh))
31− $(mer t.mer, moh t.moh)
32− ::
33−
34−Examples
35−--------
36−
37− ~zod/try=> (fain / %)
38− [p=[[p=~zod q=%try r=[%da p=~2014.11.1..00.07.17..c835]] s=/] q=/]
39− ~zod/try=> (fain /lok %)
40− ! exit
41− ~zod/try=> (fain / %/mer/lok/tem)
42− [ p=[[p=~zod q=%try r=[%da p=~2014.11.1..00.08.03..bfdf]] s=/]
43− q=/tem/lok/mer
44− ]
45− ~zod/try=> (fain /mer %/mer/lok/tem)
46− [p=[[p=~zod q=%try r=[%da p=~2014.11.1..00.08.15..4da0]] s=/mer] q=/tem/lok]
47− ~zod/try=> (fain /lok/mer %/mer/lok/tem)
48− [p=[[p=~zod q=%try r=[%da p=~2014.11.1..00.08.24..4d9e]] s=/lok/mer] q=/tem]
49− ~zod/try=> (fain /lok/mer %/mer)
50− ! exit
51− ~zod/try=> (fain /hook/hymn/tor %/tor/hymn/hook/'._req_1234__')
52− [ p=[[p=~zod q=%try r=[%da p=~2014.11.1..00.09.25..c321]] s=/hook/hymn/tor]
53− q=/._req_1234__
54− ]
55−
56−
docs/system/hoon/library/gate/fall.mddeleted−34
@@ -1,34 +0,0 @@
1−### `++fall`
2−
3−Give unit a default value
4−
5−Produces a default value `b` for a [`++unit`]() `a` in cases where `a` is null.
6−
7−Accepts
8−-------
9−
10−`a` is a unit.
11−
12−`b` is a [noun]() that's used as the default value.
13−
14−Produces
15−--------
16−
17−Either a noun `b` or the unwrapped value of unit `a`.
18−
19−Source
20−------
21−
22− ++ fall :: default
23− |* [a=(unit) b=*]
24− ?~(a b u.a)
25−
26−Examples
27−--------
28−
29− ~zod/try=> (fall ~ `a`)
30− `a`
31− ~zod/try=> (fall [~ u=0] `a`)
32− 0
33−
34−
docs/system/hoon/library/gate/fas.mddeleted−24
@@ -1,24 +0,0 @@
1−### `++fas`
2−
3−Parse forward slash
4−
5−Parses ASCII character 47, the forward slash.
6−
7−Source
8−------
9−
10− ++ fas (just '/')
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "/" fas)
16− ~~~2f.
17− ~zod/try=> `cord`(scan "/" fas)
18− '/'
19− ~zod/try=> (fas [[1 1] "/"])
20− [p=[p=1 q=2] q=[~ [p=~~~2f. q=[p=[p=1 q=2] q=""]]]]
21− ~zod/try=> (fas [[1 1] "|/"])
22− [p=[p=1 q=1] q=~]
23−
24−
docs/system/hoon/library/gate/feel.mddeleted−47
@@ -1,47 +0,0 @@
1−### `++feel`
2−
3−Generate file diff
4−
5−Generates a diff between a file located at `pax` and an input value
6−`val`.
7−
8−Accepts
9−-------
10−
11−`pax` is a [`++path`]().
12−
13−`val` is a value as a [noun]().
14−
15−Produces
16−--------
17−
18−A [`++miso`]().
19−
20−Source
21−------
22−
23− ++ feel :: simple file write
24− |= [pax=path val=*]
25− ^- miso
26− =+ dir=((hard arch) .^(%cy pax))
27− ?~ q.dir [%ins val]
28− :- %mut
29− ^- udon
30− [%a %a .^(%cx pax) val]
31− ::
32−
33−Examples
34−--------
35−
36− ~zod/try=> + %/mel 'test'
37− + /~zod/try/2/mel
38− ~zod/try=> (feel %/mel 'tesh?')
39− [%mut p=[p=%a q=[%a p=44.903.392.628 q=272.335.332.724]]]
40− ~zod/try=> `@t`44.903.392.628
41− '''
42− test
43− '''
44− ~zod/try=> `@t`272.335.332.724
45− 'tesh?'
46−
47−
docs/system/hoon/library/gate/fil.mddeleted−45
@@ -1,45 +0,0 @@
1−### `++fil`
2−
3−Fill bloqstream
4−
5−Produces an [atom]() by repeating `c` for `b` blocks of size `a`.
6−
7−Accepts
8−-------
9−
10−`a` is a block size (see [`++bloq`]()).
11−
12−`b` is an atom.
13−
14−`c` is an [atom]().
15−
16−Produces
17−--------
18−
19−An atom.
20−
21−Source
22−------
23−
24− ++ fil :: fill bloqstream
25− |= [a=bloq b=@ c=@]
26− =+ n=0
27− =+ d=c
28− |- ^- @
29− ?: =(n b)
30− (rsh a 1 d)
31− $(d (add c (lsh a 1 d)), n +(n))
32−
33−Examples
34−--------
35−
36− ~zod/try=> `@t`(fil 3 5 %a)
37− 'aaaaa'
38− ~zod/try=> `@t`(fil 5 10 %ceeb)
39− 'ceebceebceebceebceebceebceebceebceebceeb'
40− ~zod/try=> `@t`(fil 4 10 %eced)
41− 'ʇʇʇʇʇʇʇʇʇʇed'
42− ~zod/try=> `@tas`(fil 4 10 %bf)
43− %bfbfbfbfbfbfbfbfbfbf
44−
45−
docs/system/hoon/library/gate/file.mddeleted−44
@@ -1,44 +0,0 @@
1−### `++file`
2−
3−Simple file load
4−
5−Reads the value of a file located at `pax` and renders it as a
6−[`++unit`]().
7−
8−Accepts
9−-------
10−
11−`pax` is a [`++path`]().
12−
13−Produces
14−--------
15−
16−The `++unit` of a [`++noun`]().
17−
18−Source
19−------
20−
21− ++ file :: simple file load
22− |= pax=path
23− ^- (unit)
24− =+ dir=((hard arch) .^(%cy pax))
25− ?~(q.dir ~ [~ .^(%cx pax)])
26− ::
27−
28−Examples
29−--------
30−
31− ~zod/try=> %/zak
32− ~zod/try=/zak> :ls %
33− ~zod/try=/zak> + %/mop 20
34− + /~zod/try/3/zak/mop
35− ~zod/try=/zak> :ls %
36− mop
37− ~zod/try=/zak> (file %/mop)
38− [~ 20]
39− ~zod/try=/zak> (file %/lak)
40− ~
41− ~zod/try=/zak> (file /==2%/mop)
42− ~
43−
44−
docs/system/hoon/library/gate/flop.mddeleted−38
@@ -1,38 +0,0 @@
1−Reverse
2−
3−### `++flop`
4−
5−Produces the list `a` in reverse order.
6−
7−Accepts
8−-------
9−
10−`a` is a list.
11−
12−Produces
13−--------
14−
15−A list.
16−
17−Source
18−------
19−
20− ++ flop :: reverse
21− ~/ %flop
22− |* a=(list)
23− => .(a (homo a))
24− ^+ a
25− =+ b=`_a`~
26− |-
27− ?~ a b
28− $(a t.a, b [i.a b])
29−
30−
31−Examples
32−--------
33−
34− ~zod/try=> =a (limo [1 2 3 ~])
35− ~zod/try=> (flop a)
36− ~[3 2 1]
37−
38−
docs/system/hoon/library/gate/fnv.mddeleted−33
@@ -1,33 +0,0 @@
1−### `++fnv`
2−
3−Hashes an atom with the 32-bit FNV non-cryptographic hash algorithm.
4−Multiplies `a` by the prime number 16,777,619 and then takes the block
5−of size 5 off the product's end, producing an [atom]().
6−
7−Accepts
8−-------
9−
10−`a` is an atom.
11−
12−Produces
13−--------
14−
15−An atom.
16−
17−
18−Source
19−------
20−
21− ++ fnv |=(a=@ (end 5 1 (mul 16.777.619 a))) :: FNV scrambler
22−
23−Examples
24−--------
25−
26− ~zod/try=> (fnv 10.000)
27− 272.465.456
28− ~zod/try=> (fnv 10.001)
29− 289.243.075
30− ~zod/try=> (fnv 1)
31− 16.777.619
32−
33−
docs/system/hoon/library/gate/foal.mddeleted−43
@@ -1,43 +0,0 @@
1−
2−### `++foal`
3−
4−Write high-level change
5−
6−Produces a [`++toro`](), a change intended for whatever file is located
7−at `pax`. Handled by `%clay`.
8−
9−Accepts
10−-------
11−
12−`pax` is a [`++path`]().
13−
14−`val` is a value as a [noun]().
15−
16−Produces
17−--------
18−
19−A [`++toro`]().
20−
21−Source
22−------
23−
24− ++ foal :: high-level write
25− |= [pax=path val=*]
26− ^- toro
27− ?> ?=([* * * *] pax)
28− [i.t.pax [%& [*cart [[t.t.t.pax (feel pax val)] ~]]]]
29− ::
30−
31−Examples
32−--------
33−
34− ~zod/try=> + %/mek 'a'
35− + /~zod/try/4/mek
36− ~zod/try=> (foal %/mek 'b')
37− [ p=~.try
38− q
39− [%.y q=[p=[p=0v0 q=0v0] q=~[[p=/mek q=[%mut p=[p=%a q=[%a p=97 q=98]]]]]]]
40− ]
41− ~zod/try=> (feel %/mek 'b')
42− [%mut p=[p=%a q=[%a p=97 q=98]]]
43−
docs/system/hoon/library/gate/foo.shdeleted−47
@@ -1,47 +0,0 @@
1−#!/bin/sh
2−
3−mv ./gate/add.hoon ./gate/add.md
4−mv ./gate/biff.hoon ./gate/biff.md
5−mv ./gate/bind.hoon ./gate/bind.md
6−mv ./gate/bond.hoon ./gate/bond.md
7−mv ./gate/both.hoon ./gate/both.md
8−mv ./gate/cap.hoon ./gate/cap.md
9−mv ./gate/clap.hoon ./gate/clap.md
10−mv ./gate/corl.hoon ./gate/corl.md
11−mv ./gate/cury.hoon ./gate/cury.md
12−mv ./gate/dec.hoon ./gate/dec.md
13−mv ./gate/div.hoon ./gate/div.md
14−mv ./gate/drop.hoon ./gate/drop.md
15−mv ./gate/fall.hoon ./gate/fall.md
16−mv ./gate/flop.hoon ./gate/flop.md
17−mv ./gate/gte.hoon ./gate/gte.md
18−mv ./gate/gth.hoon ./gate/gth.md
19−mv ./gate/homo.hoon ./gate/homo.md
20−mv ./gate/lift.hoon ./gate/lift.md
21−mv ./gate/lte.hoon ./gate/lte.md
22−mv ./gate/lth.hoon ./gate/lth.md
23−mv ./gate/mas.hoon ./gate/mas.md
24−mv ./gate/mate.hoon ./gate/mate.md
25−mv ./gate/max.hoon ./gate/max.md
26−mv ./gate/min.hoon ./gate/min.md
27−mv ./gate/mod.hoon ./gate/mod.md
28−mv ./gate/mul.hoon ./gate/mul.md
29−mv ./gate/need.hoon ./gate/need.md
30−mv ./gate/peg.hoon ./gate/peg.md
31−mv ./gate/some.hoon ./gate/some.md
32−mv ./gate/sub.hoon ./gate/sub.md
33−mv ./gate/yall.hoon ./gate/yall.md
34−mv ./gate/yawn.hoon ./gate/yawn.md
35−mv ./gate/yell.hoon ./gate/yell.md
36−mv ./gate/yelp.hoon ./gate/yelp.md
37−mv ./gate/yule.hoon ./gate/yule.md
38−mv ./mold/jar.hoon ./mold/jar.md
39−mv ./mold/jug.hoon ./mold/jug.md
40−mv ./mold/map.hoon ./mold/map.md
41−mv ./mold/qeu.hoon ./mold/qeu.md
42−mv ./mold/set.hoon ./mold/set.md
43−mv ./mold/wain.hoon ./mold/wain.md
44−mv ./mold/wall.hoon ./mold/wall.md
45−mv ./mold/wine.hoon ./mold/wine.md
46−mv ./mold/wing.hoon ./mold/wing.md
47−mv ./mold/wonk.hoon ./mold/wonk.md
docs/system/hoon/library/gate/fray.mddeleted−38
@@ -1,38 +0,0 @@
1−
2−### `++fray`
3−
4−High-level delete
5−
6−Produces a deletion [`++toro`]() for a file located at path `pax`.
7−Handled by `%clay`.
8−
9−Accepts
10−-------
11−
12−`pax` is a [`++path`]().
13−
14−Produces
15−--------
16−
17−A `++toro`.
18−
19−Source
20−------
21−
22− ++ fray :: high-level delete
23− |= pax=path
24− ^- toro
25− ?> ?=([* * * *] pax)
26− [i.t.pax [%& [*cart [[t.t.t.pax [%del .^(%cx pax)]] ~]]]]
27− ::
28−
29−Examples
30−--------
31−
32− ~zod/try=> + %/mek 'a'
33− + /~zod/try/4/mek
34− ~zod/try=> (fray %/mek)
35− [p=~.try q=[%.y q=[p=[p=0v0 q=0v0] q=~[[p=/mek q=[%del p=97]]]]]]
36− ~zod/try=> `@t`97
37− 'a'
38−
docs/system/hoon/library/gate/fuel.mddeleted−77
@@ -1,77 +0,0 @@
1−### `++fuel`
2−
3−Parse fcgi
4−
5−Retrieieves the %eyre FCGI, producing a [`++epic`](). Used primarily in
6−[`/hook`]() files. See the [`%eyre`]() doc for more detail.
7−
8−Accepts
9−-------
10−
11−`bem` is a [`++beam`]().
12−
13−`but` is a [`++path`]().
14−
15−Produces
16−--------
17−
18−A `++epic`.
19−
20−Source
21−------
22−
23− ++ fuel :: parse fcgi
24− |= [bem=beam but=path]
25− ^- epic
26− ?> ?=([%web @ *] but)
27− =+ dyb=(slay i.t.but)
28− ?> ?& ?=([~ %many *] dyb)
29− ?=([* * *] p.u.dyb)
30− :: ?=([%$ %tas *] i.p.u.dyb)
31− ?=([%many *] i.p.u.dyb)
32− ?=([%blob *] i.t.p.u.dyb)
33− ==
34− =+ ced=((hard cred) p.i.t.p.u.dyb)
35− :: =+ nep=q.p.i.p.u.dyb
36− =+ ^= nyp ^- path
37− %+ turn p.i.p.u.dyb
38− |= a=coin ^- @ta
39− ?> ?=([%$ %ta @] a)
40− ?>(((sane %ta) q.p.a) q.p.a)
41− =+ ^= gut ^- (list ,@t)
42− %+ turn t.t.p.u.dyb
43− |= a=coin ^- @t
44− ?> ?=([%$ %t @] a)
45− ?>(((sane %t) q.p.a) q.p.a)
46− =+ ^= quy
47− |- ^- (list ,[p=@t q=@t])
48− ?~ gut ~
49− ?> ?=(^ t.gut)
50− [[i.gut i.t.gut] $(gut t.t.gut)]
51− :* (~(gas by *(map cord cord)) quy)
52− ced
53− bem
54− t.t.but
55− nyp
56− ==
57− ::
58−
59−Examples
60−--------
61−
62− ~zod/main=> (fuel [[p=~zod q=%try r=[%ud p=2]] s=/psal] /web/'._.~-~~~~.gen~-~-_~~05vg0001v09f0n30fbh7dn6ab2jakmmspdq04nef5h70qbd5lh6atr4c5j2qrbldpp62q1df1in0sr1ding0c3qgt7kclj74qb65lm6atrkc5k2qpr5e1mmispdchin4p3fegmiqrjpdlo62p1dchsn4p39comn8pbcehgmsbbef5p7crrifr3o035dhgfrk2b5__')
63− [ qix={}
64− ced
65− [ hut=[p=%.y q=[~ 8.445] r=[%.n p=.0.0.0.0]]
66− aut={[p=%$ q={'~rovryn-natlet-fidryd-dapmyn--todred-simpeg-hatwel-firfet'}]}
67− orx='laspex-harnum-fadweb-mipbyn'
68− acl=[~ 'en-US,en;q=0.8']
69− cip=[%.y p=.127.0.0.1]
70− cum={}
71− ]
72− bem=[[p=~zod q=%try r=[%ud p=2]] s=/psal]
73− but=/
74− nyp=/gen
75− ]
76−
77−
docs/system/hoon/library/gate/full.mddeleted−38
@@ -1,38 +0,0 @@
1−### `++full`
2−
3−Parse to end
4−
5−Parser modifier. Accepts a [`++rule`]() `sef`, and produces a parser that succeeds only
6−when the of `tub` is fully consumed using `sef`.
7−
8−Accepts
9−-------
10−
11−`sef` is a [`++rule`]().
12−
13−Produces
14−--------
15−
16−A `++rule`.
17−
18−Source
19−------
20−
21− ++ full :: parse to end
22− |* sef=_rule
23− |= tub=nail
24− =+ vex=(sef tub)
25− ?~(q.vex vex ?:(=(~ q.q.u.q.vex) vex [p=p.vex q=~]))
26− ::
27−
28−Examples
29−--------
30−
31− ~zod/try=> ((full (just 'a')) [[1 1] "ab"])
32− [p=[p=1 q=2] q=~]
33− ~zod/try=> ((full (jest 'ab')) [[1 1] "ab"])
34− [p=[p=1 q=3] q=[~ u=[p='ab' q=[p=[p=1 q=3] q=""]]]]
35− ~zod/try=> ((full ;~(plug (just 'a') (just 'b'))) [[1 1] "ab"])
36− [p=[p=1 q=3] q=[~ u=[p=[~~a ~~b] q=[p=[p=1 q=3] q=""]]]]
37−
38−
docs/system/hoon/library/gate/funk.mddeleted−36
@@ -1,36 +0,0 @@
1−### `++funk`
2−
3−Add to tape
4−
5−Parser modifier: prepend text to [`++tape`]() before applying parser.
6−
7−Accepts
8−-------
9−
10−`pre` is a `++tape`
11−
12−`sef` is a [`++rule`]()
13−
14−Produces
15−--------
16−
17−A `++rule`.
18−
19−Source
20−------
21−
22− ++ funk :: add to tape first
23− |* [pre=tape sef=_rule]
24− |= tub=nail
25− (sef p.tub (weld pre q.tub))
26− ::
27−
28−Examples
29−--------
30−
31− ~zod/try=> ((funk "abc prefix-" (jest 'abc')) [[1 1] "to be parsed"])
32− [p=[p=1 q=4] q=[~ [p='abc' q=[p=[p=1 q=4] q=" prefix-to be parsed"]]]]
33− ~zod/try=> ((funk "parse" (just 'a')) [[1 4] " me"])
34− [p=[p=1 q=4] q=~]
35−
36−
docs/system/hoon/library/gate/furl.mddeleted−50
@@ -1,50 +0,0 @@
1−### `++furl`
2−
3−Unify changes
4−
5−Merge two [`++toro`]()s `one` and `two` that are in the same [`desk`]()
6−and pointed at the same [`++path`]().
7−
8−Accepts
9−-------
10−
11−`one` is a `++toro`.
12−
13−`two` is a `++toro`.
14−
15−Produces
16−--------
17−
18−A `++toro`.
19−
20−Source
21−------
22−
23− ++ furl :: unify changes
24− |= [one=toro two=toro]
25− ^- toro
26− ~| %furl
27− ?> ?& =(p.one p.two) :: same path
28− &(?=(& -.q.one) ?=(& -.q.two)) :: both deltas
29− ==
30− [p.one [%& [*cart (weld q.q.q.one q.q.q.two)]]]
31− ::
32−
33−Examples
34−--------
35−
36− ~zod/try=> %/zak
37− ~zod/try=/zak> :ls %
38− mop
39− ~zod/try=/zak> (furl (fray %/mop) (foal %/mok 'hi'))
40− [ p=~.try
41− q
42− [ %.y
43− q
44− [ p=[p=0v0 q=0v0]
45− q=~[[p=/zak/mop q=[%del p=20]] [p=/zak/mok q=[%ins p=26.984]]]
46− ]
47− ]
48− ]
49−
50−
docs/system/hoon/library/gate/gah.mddeleted−35
@@ -1,35 +0,0 @@
1−
2−### `++gah`
3−
4−Newline or ' '
5−
6−Whitespace component, either newline or space.
7−
8−Source
9−------
10−
11− ++ gah (mask [`@`10 ' ' ~]) :: newline or ace
12−
13−Examples
14−--------
15−
16− /~zod/try=> ^- * :: show spaces
17− """
18− -
19− -
20− -
21− """
22− [32 32 32 45 10 32 45 10 32 32 45 0]
23− /~zod/try=> ^- *
24− """
25−
26− """
27− [32 32 32 10 32 10 32 32 0]
28− /~zod/try=> ^- (list ,@)
29− %- scan :_ (star gah)
30− """
31−
32− """
33− ~[32 32 32 10 32 10 32 32]
34−
35−
docs/system/hoon/library/gate/gal.mddeleted−26
@@ -1,26 +0,0 @@
1−### `++gal`
2−
3−Parse less-than sign
4−
5−Parses ASCII character 60, the less-than sign.
6−
7−Source
8−------
9−
10− ++ gal (just '<')
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "<" gal)
16− ~~~3c.
17− ~zod/try=> `cord`(scan "<" gal)
18− '<'
19− ~zod/try=> (gal [[1 1] "<"])
20− [p=[p=1 q=2] q=[~ [p=~~~3c. q=[p=[p=1 q=2] q=""]]]]
21− ~zod/try=> (gal [[1 1] "<+"])
22− [p=[p=1 q=2] q=[~ [p=~~~3c. q=[p=[p=1 q=2] q="+"]]]]
23− ~zod/try=> (gal [[1 1] "+<"])
24− [p=[p=1 q=1] q=~]
25−
26−
docs/system/hoon/library/gate/gap.mddeleted−12
@@ -1,12 +0,0 @@
1−### `++gap`
2−
3−Plural whitespace
4−
5−Separates tall runes
6−
7−Source
8−------
9−
10− ++ gap (cold ~ ;~(plug gaq (star ;~(pose vul gah)))) :: plural whitespace
11−
12−
docs/system/hoon/library/gate/gaq.mddeleted−17
@@ -1,17 +0,0 @@
1−### `++gaq`
2−
3−End of line
4−
5−Two spaces, a newline, or comment.
6−
7−Source
8−------
9−
10− ++ gaq ;~ pose :: end of line
11− (just `@`10)
12− ;~(plug gah ;~(pose gah vul))
13− vul
14− ==
15−
16−
17−
docs/system/hoon/library/gate/gar.mddeleted−24
@@ -1,24 +0,0 @@
1−### `++gar`
2−
3−Parse greater-than sign
4−
5−Parses ASCII character 62, the greater-than sign.
6−
7−Source
8−------
9−
10− ++ gar (just '>')
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan ">" gar)
16− ~~~3e.
17− ~zod/try=> `cord`(scan ">" gar)
18− '>'
19− ~zod/try=> (gar [[1 1] ">"])
20− [p=[p=1 q=2] q=[~ [p=~~~3e. q=[p=[p=1 q=2] q=""]]]]
21− ~zod/try=> (gar [[1 1] "=>"])
22− [p=[p=1 q=1] q=~]
23−
24−
docs/system/hoon/library/gate/gaw.mddeleted−12
@@ -1,12 +0,0 @@
1−### `++gaw`
2−
3−Classic whitespace
4−
5−Terran whitespace.
6−
7−Source
8−------
9−
10− ++ gaw (cold ~ (star ;~(pose vul gah))) :: classic white
11−
12−
docs/system/hoon/library/gate/gay.mddeleted−12
@@ -1,12 +0,0 @@
1−### `++gay`
2−
3−Optional gap
4−
5−Optional gap.
6−
7−Source
8−------
9−
10− ++ gay ;~(pose gap (easy ~)) ::
11−
12−
docs/system/hoon/library/gate/glam.mddeleted−84
@@ -1,84 +0,0 @@
1−### `++glam`
2−
3−Galaxy names
4−
5−Retrieves the 'name' of a given Galaxy.
6−
7−Accepts
8−-------
9−
10−`zar` is a `@p` of one byte, the length of a Galaxy name.
11−
12−Source
13−------
14−
15− ++ glam
16− |= zar=@pD ^- tape
17− %+ snag zar
18− ^- (list tape)
19− :~ "Tianming" "Pepin the Short" "Haile Selassie" "Alfred the Great"
20− "Tamerlane" "Pericles" "Talleyrand" "Yongle" "Seleucus"
21− "Uther Pendragon" "Louis XVI" "Ahmad Shāh Durrānī" "Constantine"
22− "Wilhelm I" "Akbar" "Louis XIV" "Nobunaga" "Alexander VI"
23− "Philippe II" "Julius II" "David" "Niall Noígíallach" "Kublai Khan"
24− "Öz Beg Khan" "Ozymandias" "Ögedei Khan" "Jiang Jieshi" "Darius"
25− "Shivaji" "Qianlong" "Bolesław I Chrobry" "Tigranes" "Han Wudi"
26− "Charles X" "Naresuan" "Frederick II" "Simeon" "Kangxi"
27− "Suleiman the Magnificent" "Pedro II" "Genghis Khan" "Laozi"
28− "Porfirio Díaz" "Pakal" "Wu Zetian" "Garibaldi" "Matthias Corvinus"
29− "Leopold II" "Leonidas" "Sitting Bull" "Nebuchadnezzar II"
30− "Rhodes" "Henry VIII" "Attila" "Catherine II" "Chulalongkorn"
31− "Uthmān" "Augustus" "Faustin" "Chongde" "Justinian"
32− "Afonso de Albuquerque" "Antoninus Pius" "Cromwell" "Innocent X"
33− "Fidel" "Frederick the Great" "Canute" "Vytautas" "Amina"
34− "Hammurabi" "Suharto" "Victoria" "Hiawatha" "Paul V" "Shaka"
35− "Lê Thánh Tông" "Ivan Asen II" "Tiridates" "Nefertiti" "Gwangmu"
36− "Ferdinand & Isabella" "Askia" "Xuande" "Boris Godunov" "Gilgamesh"
37− "Maximillian I" "Mao" "Charlemagne" "Narai" "Hanno" "Charles I & V"
38− "Alexander II" "Mansa Musa" "Zoe Porphyrogenita" "Metternich"
39− "Robert the Bruce" "Pachacutec" "Jefferson" "Solomon" "Nicholas I"
40− "Barbarossa" "FDR" "Pius X" "Gwanggaeto" "Abbas I" "Julius Caesar"
41− "Lee Kuan Yew" "Ranavalona I" "Go-Daigo" "Zenobia" "Henry V"
42− "Bảo Đại" "Casimir III" "Cyrus" "Charles the Wise" "Sandrokottos"
43− "Agamemnon" "Clement VII" "Suppiluliuma" "Deng Xiaoping"
44− "Victor Emmanuel" "Ajatasatru" "Jan Sobieski" "Huangdi" "Xuantong"
45− "Narmer" "Cosimo de' Medici" "Möngke Khan" "Stephen Dušan" "Henri IV"
46− "Mehmed Fatih" "Conn Cétchathach" "Francisco Franco" "Leo X"
47− "Kammu" "Krishnadevaraya" "Elizabeth I" "Norton I" "Washington"
48− "Meiji" "Umar" "TR" "Peter the Great" "Agustin I" "Ashoka"
49− "William the Conqueror" "Kongolo Mwamba" "Song Taizu"
50− "Ivan the Terrible" "Yao" "Vercingetorix" "Geronimo" "Rurik"
51− "Urban VIII" "Alexios Komnenos" "Maria I" "Tamar" "Bismarck"
52− "Arthur" "Jimmu" "Gustavus Adolphus" "Suiko" "Basil I" "Montezuma"
53− "Santa Anna" "Xerxes" "Beyazıt Yıldırım" "Samudragupta" "James I"
54− "George III" "Kamehameha" "Francesco Sforza" "Trajan"
55− "Rajendra Chola" "Hideyoshi" "Cleopatra" "Alexander"
56− "Ashurbanipal" "Paul III" "Vespasian" "Tecumseh" "Narasimhavarman"
57− "Suryavarman II" "Bokassa I" "Charles Canning" "Theodosius"
58− "Francis II" "Zhou Wen" "William Jardine" "Ahmad al-Mansur"
59− "Lajos Nagy" "Theodora" "Mussolini" "Samuil" "Osman Gazi"
60− "Kim Il-sung" "Maria Theresa" "Lenin" "Tokugawa" "Marcus Aurelius"
61− "Nzinga Mbande" "Edward III" "Joseph II" "Pulakesi II" "Priam"
62− "Qin Shi Huang" "Shah Jahan" "Sejong" "Sui Wendi" "Otto I"
63− "Napoleon III" "Prester John" "Dido" "Joao I" "Gregory I"
64− "Gajah Mada" "Abd-ar Rahmān III" "Taizong" "Franz Josef I"
65− "Nicholas II" "Gandhi" "Chandragupta II" "Peter III"
66− "Oba Ewuare" "Louis IX" "Napoleon" "Selim Yavuz" "Shun"
67− "Hayam Wuruk" "Jagiełło" "Nicaule" "Sargon" "Saladin" "Charles II"
68− "Brian Boru" "Da Yu" "Antiochus III" "Charles I"
69− "Jan Pieterszoon Coen" "Hongwu" "Mithridates" "Hadrian" "Ptolemy"
70− "Benito Juarez" "Sun Yat-sen" "Raja Raja Chola" "Bolivar" "Pius VII"
71− "Shapur II" "Taksin" "Ram Khamhaeng" "Hatshepsut" "Alī" "Matilda"
72− "Ataturk"
73− ==
74− ::
75−
76−Examples
77−--------
78−
79− ~zod/main=> (glam ~zod)
80− "Tianming"
81− ~zod/main=> (glam ~fyr)
82− "Bolivar"
83−
84−
docs/system/hoon/library/gate/glon.mddeleted−216
@@ -1,216 +0,0 @@
1−### `++glon`
2−
3−ISO language code
4−
5−XX
6−
7−Accepts
8−-------
9−
10−`lag` is a [`++lang`]().
11−
12−Source
13−------
14−
15− ++ glon
16− |= lag=lang
17− ^- (unit tape)
18− ?+ lag ~
19− %aa [~ "Afar"]
20− %ab [~ "Abkhazian"]
21− %ae [~ "Avestan"]
22− %af [~ "Afrikaans"]
23− %ak [~ "Akan"]
24− %am [~ "Amharic"]
25− %an [~ "Aragonese"]
26− %ar [~ "Arabic"]
27− %as [~ "Assamese"]
28− %av [~ "Avaric"]
29− %ay [~ "Aymara"]
30− %az [~ "Azerbaijani"]
31− %ba [~ "Bashkir"]
32− %be [~ "Belarusian"]
33− %bg [~ "Bulgarian"]
34− %bh [~ "Bihari"]
35− %bi [~ "Bislama"]
36− %bm [~ "Bambara"]
37− %bn [~ "Bengali"]
38− %bo [~ "Tibetan"]
39− %br [~ "Breton"]
40− %bs [~ "Bosnian"]
41− %ca [~ "Catalan"]
42− %ce [~ "Chechen"]
43− %ch [~ "Chamorro"]
44− %co [~ "Corsican"]
45− %cr [~ "Cree"]
46− %cs [~ "Czech"]
47− %cu [~ "Slavonic"]
48− %cv [~ "Chuvash"]
49− %cy [~ "Welsh"]
50− %da [~ "Danish"]
51− %de [~ "German"]
52− %dv [~ "Maldivian"]
53− %dz [~ "Dzongkha"]
54− %ee [~ "Ewe"]
55− %el [~ "Greek"]
56− %en [~ "English"]
57− %eo [~ "Esperanto"]
58− %es [~ "Spanish"]
59− %et [~ "Estonian"]
60− %eu [~ "Basque"]
61− %fa [~ "Persian"]
62− %ff [~ "Fulah"]
63− %fi [~ "Finnish"]
64− %fj [~ "Fijian"]
65− %fo [~ "Faroese"]
66− %fr [~ "French"]
67− %fy [~ "Frisian"]
68− %ga [~ "Irish Gaelic"]
69− %gd [~ "Scottish Gaelic"]
70− %gl [~ "Galician"]
71− %gn [~ "Guarani"]
72− %gu [~ "Gujarati"]
73− %gv [~ "Manx"]
74− %ha [~ "Hausa"]
75− %he [~ "Hebrew"]
76− %hi [~ "Hindi"]
77− %ho [~ "Hiri Motu"]
78− %hr [~ "Croatian"]
79− %ht [~ "Haitian Creole"]
80− %hu [~ "Hungarian"]
81− %hy [~ "Armenian"]
82− %hz [~ "Herero"]
83− %ia [~ "Interlingua"]
84− %id [~ "Indonesian"]
85− %ie [~ "Occidental"]
86− %ig [~ "Igbo"]
87− %ii [~ "Nuosu"]
88− %ik [~ "Inupiaq"]
89− %io [~ "Ido"]
90− %is [~ "Icelandic"]
91− %it [~ "Italian"]
92− %iu [~ "Inuktitut"]
93− %ja [~ "Japanese"]
94− %jv [~ "Javanese"]
95− %ka [~ "Georgian"]
96− %kg [~ "Kongo"]
97− %ki [~ "Kikuyu"]
98− %kj [~ "Kwanyama"]
99− %kk [~ "Kazakh"]
100− %kl [~ "Kalaallisut"]
101− %km [~ "Central Khmer"]
102− %kn [~ "Kannada"]
103− %ko [~ "Korean"]
104− %kr [~ "Kanuri"]
105− %ks [~ "Kashmiri"]
106− %ku [~ "Kurdish"]
107− %kv [~ "Komi"]
108− %kw [~ "Cornish"]
109− %ky [~ "Kyrgyz"]
110− %la [~ "Latin"]
111− %lb [~ "Luxembourgish"]
112− %lg [~ "Ganda"]
113− %li [~ "Limburgish"]
114− %ln [~ "Lingala"]
115− %lo [~ "Lao"]
116− %lt [~ "Lithuanian"]
117− %lu [~ "Luba-Katanga"]
118− %lv [~ "Latvian"]
119− %mg [~ "Malagasy"]
120− %mh [~ "Marshallese"]
121− %mi [~ "Maori"]
122− %mk [~ "Macedonian"]
123− %ml [~ "Malayalam"]
124− %mn [~ "Mongolian"]
125− %mr [~ "Marathi"]
126− %ms [~ "Malay"]
127− %mt [~ "Maltese"]
128− %my [~ "Burmese"]
129− %na [~ "Nauru"]
130− %nb [~ "Norwegian Bokmål"]
131− %nd [~ "North Ndebele"]
132− %ne [~ "Nepali"]
133− %ng [~ "Ndonga"]
134− %nl [~ "Dutch"]
135− %nn [~ "Norwegian Nynorsk"]
136− %no [~ "Norwegian"]
137− %nr [~ "South Ndebele"]
138− %nv [~ "Navajo"]
139− %ny [~ "Chichewa"]
140− %oc [~ "Occitan"]
141− %oj [~ "Ojibwa"]
142− %om [~ "Oromo"]
143− %or [~ "Oriya"]
144− %os [~ "Ossetian"]
145− %pa [~ "Punjabi"]
146− %pi [~ "Pali"]
147− %pl [~ "Polish"]
148− %ps [~ "Pashto"]
149− %pt [~ "Portuguese"]
150− %qu [~ "Quechua"]
151− %rm [~ "Romansh"]
152− %rn [~ "Rundi"]
153− %ro [~ "Romanian"]
154− %ru [~ "Russian"]
155− %rw [~ "Kinyarwanda"]
156− %sa [~ "Sanskrit"]
157− %sc [~ "Sardinian"]
158− %sd [~ "Sindhi"]
159− %se [~ "Northern Sami"]
160− %sg [~ "Sango"]
161− %si [~ "Sinhala"]
162− %sk [~ "Slovak"]
163− %sl [~ "Slovenian"]
164− %sm [~ "Samoan"]
165− %sn [~ "Shona"]
166− %so [~ "Somali"]
167− %sq [~ "Albanian"]
168− %sr [~ "Serbian"]
169− %ss [~ "Swati"]
170− %st [~ "Sotho"]
171− %su [~ "Sundanese"]
172− %sv [~ "Swedish"]
173− %sw [~ "Swahili"]
174− %ta [~ "Tamil"]
175− %te [~ "Telugu"]
176− %tg [~ "Tajik"]
177− %th [~ "Thai"]
178− %ti [~ "Tigrinya"]
179− %tk [~ "Turkmen"]
180− %tl [~ "Tagalog"]
181− %tn [~ "Tswana"]
182− %to [~ "Tonga"]
183− %tr [~ "Turkish"]
184− %ts [~ "Tsonga"]
185− %tt [~ "Tatar"]
186− %tw [~ "Twi"]
187− %ty [~ "Tahitian"]
188− %ug [~ "Uighur"]
189− %uk [~ "Ukrainian"]
190− %ur [~ "Urdu"]
191− %uz [~ "Uzbek"]
192− %ve [~ "Venda"]
193− %vi [~ "Vietnamese"]
194− %vo [~ "Volapük"]
195− %wa [~ "Walloon"]
196− %wo [~ "Wolof"]
197− %xh [~ "Xhosa"]
198− %yi [~ "Yiddish"]
199− %yo [~ "Yoruba"]
200− %za [~ "Zhuang"]
201− %zh [~ "Chinese"]
202− %zu [~ "Zulu"]
203− ==
204− ::
205−
206−Examples
207−--------
208−
209− ~zod/main=> (glon %cs)
210− [~ "Czech"]
211− ~zod/main=> (glon %en)
212− [~ "English"]
213− ~zod/main=> (glon %mz)
214− ~
215−
216−
docs/system/hoon/library/gate/glue.mddeleted−46
@@ -1,46 +0,0 @@
1−### `++glue`
2−
3−Skip delimiter
4−
5−Parsing composer: connects an [`++edge`]() `vex` with a following [`++rule`]() `sab` by
6−parsing the `++rule` `bus` (the delimiting symbol) and throwing out the
7−result.
8−
9−Accepts
10−-------
11−
12−`bus` is a `++rule`.
13−
14−`sab` is a `++rule`.
15−
16−`vex` is an `++edge`.
17−
18−Produces
19−--------
20−
21−
22−
23−Source
24−------
25−
26− ++ glue :: add rule
27− ~/ %glue
28− |* bus=_rule
29− ~/ %fun
30− |* [vex=edge sab=_rule]
31− (plug vex ;~(pfix bus sab))
32− ::
33−
34−Examples
35−--------
36−
37− ~zod/try=> (scan "200|mal|bon" ;~((glue bar) dem sym sym))
38− [q=200 7.102.829 7.237.474]
39− ~zod/try=> `[@u @tas @tas]`(scan "200|mal|bon" ;~((glue bar) dem sym sym))
40− [200 %mal %bon]
41− ~zod/try=> (scan "200|;|bon" ;~((glue bar) dem sem sym))
42− [q=200 ~~~3b. 7.237.474]
43− ~zod/try=> (scan "200.;.bon" ;~((glue dot) dem sem sym))
44− [q=200 ~~~3b. 7.237.474]
45−
46−
docs/system/hoon/library/gate/gnom.mddeleted−38
@@ -1,38 +0,0 @@
1−### `++gnom`
2−
3−Display ship name
4−
5−Fetches a ship's display name from %ames.
6−
7−Accepts
8−-------
9−
10−`our` is a [`@p`]().
11−
12−`now` is a [`@da`]().
13−
14−`him` is a [`@p`]().
15−
16−Source
17−------
18−
19− ++ gnom :: ship display name
20− |= [[our=@p now=@da] him=@p] ^- @t
21− =+ yow=(scot %p him)
22− =+ pax=[(scot %p our) %name (scot %da now) yow ~]
23− =+ woy=((hard ,@t) .^(%a pax))
24− ?: =(%$ woy) yow
25− (rap 3 yow ' ' woy ~)
26− ::
27−
28−Examples
29−--------
30−
31− ~zod/main=> (gnom [->-< -<-] ~zod)
32− '~zod |Tianming|'
33− ~zod/main=> (gnom [->-< -<-] ~doznec)
34− '~doznec ~doznec'
35− ~zod/main=> (gnom [->-< -<-] ~tug)
36− '~tug |Go-Daigo|'
37−
38−
docs/system/hoon/library/gate/gon.mddeleted−21
@@ -1,21 +0,0 @@
1−### `++gon`
2−
3−Long numbers
4−
5−Parse long numbers - Numbers which wrap around the shell with the line
6−
7−Source
8−------
9−
10−break ++ gon ;~(pose ;~(plug bas gay fas) (easy ~)) :: long numbers \ /
11−
12−Examples
13−--------
14−characters bas and fas.
15−
16− ~zod/try=> (scan "\\/" gon)
17− [~~~5c. ~ ~~~2f.]
18− ~zod/try=> (gon [[1 1] "\\/"])
19− [p=[p=1 q=3] q=[~ u=[p=[~~~5c. ~ ~~~2f.] q=[p=[p=1 q=3] q=""]]]]
20−
21−
docs/system/hoon/library/gate/gor.mddeleted−56
@@ -1,56 +0,0 @@
1−### `++gor`
2−
3−Hash order
4−
5−XX revisit
6−
7−Accepts
8−-------
9−
10−`a` is a [noun]().
11−
12−`b` is a noun.
13−
14−Produces
15−--------
16−
17−A boolean [atom]().
18−
19−Source
20−------
21−
22− ++ gor :: g-order
23− ~/ %gor
24− |= [a=* b=*]
25− ^- ?
26− =+ [c=(mug a) d=(mug b)]
27− ?: =(c d)
28− (dor a b)
29− (lth c d)
30−
31−Examples
32−--------
33−
34− ~zod/try=> (gor 'd' 'c')
35− %.y
36− ~zod/try=> 'd'
37− 'd'
38− ~zod/try=> 'c'
39− ~zod/try=> `@ud`'d'
40− 100
41− ~zod/try=> `@ud`'c'
42− 99
43− ~zod/try=> (mug 'd')
44− 1.628.185.714
45− ~zod/try=> (mug 'c')
46− 1.712.073.811
47− ~zod/try=> (gor 'd' 'c')
48− %.y
49− ~zod/try=> (gor 'c' 'd')
50− %.n
51− ~zod/try=> (gor "foo" "bar")
52− %.n
53− ~zod/try=> (gor (some 10) (limo [1 2 3 ~]))
54− %.n
55−
56−
docs/system/hoon/library/gate/gte.mddeleted−39
@@ -1,39 +0,0 @@
1−### `++gte`
2−
3−Greater-than/equal
4−
5−Tests whether `a` is greater than a number `b`.
6−
7−Accepts
8−-------
9−
10−`a` is an [atom]().
11−
12−`b` is an atom.
13−
14−Produces
15−--------
16−
17−A boolean.
18−
19−Source
20−------
21−
22− ++ gte :: greater-equal
23− ~/ %gte
24− |= [a=@ b=@]
25− ^- ?
26− !(lth a b)
27− ::
28−
29−Examples
30−--------
31−
32− ~zod/try=> (gte 100 10)
33− %.y
34− ~zod/try=> (gte 4 4)
35− %.y
36− ~zod/try=> (gte 3 4)
37− %.n
38−
39−
docs/system/hoon/library/gate/gth.mddeleted−37
@@ -1,37 +0,0 @@
1−### `++gth`
2−
3−Greater-than
4−
5−Tests whether `a` is greater than `b`.
6−
7−Accepts
8−-------
9−
10−`a` is an [atom]().
11−
12−`b` is an atom.
13−
14−Produces
15−--------
16−
17−A boolean.
18−
19−Source
20−------
21−
22− ++ gth :: greater-than
23− ~/ %gth
24− |= [a=@ b=@]
25− ^- ?
26− !(lte a b)
27− ::
28−
29−Examples
30−--------
31−
32− ~zod/try=> (gth 'd' 'c')
33− %.y
34− ~zod/try=> (gth ~h1 ~m61)
35− %.n
36−
37−
docs/system/hoon/library/gate/gul.mddeleted−20
@@ -1,20 +0,0 @@
1−### `++gul`
2−
3−Axis syntax `<` or `>`
4−
5−Parse the axis gal and gar axis syntax.
6−
7−Source
8−------
9−
10− ++ gul ;~(pose (cold 2 gal) (cold 3 gar)) :: axis syntax < >
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "<" gul)
16− 2
17− ~zod/try=> (scan ">" gul)
18− 3
19−
20−
docs/system/hoon/library/gate/hard.mddeleted−29
@@ -1,29 +0,0 @@
1−### `++hard`
2−
3−Demands that a specific type be produced, crashing the program is it is
4−not.
5−
6−Source
7−------
8−
9− ++ hard
10− |* han=$+(* *)
11− |= fud=* ^- han
12− ~| %hard
13− =+ gol=(han fud)
14− ?>(=(gol fud) gol)
15−
16−Examples
17−--------
18−
19− ~zod/try=> ((hard (list)) (limo [1 2 3 ~]))
20− ~[1 2 3]
21− ~zod/try=> ((hard ,@) (add 2 2))
22− 4
23− ~zod/try=> ((hard ,@t) (crip "Tape to cord, bro!"))
24− 'Tape to cord, bro'
25− ~zod/try=> ((hard tape) (crip "...Tape to cord, bro?..."))
26− ! hard
27− ! exit
28−
29−
docs/system/hoon/library/gate/hax.mddeleted−24
@@ -1,24 +0,0 @@
1−### `++hax`
2−
3−Parse number sign
4−
5−Parses ASCII character 35, the number sign.
6−
7−Source
8−------
9−
10− ++ hax (just '#')
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "#" hax)
16− ~~~23.
17− ~zod/try=> `cord`(scan "#" hax)
18− '#'
19− ~zod/try=> (hax [[1 1] "#"])
20− [p=[p=1 q=2] q=[~ [p=~~~23. q=[p=[p=1 q=2] q=""]]]]
21− ~zod/try=> (hax [[1 1] "#!"])
22− [p=[p=1 q=2] q=[~ [p=~~~23. q=[p=[p=1 q=2] q="!"]]]]
23−
24−
docs/system/hoon/library/gate/hep.mddeleted−24
@@ -1,24 +0,0 @@
1−### `++hep`
2−
3−Parse hyphen
4−
5−Parses ASCII character 45, the hyphen.
6−
7−Source
8−------
9−
10− ++ hep (just '-')
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "-" hep)
16− ~~-
17− ~zod/try=> `cord`(scan "-" hep)
18− '-'
19− ~zod/try=> (hep [[1 1] "-"])
20− [p=[p=1 q=2] q=[~ [p=~~- q=[p=[p=1 q=2] q=""]]]]
21− ~zod/try=> (hep [[1 1] ":-"])
22− [p=[p=1 q=1] q=~]
23−
24−
docs/system/hoon/library/gate/here.mddeleted−45
@@ -1,45 +0,0 @@
1−### `++here`
2−
3−Place-based apply
4−
5−Parser modifier. Similar to [`++cook`]() in that it produces a parser that takes a
6−(successful) result of `sef` and slams it through `hez`. `hez` accepts a
7−[`++pint`]() `a` and a [noun]() `b`, which is what the parser parsed.
8−
9−Accepts
10−-------
11−
12−`hez` is a [gate]().
13−
14−`sef` is a [`++rule`]()
15−
16−Produces
17−--------
18−
19−A `++rule`.
20−
21−Source
22−------
23−
24− ++ here :: place-based apply
25− ~/ %here
26− |* [hez=_|=([a=pint b=*] [a b]) sef=_rule]
27− ~/ %fun
28− |= tub=nail
29− =+ vex=(sef tub)
30− ?~ q.vex
31− vex
32− [p=p.vex q=[~ u=[p=(hez [p.tub p.q.u.q.vex] p.u.q.vex) q=q.u.q.vex]]]
33− ::
34−
35−Examples
36−--------
37−
38− ~zod/try=> (scan "abc" (star alf))
39− "abc"
40− ~zod/try=> (scan "abc" (here |*(^ +<) (star alf)))
41− [[[p=1 q=1] p=1 q=4] "abc"]
42− ~zod/try=> (scan "abc" (star (here |*(^ +<) alf)))
43− ~[[[[p=1 q=1] p=1 q=2] ~~a] [[[p=1 q=2] p=1 q=3] ~~b] [[[p=1 q=3] p=1 q=4] ~~c]]
44−
45−
docs/system/hoon/library/gate/hex.mddeleted−29
@@ -1,29 +0,0 @@
1−### `++hex`
2−
3−Hex to atom
4−
5−Parse any hexadecimal number to an atom.
6−
7−Source
8−------
9−
10− ++ hex (bass 16 (most gon hit)) :: hex to atom
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "a" hex)
16− 10
17− ~zod/try=> (scan "A" hex)
18− 10
19− ~zod/try=> (scan "2A" hex)
20− 42
21− ~zod/try=> (scan "1ee7" hex)
22− 7.911
23− ~zod/try=> (scan "1EE7" hex)
24− 7.911
25− ~zod/try=> (scan "1EE7F7" hex)
26− 2.025.463
27− ~zod/try=> `@ux`(scan "1EE7F7" hex)
28− 0x1e.e7f7
29−
docs/system/hoon/library/gate/hig.mddeleted−24
@@ -1,24 +0,0 @@
1−### `++hig`
2−
3−Uppercase
4−
5−Parse a single uppercase letter.
6−
7−Source
8−------
9−
10− ++ hig (shim 'A' 'Z') :: uppercase
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "G" hig)
16− ~~~47.
17− ~zod/try=> `cord`(scan "G" hig)
18− 'G'
19− ~zod/try=> (scan "ABCDEFGHIJKLMNOPQRSTUVWXYZ" (star hig))
20− "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
21− ~zod/try=> (hig [[1 1] "G"])
22− [p=[p=1 q=2] q=[~ [p=~~~47. q=[p=[p=1 q=2] q=""]]]]
23−
24−
docs/system/hoon/library/gate/hit.mddeleted−27
@@ -1,27 +0,0 @@
1−### `++hit`
2−
3−Hex digits
4−
5−Parse a single hexadecimal digit.
6−
7−Source
8−------
9−
10− ++ hit ;~ pose :: hex digits
11− dit
12− (cook |=(a=char (sub a 87)) (shim 'a' 'f'))
13− (cook |=(a=char (sub a 55)) (shim 'A' 'F'))
14− ==
15−
16−Examples
17−--------
18−
19− ~zod/try=> (scan "a" hit)
20− 10
21− ~zod/try=> (scan "A" hit)
22− 10
23− ~zod/try=> (hit [[1 1] "a"])
24− [p=[p=1 q=2] q=[~ [p=10 q=[p=[p=1 q=2] q=""]]]]
25− ~zod/try=> (scan "2A" (star hit))
26− ~[2 10]
27−
docs/system/hoon/library/gate/homo.mddeleted−41
@@ -1,41 +0,0 @@
1−### `++homo`
2−
3−Homogenize
4−
5−Produces a [`++list`]() whose type is a fork of all the contained types in the
6−list `a`. Used when you want to make all the types of the elements of a list the same.
7−
8−Accepts
9−-------
10−
11−`a` is a list.
12−
13−Produces
14−--------
15−
16−a list.
17−
18−Source
19−------
20−
21− ++ homo :: homogenize
22− |* a=(list)
23− ^+ =< $
24− |% +- $ ?:(_? ~ [i=(snag 0 a) t=$])
25− --
26− a
27−
28−Examples
29−--------
30−
31− ~zod/try=> lyst
32− [i=1 t=[i=97 t=[i=2 t=[i=98 t=[i=[~ u=10] t=~]]]]]
33− ~zod/try=> (homo lyst)
34− ~[1 97 2 98 [~ u=10]]
35− ~zod/try=> =a (limo [1 2 3 ~])
36− ~zod/try=> a
37− [i=1 t=[i=2 t=[i=3 t=~]]]
38− ~zod/try=> (homo a)
39− ~[1 2 3]
40−
41−
docs/system/hoon/library/gate/hor.mddeleted−49
@@ -1,49 +0,0 @@
1−### `++hor`
2−
3−Hash order
4−
5−XX revisit
6−
7−Recursive hash comparator gate.
8−
9−Accepts
10−-------
11−
12−`a` is a [noun]().
13−
14−`b` is a noun.
15−
16−Produces
17−--------
18−
19−A boolean [atom]().
20−
21−
22−Source
23−------
24−
25− ++ hor :: h-order
26− ~/ %hor
27− |= [a=* b=*]
28− ^- ?
29− ?: ?=(@ a)
30− ?. ?=(@ b) &
31− (gor a b)
32− ?: ?=(@ b) |
33− ?: =(-.a -.b)
34− (gor +.a +.b)
35− (gor -.a -.b)
36−
37−Examples
38−--------
39−
40− ~zod/try=> (hor . 1)
41− %.n
42− ~zod/try=> (hor 1 2)
43− %.y
44− ~zod/try=> (hor "abc" "cba")
45− %.y
46− ~zod/try=> (hor 'c' 'd')
47− %.n
48−
49−
docs/system/hoon/library/gate/ifix.mddeleted−35
@@ -1,35 +0,0 @@
1−### `++ifix`
2−
3−Infix
4−
5−Parser modifier: surround with pair of [`++rule`]()s, the output of which is
6−discarded.
7−
8−Accepts
9−-------
10−
11−`fel` is a pair of `++rule`s.
12−
13−`hof` is a `++rule`.
14−
15−Produces
16−--------
17−
18−A `++rule`.
19−
20−Source
21−------
22−
23− ++ ifix
24− |* [fel=[p=_rule q=_rule] hof=_rule]
25− ;~(pfix p.fel ;~(sfix hof q.fel))
26−
27−Examples
28−--------
29−
30− ~zod/try=> (scan "-40-" (ifix [hep hep] dem))
31− q=40
32− ~zod/try=> (scan "4my4" (ifix [dit dit] (star alf)))
33− "my"
34−
35−
docs/system/hoon/library/gate/iny.mddeleted−58
@@ -1,58 +0,0 @@
1−### `++iny`
2−
3−Indentation block
4−
5−Apply [`++rule`]() to indented block starting at current column number, omitting
6−the leading whitespace.
7−
8−Accepts
9−-------
10−
11−`sef` is a [`++rule`]()
12−
13−Produces
14−--------
15−
16−A `++rule`.
17−
18−Source
19−------
20−
21− ++ iny |* sef=_rule :: indentation block
22− |= nail ^+ (sef)
23− =+ [har tap]=[p q]:+<
24− =+ lev=(fil 3 (dec q.har) ' ')
25− =+ eol=(just `@t`10)
26− =+ =- roq=((star ;~(pose prn ;~(sfix eol (jest lev)) -)) har tap)
27− ;~(simu ;~(plug eol eol) eol)
28− ?~ q.roq roq
29− =+ vex=(sef har(q 1) p.u.q.roq)
30− =+ fur=p.vex(q (add (dec q.har) q.p.vex))
31− ?~ q.vex vex(p fur)
32− =- vex(p fur, u.q -)
33− :+ &3.vex
34− &4.vex(q.p (add (dec q.har) q.p.&4.vex))
35− =+ res=|4.vex
36− |- ?~ res |4.roq
37− ?. =(10 -.res) [-.res $(res +.res)]
38− (welp [`@t`10 (trip lev)] $(res +.res))
39− ::
40−
41−Examples
42−--------
43−
44− ~zod/try=> (scan "abc" (iny (star ;~(pose prn (just `@`10)))))
45− "abc"
46− ~zod/try=> (scan "abc" (star ;~(pose prn (just `@`10))))
47− "abc"
48− ~zod/try=> (scan " abc\0ade" ;~(pfix ace ace (star ;~(pose prn (just `@`10)))))
49− "abc
50− de"
51− ~zod/try=> (scan " abc\0ade" ;~(pfix ace ace (iny (star ;~(pose prn (just `@`10))))))
52− ! {1 6}
53− ! exit
54− ~zod/try=> (scan " abc\0a de" ;~(pfix ace ace (iny (star ;~(pose prn (just `@`10))))))
55− "abc
56− de"
57−
58−
docs/system/hoon/library/gate/jam.mddeleted−58
@@ -1,58 +0,0 @@
1−### `++jam`
2−
3−Unpack noun to atom
4−
5−Produces an atom unpacked from noun `a`. The inverse of cue.
6−
7−Accepts
8−-------
9−
10−`a` is a [noun]().
11−
12−Produces
13−--------
14−
15−An atom.
16−
17−Source
18−------
19−
20− ++ jam :: pack
21− ~/ %jam
22− |= a=*
23− ^- @
24− =+ b=0
25− =+ m=`(map ,* ,@)`~
26− =< q
27− |- ^- [p=@ q=@ r=_m]
28− =+ c=(~(get by m) a)
29− ?~ c
30− => .(m (~(put by m) a b))
31− ?: ?=(@ a)
32− =+ d=(mat a)
33− [(add 1 p.d) (lsh 0 1 q.d) m]
34− => .(b (add 2 b))
35− =+ d=$(a -.a)
36− =+ e=$(a +.a, b (add b p.d), m r.d)
37− [(add 2 (add p.d p.e)) (mix 1 (lsh 0 2 (cat 0 q.d q.e))) r.e]
38− ?: ?&(?=(@ a) (lte (met 0 a) (met 0 u.c)))
39− =+ d=(mat a)
40− [(add 1 p.d) (lsh 0 1 q.d) m]
41− =+ d=(mat u.c)
42− [(add 2 p.d) (mix 3 (lsh 0 2 q.d)) m]
43− ::
44−
45−
46−Examples
47−--------
48−
49− ~zod/try=> (jam 1)
50− 12
51− ~zod/try=> (jam [1 1])
52− 817
53− ~zod/try=> (jam [1 2])
54− 4.657
55− ~zod/try=> (jam [~ u=19])
56− 39.689
57−
58−
docs/system/hoon/library/gate/jape.mddeleted−38
@@ -1,38 +0,0 @@
1−### `++jape`
2−
3−`++json` string from tape
4−
5−Produces a [`++json`]() string from a [`++tape`]().
6−
7−Accepts
8−-------
9−
10−A [`++tape`]().
11−
12−Produces
13−--------
14−
15−A `++json`.
16−
17−Source
18−------
19−
20− ++ jape :: string from tape
21− |= a=tape
22− ^- json
23− [%s (crip a)]
24− ::
25−
26−Examples
27−--------
28−
29− ~zod/try=> (jape ~)
30− [%s p=~.]
31− ~zod/try=> (jape "lam")
32− [%s p=~.lam]
33− ~zod/try=> (crip (pojo (jape "lam")))
34− '"lam"'
35− ~zod/try=> (crip (pojo (jape "semtek som? zeplo!")))
36− '"semtek som? zeplo!"'
37−
38−
docs/system/hoon/library/gate/jesc.mddeleted−41
@@ -1,41 +0,0 @@
1−### `++jesc`
2−
3−Escape JSON character
4−
5−Produces a [`++tape`]() of an escaped [`++json`](/doc/hoon/library/3bi#++json) character `a`.
6−
7−Accepts
8−-------
9−
10−`a` is an atom of odor [`@tD`](), aka a [`++char`]().
11−
12−Produces
13−--------
14−
15−A [`++tape`]().
16−
17−Source
18−------
19−
20− ++ jesc
21− |= a=@ ^- tape
22− ?+ a [a ~]
23− 10 "\\n"
24− 34 "\\\""
25− 92 "\\\\"
26− ==
27− ::
28−
29−Examples
30−--------
31−
32− ~zod/try=> (jesc 'a')
33− "a"
34− ~zod/try=> (jesc 'c')
35− "c"
36− ~zod/try=> (jesc '\\')
37− "\\"
38− ~zod/try=> (jesc '"')
39− "\""
40−
41−
docs/system/hoon/library/gate/jest.mddeleted−48
@@ -1,48 +0,0 @@
1−### `++jest`
2−
3−Match a cord
4−
5−Match and consume a cord.
6−
7−Accepts
8−-------
9−
10−`daf` is a [`@t`]().
11−
12−Produces
13−--------
14−
15−An [`++edge`]().
16−
17−Source
18−------
19−
20− ++ jest :: match a cord
21− |= daf=@t
22− |= tub=nail
23− =+ fad=daf
24− |- ^- (like ,@t)
25− ?: =(0 daf)
26− [p=p.tub q=[~ u=[p=fad q=tub]]]
27− ?: |(?=(~ q.tub) !=((end 3 1 daf) i.q.tub))
28− (fail tub)
29− $(p.tub (lust i.q.tub p.tub), q.tub t.q.tub, daf (rsh 3 1 daf))
30− ::
31−
32−Examples
33−--------
34−
35− ~zod/try=> ((jest 'abc') [[1 1] "abc"])
36− [p=[p=1 q=4] q=[~ [p='abc' q=[p=[p=1 q=4] q=""]]]]
37− ~zod/try=> (scan "abc" (jest 'abc'))
38− 'abc'
39− ~zod/try=> (scan "abc" (jest 'acb'))
40− ! {1 2}
41− ! 'syntax-error'
42− ! exit
43− ~zod/try=> ((jest 'john doe') [[1 1] "john smith"])
44− [p=[p=1 q=6] q=~]
45− ~zod/try=> ((jest 'john doe') [[1 1] "john doe"])
46− [p=[p=1 q=9] q=[~ [p='john doe' q=[p=[p=1 q=9] q=""]]]]
47−
48−
docs/system/hoon/library/gate/joba.mddeleted−40
@@ -1,40 +0,0 @@
1−### `++joba`
2−
3−`++json` from key-value pair
4−
5−Produces a ++json object with one key-value pair.
6−
7−Accepts
8−-------
9−
10−`p` is a `@t` key.
11−
12−`q` is a [`++json`]().
13−
14−Produces
15−--------
16−
17−A [`++json`]().
18−
19−Source
20−------
21−
22− ++ joba :: object from k-v pair
23− |= [p=@t q=json]
24− ^- json
25− [%o [[p q] ~ ~]]
26− ::
27−
28−Examples
29−--------
30−
31− ~zod/try=> (joba %hi %b |)
32− [%o p={[p='hi' q=[%b p=%.n]]}]
33− ~zod/try=> (crip (pojo (joba %hi %b |)))
34− '{"hi":false}'
35− ~zod/try=> (joba %hi (jone 2.130))
36− [%o p={[p='hi' q=[%n p=~.2130]]}]
37− ~zod/try=> (crip (pojo (joba %hi (jone 2.130))))
38− '{"hi":2130}'
39−
40−
docs/system/hoon/library/gate/jobe.mddeleted−34
@@ -1,34 +0,0 @@
1−### `++jobe`
2−
3−Object from key-value list
4−
5−Produces a `++json` object from a [`++list`]() `a` of key to `++json` values.
6−
7−Accepts
8−-------
9−
10−`a` is a [`++list`]() of [`++cord`]() to [`++json`]() values.
11−
12−Produces
13−--------
14−
15−A `++json`.
16−
17−Source
18−------
19−
20− ++ jobe :: object from k-v list
21− |= a=(list ,[p=@t q=json])
22− ^- json
23− [%o (~(gas by *(map ,@t json)) a)]
24− ::
25−
26−Examples
27−--------
28−
29− ~zod/try=> (jobe a/n/'20' b/~ c/a/~[s/'mol'] ~)
30− [%o p={[p='a' q=[%n p=~.20]] [p='c' q=[%a p=~[[%s p=~.mol]]]] [p='b' q=~]}]
31− ~zod/try=> (crip (pojo (jobe a/n/'20' b/~ c/a/~[s/'mol'] ~)))
32− '{"b":null,"c":["mol"],"a":20}'
33−
34−
docs/system/hoon/library/gate/jone.mddeleted−40
@@ -1,40 +0,0 @@
1−### `++jone`
2−
3−`++json` number from unigned
4−
5−Produces a `++json` number from an unsigned atom.
6−
7−Accepts
8−-------
9−
10−`a` is an atom of odor [`@u`]().
11−
12−Produces
13−--------
14−
15−A [`++json`]().
16−
17−Source
18−------
19−
20− ++ jone :: number from unsigned
21− |= a=@u
22− ^- json
23− :- %n
24− ?: =(0 a) '0'
25− (crip (flop |-(^-(tape ?:(=(0 a) ~ [(add '0' (mod a 10)) $(a (div a 10))])))))
26− ::
27−
28−Examples
29−--------
30−
31− ~zod/try=> (jone 1)
32− [%n p=~.1]
33− ~zod/try=> (pojo (jone 1))
34− "1"
35− ~zod/try=> (jone 1.203.196)
36− [%n p=~.1203196]
37− ~zod/try=> (pojo (jone 1.203.196))
38− "1203196"
39−
40−
docs/system/hoon/library/gate/just.mddeleted−48
@@ -1,48 +0,0 @@
1−### `++just`
2−
3−Match a char
4−
5−Match and consume a single character.
6−
7−Accepts
8−-------
9−
10−`daf` is a [`++char`]()
11−
12−Produces
13−--------
14−
15−A [`++rule`]().
16−
17−Source
18−------
19−
20− ++ just :: XX redundant, jest
21− ~/ %just :: match a char
22− |= daf=char
23− ~/ %fun
24− |= tub=nail
25− ^- (like char)
26− ?~ q.tub
27− (fail tub)
28− ?. =(daf i.q.tub)
29− (fail tub)
30− (next tub)
31− ::
32−
33−
34−Examples
35−--------
36−
37− ~zod/try=> ((just 'a') [[1 1] "abc"])
38− [p=[p=1 q=2] q=[~ [p=~~a q=[p=[p=1 q=2] q="bc"]]]]
39− ~zod/try=> (scan "abc" (just 'a'))
40− ! {1 2}
41− ! 'syntax-error'
42− ! exit
43− ~zod/try=> (scan "a" (just 'a'))
44− ~~a
45− ~zod/try=> (scan "%" (just '%'))
46− ~~~25.
47−
48−
docs/system/hoon/library/gate/kel.mddeleted−26
@@ -1,26 +0,0 @@
1−### `++kel`
2−
3−Parse left curley bracket
4−
5−Parses ASCII character 123, the left curly bracket. Note that `{`
6−(`kel`) and `}` (`ker`) open and close a Hoon expression for Hoon string
7−interpolation. To parse either of them, they must be escaped.
8−
9−Source
10−------
11−
12− ++ kel (just '{')
13−
14−Examples
15−--------
16−
17− ~zod/try=> (scan "\{" kel)
18− ~~~7b.
19− ~zod/try=> `cord`(scan "\{" kel)
20− '{'
21− ~zod/try=> (kel [[1 1] "\{"])
22− [p=[p=1 q=2] q=[~ [p=~~~7b. q=[p=[p=1 q=2] q=""]]]]
23− ~zod/try=> (kel [[1 1] " \{"])
24− [p=[p=1 q=1] q=~]
25−
26−
docs/system/hoon/library/gate/ker.mddeleted−26
@@ -1,26 +0,0 @@
1−### `++ker`
2−
3−Parse right curley bracket
4−
5−Parses ASCII character 125, the right curly bracket. Note that `{`
6−(`kel`) and `}` (`ker`) open and close a Hoon expression for Hoon string
7−interpolation. To parse either of them, they must be escaped.
8−
9−Source
10−------
11−
12− ++ ker (just '}')
13−
14−Examples
15−--------
16−
17− ~zod/try=> (scan "}" ker)
18− ~~~7d.
19− ~zod/try=> `cord`(scan "}" ker)
20− '}'
21− ~zod/try=> (ker [[1 1] "}"])
22− [p=[p=1 q=2] q=[~ [p=~~~7d. q=[p=[p=1 q=2] q=""]]]]
23− ~zod/try=> (ker [[1 1] "\{}"])
24− [p=[p=1 q=1] q=~]
25−
26−
docs/system/hoon/library/gate/ket.mddeleted−23
@@ -1,23 +0,0 @@
1−### `++ket`
2−
3−Parse caret
4−
5−Parses ASCII character 94, the caret.
6−
7−Source
8−------
9−
10− ++ ket (just '^')
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "^" ket)
16− ~~~5e.
17− ~zod/try=> `cord`(scan "^" ket)
18− '^'
19− ~zod/try=> (ket [[1 1] "^"])
20− [p=[p=1 q=2] q=[~ [p=~~~5e. q=[p=[p=1 q=2] q=""]]]]
21− ~zod/try=> (ket [[1 1] ".^"])
22− [p=[p=1 q=1] q=~]
23−
docs/system/hoon/library/gate/knee.mddeleted−54
@@ -1,54 +0,0 @@
1−### `++knee`
2−
3−Recursive parsers
4−
5−Used for recursive parsers, which would otherwise be infinite when
6−compiled.
7−
8−Accepts
9−-------
10−
11−`gar` is a noun.
12−
13−`sef` is a [gate]() that accepts a [`++rule`]()
14−
15−Produces
16−--------
17−
18−A [`++rule`]().
19−
20−Source
21−------
22−
23− ++ knee :: callbacks
24− |* [gar=* sef=_|.(rule)]
25− |= tub=nail
26− ^- (like ,_gar)
27− ((sef) tub)
28− ::
29−
30−Examples
31−--------
32−
33− ~zod/try=> |-(;~(plug prn ;~(pose $ (easy ~))))
34− ! rest-loop
35− ! exit
36− ~zod/try=> |-(;~(plug prn ;~(pose (knee *tape |.(^$)) (easy ~))))
37− < 1.obo
38− [ c=c=tub=[p=[p=@ud q=@ud] q=""]
39− b
40− < 1.bes
41− [ c=tub=[p=[p=@ud q=@ud] q=""]
42− b=<1.tnv [tub=[p=[p=@ud q=@ud] q=""] <1.ktu [daf=@tD <414.fvk 101.jzo 1.ypj %164>]>]>
43− a=<1.fvg [tub=[p=[p=@ud q=@ud] q=""] <1.khu [[les=@ mos=@] <414.fvk 101.jzo 1.ypj %164>]>]>
44− v=<414.fvk 101.jzo 1.ypj %164>
45− ]
46− >
47− a
48− ... 450 lines omitted ...
49− ]
50− >
51− ~zod/try=> (scan "abcd" |-(;~(plug prn ;~(pose (knee *tape |.(^$)) (easy ~)))))
52− [~~a "bcd"]
53−
54−
docs/system/hoon/library/gate/last.mddeleted−42
@@ -1,42 +0,0 @@
1−### `++last`
2−
3−Farther trace
4−
5−Compares two line-column pairs, called [`++hair`]()s, `zyc` and `naz`, producing whichever
6−is further along.
7−
8−Accepts
9−-------
10−
11−`naz` is a [hair]().
12−
13−`zyc` is a [hair]().
14−
15−Produces
16−--------
17−
18−a `++hair`.
19−
20−Source
21−------
22−
23− ++ last |= [zyc=hair naz=hair] :: farther trace
24− ^- hair
25− ?: =(p.zyc p.naz)
26− ?:((gth q.zyc q.naz) zyc naz)
27− ?:((gth p.zyc p.naz) zyc naz)
28− ::
29−
30−
31−Examples
32−--------
33−
34− ~zod/try=> (last [1 1] [1 2])
35− [p=1 q=2]
36− ~zod/try=> (last [2 1] [1 2])
37− [p=2 q=1]
38− ~zod/try=> (last [0 0] [99 0])
39− [p=99 q=0]
40− ~zod/try=> (last [7 7] [7 7])
41− [p=7 q=7]
42−
docs/system/hoon/library/gate/lead.mddeleted−48
@@ -1,48 +0,0 @@
1−### `++lead`
2−
3−Subtract leap seconds
4−
5−Produces an absolute date ([`@ud`]()) with the 25 leap seconds
6−subtracted.
7−
8−Accepts
9−-------
10−
11−`ley` is a [`++date`]().
12−
13−Produces
14−--------
15−
16−An atom of [odor]() [`@da`](), which represents an absolute date.
17−
18−Source
19−------
20−
21− ++ lead :: from leap sec time
22− |= ley=date
23− =+ ler=(year ley)
24− =+ n=0
25− |- ^- @da
26− =+ led=(sub ler (mul n ~s1))
27− ?: (gte ler (add (snag n les:yu) ~s1))
28− led
29− ?: &((gte ler (snag n les:yu)) (lth ler (add (snag n les:yu) ~s1)))
30− ?: =(s.t.ley 60)
31− (sub led ~s1)
32− led
33− ?: =(+(n) (lent les:yu))
34− (sub led ~s1)
35− $(n +(n))
36− ::
37−
38−Examples
39−--------
40−
41− ~zod/try=> (yore `@da`(bex 127))
42− [[a=%.y y=226] m=12 t=[d=5 h=15 m=30 s=8 f=~]]
43− ~zod/try=> (lead (yore `@da`(bex 127)))
44− ~226.12.5..15.29.43
45− ~zod/try=> (lead (yore `@da`(bex 126)))
46− ~146138512088-.6.19..07.44.39
47−
48−
docs/system/hoon/library/gate/lent.mddeleted−37
@@ -1,37 +0,0 @@
1−### `++lent`
2−
3−List length
4−
5−Produces the length of any [`++list`]() `a` as an atom.
6−
7−Accepts
8−-------
9−
10−`a` is a list.
11−
12−Produces
13−--------
14−
15−an atom.
16−
17−Source
18−------
19−
20− ++ lent :: length
21− ~/ %lent
22− |= a=(list)
23− ^- @
24− =+ b=0
25− |-
26− ?~ a b
27− $(a t.a, b +(b))
28−
29−Examples
30−--------
31−
32− ~zod/try=> (lent (limo [1 2 3 4 ~]))
33− 4
34− ~zod/try=> (lent (limo [1 'a' 2 'b' (some 10) ~]))
35− 5
36−
37−
docs/system/hoon/library/gate/less.mddeleted−43
@@ -1,43 +0,0 @@
1−### `++less`
2−
3−Parse unless
4−
5−Parsing composer: if an [`++edge`]() `vex` reflects a success, fail. Otherwise,
6−connect `vex` with the following [`++rule`]().
7−
8−Accepts
9−-------
10−
11−`sab` is a `++rule`.
12−
13−`vex` is an `++edge`.
14−
15−Produces
16−--------
17−
18−
19−
20−Source
21−------
22−
23− ++ less :: no first and second
24− |* [vex=edge sab=_rule]
25− ?~ q.vex
26− =+ roq=(sab)
27− [p=(last p.vex p.roq) q=q.roq]
28− vex(q ~)
29− ::
30−
31−Examples
32−--------
33−
34− ~zod/try=> (scan "sas-/lo" (star ;~(less lus bar prn)))
35− "sas-/lo"
36− ~zod/try=> (scan "sas-/l+o" (star ;~(less lus bar prn)))
37− ! {1 8}
38− ! exit
39− ~zod/try=> (scan "sas|-/lo" (star ;~(less lus bar prn)))
40− ! {1 5}
41− ! exit
42−
43−
docs/system/hoon/library/gate/levy.mddeleted−38
@@ -1,38 +0,0 @@
1−### `++levy`
2−
3−Logical "and" on list
4−
5−Computes the Boolean logical "and" on the results of [gate]() `b` applied to each individual element in [`++list`]() `a`.
6−
7−Accepts
8−-------
9−
10−`a` is a list.
11−
12−`b` is a gate.
13−
14−Produces
15−--------
16−
17−Source
18−------
19−
20− ++ levy
21− ~/ %levy :: all of
22− |* [a=(list) b=_|=(p=* .?(p))]
23− |- ^- ?
24− ?~ a &
25− ?. (b i.a) |
26− $(a t.a)
27−
28−Examples
29−--------
30−
31− ~zod/try=> =a |=(a=@ (lte a 1))
32− ~zod/try=> (levy (limo [0 1 2 1 ~]) a)
33− %.n
34− ~zod/try=> =a |=(a=@ (lte a 3))
35− ~zod/try=> (levy (limo [0 1 2 1 ~]) a)
36− %.y
37−
38−
docs/system/hoon/library/gate/lien.mddeleted−26
@@ -1,26 +0,0 @@
1−### `++lien`
2−
3−Logical "or" on list
4−
5− ++ lien :: some of
6− ~/ %lien
7− |* [a=(list) b=$+(* ?)]
8− |- ^- ?
9− ?~ a |
10− ?: (b i.a) &
11− $(a t.a)
12−
13−Computes the Boolean logical "or" on the results of applying [gate]() `b` to every element of [`++list`]() `a`.
14−
15−`a` is a list.
16−
17−`b` is a gate.
18−
19− ~zod/try=> =a |=(a=@ (gte a 1))
20− ~zod/try=> (lien (limo [0 1 2 1 ~]) a)
21− %.y
22− ~zod/try=> =a |=(a=@ (gte a 3))
23− ~zod/try=> (lien (limo [0 1 2 1 ~]) a)
24− %.n
25−
26−
docs/system/hoon/library/gate/lift.mddeleted−37
@@ -1,37 +0,0 @@
1−### `++lift`
2−
3−Curried bind
4−
5−Accepts a [`++gate`]() `a` and produces a function that accepts [`++unit`]()
6−`b` to which it applies `a`. Used when you want a function that does not accept
7−or produce a unit to both accept and produce a unit.
8−
9−Accepts
10−-------
11−
12−`a` is a gate.
13−
14−`b` is a unit.
15−
16−Produces
17−--------
18−
19−A unit.
20−
21−Source
22−------
23−
24− ++ lift :: lift gate (fmap)
25− |* a=gate :: flipped
26− |* b=(unit) :: curried
27− (bind b a) :: bind
28−
29−Examples
30−--------
31−
32− ~zod/try=> ((lift dec) `(unit ,@)`~)
33− ~
34− ~zod/try=> ((lift dec) `(unit ,@)`[~ 20])
35− [~ 19]
36−
37−
docs/system/hoon/library/gate/limo.mddeleted−33
@@ -1,33 +0,0 @@
1−### `++limo`
2−
3−List Constructor
4−
5−Turns a null-terminated tuple into a [`++list`]().
6−
7−Accepts
8−-------
9−
10−`a` is a null-terminated tuple.
11−
12−Produces
13−--------
14−
15−A list
16−
17−Source
18−------
19−
20− ++ limo :: listify
21− |* a=*
22− ^+ =< $
23− |% +- $ ?~(a ~ ?:(_? i=-.a t=$ $(a +.a)))
24− --
25− a
26−
27−Examples
28−--------
29−
30− ~zod/try=> (limo [1 2 3 ~])
31− [i=1 t=[i=2 t=[i=3 t=~]]]
32−
33−
docs/system/hoon/library/gate/low.mddeleted−24
@@ -1,24 +0,0 @@
1−### `++low`
2−
3−Lowercase
4−
5−Parse a single lowercase letter.
6−
7−Source
8−------
9−
10− ++ low (shim 'a' 'z') :: lowercase
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "g" low)
16− ~~g
17− ~zod/try=> `cord`(scan "g" low)
18− 'g'
19− ~zod/try=> (scan "abcdefghijklmnopqrstuvwxyz" (star low))
20− "abcdefghijklmnopqrstuvwxyz"
21− ~zod/try=> (low [[1 1] "g"])
22− [p=[p=1 q=2] q=[~ [p=~~g q=[p=[p=1 q=2] q=""]]]]
23−
24−
docs/system/hoon/library/gate/lsh.mddeleted−45
@@ -1,45 +0,0 @@
1−### `++lsh`
2−
3−Left-shift
4−
5−Produces an [atom]() by left-shifting `c` by `b` blocks of size `a`.
6−
7−Accepts
8−-------
9−
10−`a` is a block size (see [`++bloq`]()).
11−
12−`b` is an atom.
13−
14−`c` is an atom.
15−
16−Produces
17−--------
18−
19−An atom.
20−
21−Source
22−------
23−
24− ++ lsh :: left-shift
25− ~/ %lsh
26− |= [a=bloq b=@ c=@]
27− (mul (bex (mul (bex a) b)) c)
28−
29−Examples
30−--------
31−
32− ~zod/try=> `@ub`1
33− 0b1
34− ~zod/try=> `@ub`(lsh 0 1 1)
35− 0b10
36− ~zod/try=> (lsh 0 1 1)
37− 2
38− ~zod/try=> `@ub`255
39− 0b1111.1111
40− ~zod/try=> `@ub`(lsh 3 1 255)
41− 0b1111.1111.0000.0000
42− ~zod/try=> (lsh 3 1 255)
43− 65.280
44−
45−
docs/system/hoon/library/gate/lte.mddeleted−40
@@ -1,40 +0,0 @@
1−### `++lte`
2−
3−Less-than/equal
4−
5−Tests whether `a` is less than or equal to `b`.
6−
7−Accepts
8−-------
9−
10−`a` is an [atom]().
11−
12−`b` is an atom.
13−
14−Produces
15−--------
16−
17−A boolean.
18−
19−Source
20−------
21−
22− ++ lte :: less-equal
23− ~/ %lte
24− |= [a=@ b=@]
25− |(=(a b) (lth a b))
26− ::
27−
28−Examples
29−--------
30−
31− ~zod/try=> (lte 4 5)
32− %.y
33− ~zod/try=> (lte 5 4)
34− %.n
35− ~zod/try=> (lte 5 5)
36− %.y
37− ~zod/try=> (lte 0 0)
38− %.y
39−
40−
docs/system/hoon/library/gate/lth.mddeleted−45
@@ -1,45 +0,0 @@
1−### `++lth`
2−
3−Less-than
4−
5−Tests whether `a` is less than `b`.
6−
7−Accepts
8−-------
9−
10−`a` is an [atom]().
11−
12−`b` is an atom.
13−
14−Produces
15−--------
16−
17−A boolean.
18−
19−Source
20−------
21−
22− ++ lth :: less-than
23− ~/ %lth
24− |= [a=@ b=@]
25− ^- ?
26− ?& !=(a b)
27− |-
28− ?| =(0 a)
29− ?& !=(0 b)
30− $(a (dec a), b (dec b))
31− == == ==
32− ::
33−
34−Examples
35−--------
36−
37− ~zod/try=> (lth 4 5)
38− %.y
39− ~zod/try=> (lth 5 4)
40− %.n
41− ~zod/try=> (lth 5 5)
42− %.n
43− ~zod/try=> (lth 5 0)
44− %.n
45−
docs/system/hoon/library/gate/lus.mddeleted−24
@@ -1,24 +0,0 @@
1−### `++lus`
2−
3−Parse plus sign
4−
5−Parses ASCII character 43, the plus sign.
6−
7−Source
8−------
9−
10− ++ lus (just '+')
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "+" lus)
16− ~~~2b.
17− ~zod/try=> `cord`(scan "+" lus)
18− '+'
19− ~zod/try=> (lus [[1 1] "+"])
20− [p=[p=1 q=2] q=[~ [p=~~~2b. q=[p=[p=1 q=2] q=""]]]]
21− ~zod/try=> (lus [[1 1] ".+"])
22− [p=[p=1 q=1] q=~]
23−
24−
docs/system/hoon/library/gate/lust.mddeleted−46
@@ -1,46 +0,0 @@
1−
2−### `++lust`
3−
4−Detect newline
5−
6−Advances the [`++hair`]() `naz` by a row if the [`++char`]() `weq` is a newline, or by a
7−column if `weq` is any other character.
8−
9−Accepts
10−-------
11−
12−`weq` is a char.
13−
14−`naz` is a hair.
15−
16−Produces
17−--------
18−
19−A hair.
20−
21−Source
22−------
23−
24− ++ lust |= [weq=char naz=hair] :: detect newline
25− ^- hair
26− ?:(=(10 weq) [+(p.naz) 1] [p.naz +(q.naz)])
27−
28−
29−Examples
30−--------
31−
32− ~zod/try=> (lust `a` [1 1])
33− [p=1 q=2]
34− ~zod/try=> (lust `@t`10 [1 1])
35− [p=2 q=1]
36− ~zod/try=> (lust '9' [10 10])
37− [p=10 q=11]
38− /~zod/try=> (roll "maze" [.(+<+ [1 1])]:lust)
39− [1 5]
40− /~zod/try=> %- roll :_ [.(+<+ [1 1])]:lust
41− """
42− Sam
43− lokes
44− """
45− [2 6]
46−
docs/system/hoon/library/gate/mack.mddeleted−45
@@ -1,45 +0,0 @@
1−### `++mack`
2−
3−Nock subject to unit
4−
5−Accepts a nock subject-formula cell and wraps it into a [`++unit`]().
6−`fol` is pure nock, meaning that nock `11` operations result in a block,
7−producing a `~`.
8−
9−Accepts
10−-------
11−
12−`sub` is a subject [noun]().
13−
14−`fol` is a formula noun, which is generally a `++nock`.
15−
16−Produces
17−--------
18−
19−The `++unit` of a noun.
20−
21−Source
22−------
23−
24− ++ mack
25− |= [sub=* fol=*]
26− ^- (unit)
27− =+ ton=(mink [sub fol] |=(* ~))
28− ?.(?=([0 *] ton) ~ [~ p.ton])
29− ::
30−
31−Examples
32−--------
33−
34− ~zod/try=> (mack [[1 2 3] [0 1]])
35− [~ [1 2 3]]
36− ~zod/try=> (mack [41 4 0 1])
37− [~ 42]
38− ~zod/try=> (mack [4 0 4])
39− ~
40− ~zod/try=> (mack [[[0 2] [1 3]] 4 4 4 4 0 5])
41− [~ 6]
42− ~zod/try=> ;;((unit ,@tas) (mack [[1 %yes %no] 6 [0 2] [0 6] 0 7]))
43− [~ %no]
44−
45−
docs/system/hoon/library/gate/mang.mddeleted−55
@@ -1,55 +0,0 @@
1−### `++mang`
2−
3−Unit: Slam gate with sample
4−
5−Produces a [`++unit`]() computation result from slamming `gat` with
6−`sam`, using `sky` to compute or block on nock 11 when applicable.
7−Similar to [`++mong`]().
8−
9−Accepts
10−-------
11−
12−`gat` is a [noun]() that is generally a [`gate`]().
13−
14−`sam` is a [`sample`]() noun.
15−
16−`sky` is an [%iron]() gate invoked with [nock operator 11]().
17−
18−Produces
19−--------
20−
21−The `++unit` of a noun.
22−
23−Source
24−------
25−
26− ++ mang
27− |= [[gat=* sam=*] sky=$+(* (unit))]
28− ^- (unit)
29− =+ ton=(mong [[gat sam] sky])
30− ?.(?=([0 *] ton) ~ [~ p.ton])
31− ::
32−
33−Examples
34−--------
35−
36− ~zod/try=> (mang [|=(@ 20) ~] ,~)
37− [~ 20]
38− ~zod/try=> (mang [|=(@ !!) ~] ,~)
39− ~
40− ~zod/try=> (mang [|=(a=@ (add 20 a)) ~] ,~)
41− [~ 20]
42− ~zod/try=> (mang [|=(a=[@ @] (add 20 -.a)) ~] ,~)
43− ~
44− ~zod/try=> (mang [|=(a=[@ @] (add 20 -.a)) [4 6]] ,~)
45− [~ 24]
46− ~zod/try=> (mang [|=(a=@ .^(a)) ~] ,~)
47− ~
48− ~zod/try=> (mang [|=(a=@ .^(a)) ~] ,[~ %42])
49− [~ 42]
50− ~zod/try=> (mang [|=(a=@ .^(a)) ~] |=(a=* [~ a 6]))
51− [~ [0 6]]
52− ~zod/try=> (mang [|=(a=@ .^(a)) 8] |=(a=* [~ a 6]))
53− [~ [8 6]]
54−
55−
docs/system/hoon/library/gate/mas.mddeleted−48
@@ -1,48 +0,0 @@
1−### `++mas`
2−
3−Axis within head/tail?
4−
5−Computes the axis of `a` within either the head or tail of a noun (depends whether `a` lies within the the head or tail).
6−
7−Accepts
8−-------
9−
10−`a` is an [atom]().
11−
12−Produces
13−--------
14−
15−An atom.
16−
17−Source
18−------
19−
20− ++ mas :: tree body
21− ~/ %mas
22− |= a=@
23− ^- @
24− ?- a
25− 1 !!
26− 2 1
27− 3 1
28− * (add (mod a 2) (mul $(a (div a 2)) 2))
29− ==
30− ::
31−
32−Examples
33−--------
34−
35− ~zod/try=> (mas 3)
36− 1
37− ~zod/try=> (mas 4)
38− 2
39− ~zod/try=> (mas 5)
40− 3
41− ~zod/try=> (mas 6)
42− 2
43− ~zod/try=> (mas 0)
44− ! exit
45− ~zod/try=> (mas 1)
46− ! exit
47−
48−
docs/system/hoon/library/gate/mask.mddeleted−46
@@ -1,46 +0,0 @@
1−### `++mask`
2−
3−Match char
4−
5−Parser generator. Matches the next character if it is in a list of
6−characters.
7−
8−Accepts
9−-------
10−
11−`bud` is a list of [`++char`]()
12−
13−Produces
14−--------
15−
16−A [`++rule`]().
17−
18−Source
19−------
20−
21− ++ mask :: match char in set
22− ~/ %mask
23− |= bud=(list char)
24− ~/ %fun
25− |= tub=nail
26− ^- (like char)
27− ?~ q.tub
28− (fail tub)
29− ?. (lien bud |=(a=char =(i.q.tub a)))
30− (fail tub)
31− (next tub)
32− ::
33−
34−Examples
35−--------
36−
37− ~zod/try=> (scan "a" (mask "cba"))
38− ~~a
39− ~zod/try=> ((mask "abc") [[1 1] "abc"])
40− [p=[p=1 q=2] q=[~ [p=~~a q=[p=[p=1 q=2] q="bc"]]]]
41− ~zod/try=> ((mask "abc") [[1 1] "bbc"])
42− [p=[p=1 q=2] q=[~ [p=~~b q=[p=[p=1 q=2] q="bc"]]]]
43− ~zod/try=> ((mask "abc") [[1 1] "dbc"])
44− [p=[p=1 q=1] q=~]
45−
46−
docs/system/hoon/library/gate/mat.mddeleted−54
@@ -1,54 +0,0 @@
1−### `++mat`
2−
3−Length-encode
4−
5−Produces a cell whose tail `q` is atom `a` with a bit representation of
6−its length prepended to it (as the least significant bits). The head `p`
7−is the length of `q` in bits.
8−
9−Accepts
10−-------
11−
12−`a` is an atom.
13−
14−Produces
15−--------
16−
17−A cell of two atoms, `p` and `q`.
18−
19−Source
20−------
21−
22− ++ mat :: length-encode
23− ~/ %mat
24− |= a=@
25− ^- [p=@ q=@]
26− ?: =(0 a)
27− [1 1]
28− =+ b=(met 0 a)
29− =+ c=(met 0 b)
30− :- (add (add c c) b)
31− (cat 0 (bex c) (mix (end 0 (dec c) b) (lsh 0 (dec c) a)))
32−
33−
34−Examples
35−--------
36−
37− ~zod/try=> (mat 0xaaa)
38− [p=20 q=699.024]
39− ~zod/try=> (met 0 q:(mat 0xaaa))
40− 20
41− ~zod/try=> `@ub`q:(mat 0xaaa)
42− 0b1010.1010.1010.1001.0000
43− ~zod/try=> =a =-(~&(- -) `@ub`0xaaa)
44− 0b1010.1010.1010
45− ~zod/try=> =b =-(~&(- -) `@ub`(xeb a))
46− 0b1100
47− ~zod/try=> =b =-(~&(- -) `@ub`(met 0 a))
48− 0b1100
49− ~zod/try=> =c =-(~&(- -) (xeb b))
50− 4
51− ~zod/try=> [`@ub`a `@ub`(end 0 (dec c) b) `@ub`(bex c)]
52− [0b1010.1010.1010 0b100 0b1.0000]
53−
54−
docs/system/hoon/library/gate/mate.mddeleted−49
@@ -1,49 +0,0 @@
1−### `++mate`
2−
3−Choose
4−
5−Accepts two units `a` and `b` whose values are expected to be
6−equivalent. If either is empty, then the value of the other is produced.
7−If neither are empty, it asserts that both values are the same and
8−produces that value. If the assertion fails, `++mate` crashes with
9−`'mate'` in the stack trace.
10−
11−Accepts
12−-------
13−
14−`a` is a unit.
15−
16−`b` is a unit.
17−
18−Produces
19−--------
20−
21−A unit or crash.
22−
23−Source
24−------
25−
26−++ mate :: choose
27− |* [a=(unit) b=(unit)]
28− ?~ b a
29− ?~ a b
30− ?.(=(u.a u.b) ~|('mate' !!) a)
31−
32−Examples
33−--------
34−
35− ~zod/try=> =a ((unit ,@) [~ 97])
36− ~zod/try=> =b ((unit ,@) [~ 97])
37− ~zod/try=> (mate a b)
38− [~ 97]
39− ~zod/try=> =a ((unit ,@) [~ 97])
40− ~zod/try=> =b ((unit ,@) [~])
41− ~zod/try=> (mate a b)
42− [~ 97]
43− ~zod/try=> =a ((unit ,@) [~ 97])
44− ~zod/try=> =b ((unit ,@) [~ 98])
45− ~zod/try=> (mate a b)
46− ! 'mate'
47− ! exit
48−
49−
docs/system/hoon/library/gate/max.mddeleted−40
@@ -1,40 +0,0 @@
1−### `++max`
2−
3−Maximum
4−
5−Computes the greater of `a` and `b`.
6−
7−Accepts
8−-------
9−
10−`a` is an [atom]().
11−
12−`b` is an atom.
13−
14−Produces
15−--------
16−
17−An atom.
18−
19−Source
20−------
21−
22− ++ max :: maximum
23− ~/ %max
24− |= [a=@ b=@]
25− ^- @
26− ?: (gth a b) a
27− b
28− ::
29−
30−Examples
31−--------
32−
33− ~zod/try=> (max 10 100)
34− 100
35− ~zod/try=> (max 10.443 9)
36− 10.443
37− ~zod/try=> (max 0 1)
38− 1
39−
40−
docs/system/hoon/library/gate/meat.mddeleted−48
@@ -1,48 +0,0 @@
1−### `++meat`
2−
3−Kite to .^ path
4−
5−Converts a type request name to a [`++path`]().
6−
7−Accepts
8−-------
9−
10−`kit` is a [`++kite`]().
11−
12−Produces
13−--------
14−
15−A `++path`.
16−
17−Source
18−------
19−
20− ++ meat :: kite to .^ path
21− |= kit=kite
22− ^- path
23− [(cat 3 'c' p.kit) (scot %p r.kit) s.kit (scot `dime`q.kit) t.kit]
24− ::
25−
26−Examples
27−--------
28−
29− zod/try=/zop> `kite`[%x ud/1 ~zod %main /sur/down/gate/hook]
30− [p=%x q=[%ud p=1] r=~zod s=%main t=/sur/down/gate/hook]
31− ~zod/try=/zop> (meat [%x ud/1 ~zod %main /sur/down/gate/hook])
32− /cx/~zod/main/1/sur/down/gate/hook
33− ~zod/try=/zop> .^((meat [%x ud/1 ~zod %main /sur/down/gate/hook]))
34− 8.024.240.839.827.090.233.853.057.929.619.452.695.436.878.709.611.140.677.
35− 745.908.646.440.925.885.935.296.374.867.974.972.908.054.571.544.099.882.490.
36− 677.391.983.737.511.220.072.391.888.081.664.570
37− ~zod/try=/zop> (,@t .^((meat [%x ud/1 ~zod %main /sur/down/gate/hook])))
38− '''
39− ::
40− :::: /hoon/gate/down/sur
41− ::
42− /? 314
43− /- *markdown
44− down
45−
46− '''
47−
48−
docs/system/hoon/library/gate/mes.mddeleted−24
@@ -1,24 +0,0 @@
1−### `++mes`
2−
3−Hexbyte
4−
5−Parse a hexbyte.
6−
7−Source
8−------
9−
10− ++ mes %+ cook :: hexbyte
11− |=([a=@ b=@] (add (mul 16 a) b))
12− ;~(plug hit hit)
13−
14−Examples
15−--------
16−
17− ~zod/try=> (scan "2A" mes)
18− 42
19− ~zod/try=> (mes [[1 1] "2A"])
20− [p=[p=1 q=3] q=[~ u=[p=42 q=[p=[p=1 q=3] q=""]]]]
21− ~zod/try=> (scan "42" mes)
22− 66
23−
24−
docs/system/hoon/library/gate/mesc.mddeleted−42
@@ -1,42 +0,0 @@
1−### `++mesc`
2−
3−Escape special chars
4−
5−Escape special characters, used in [`++show`](/doc/hoon/library/2ez#++show)
6−
7−Accepts
8−-------
9−
10−`vib` is a [`++tape`]().
11−
12−Produces
13−--------
14−
15−A `++tape`.
16−
17−Source
18−------
19−
20− ++ mesc :: ctrl code escape
21− |= vib=tape
22− ^- tape
23− ?~ vib
24− ~
25− ?: =('\\' i.vib)
26− ['\\' '\\' $(vib t.vib)]
27− ?: ?|((gth i.vib 126) (lth i.vib 32) =(39 i.vib))
28− ['\\' (welp ~(rux at i.vib) '/' $(vib t.vib))]
29− [i.vib $(vib t.vib)]
30− ::
31−
32−Examples
33−--------
34−
35− /~zod/try=> (mesc "ham lus")
36− "ham lus"
37− /~zod/try=> (mesc "bas\\hur")
38− "bas\\\\hur"
39− /~zod/try=> (mesc "as'saß")
40− "as\0x27/sa\0xc3/\0x9f/"
41−
42−
docs/system/hoon/library/gate/met.mddeleted−37
@@ -1,37 +0,0 @@
1−### `++met`
2−
3−Measure
4−
5−Computes the number of blocks of size `a` in `b`, producing an [atom]().
6−
7−`a` is a block size (see [`++bloq`]()).
8−
9−`b` is an atom.
10−
11−Source
12−------
13−
14− ++ met :: measure
15− ~/ %met
16− |= [a=bloq b=@]
17− ^- @
18− =+ c=0
19− |-
20− ?: =(0 b) c
21− $(b (rsh a 1 b), c +(c))
22−
23−Examples
24−--------
25−
26− ~zod/try=> (met 0 1)
27− 1
28− ~zod/try=> (met 0 2)
29− 2
30− ~zod/try=> (met 3 255)
31− 1
32− ~zod/try=> (met 3 256)
33− 2
34− ~zod/try=> (met 3 'abcde')
35− 5
36−
37−
docs/system/hoon/library/gate/min.mddeleted−40
@@ -1,40 +0,0 @@
1−### `++min`
2−
3−Minimum
4−
5−Computes the lesser of `a` and `b`.
6−
7−Accepts
8−-------
9−
10−`a` is an [atom]().
11−
12−`b` is an atom.
13−
14−Produces
15−--------
16−
17−An atom.
18−
19−Source
20−------
21−
22− ++ min :: minimum
23− ~/ %min
24− |= [a=@ b=@]
25− ^- @
26− ?: (lth a b) a
27− b
28− ::
29−
30−Examples
31−--------
32−
33− ~zod/try=> (min 10 100)
34− 10
35− ~zod/try=> (min 10.443 9)
36− 9
37− ~zod/try=> (min 0 1)
38− 0
39−
40−
docs/system/hoon/library/gate/mink.mddeleted−122
@@ -1,122 +0,0 @@
1−### `++mink`
2−
3−Mock interpreter
4−
5−Bottom-level [mock]() (virtual nock) interpreter. Produces a
6−[`++tone`](), a nock computation result. If nock 11 is invoked, `sky`
7−computes on the subject and produces a [`++unit`]() result. An empty
8−result becomes a `%1` `++tone`, indicating a block.
9−
10−Accepts
11−-------
12−
13−`sub` is the subject as a [noun]().
14−
15−`fol` is the formula as a noun.
16−
17−`sky` is an [`%iron`]() gate invoked with [nock operator 11]().
18−
19−Produces
20−--------
21−
22−A `++tone`.
23−
24−Source
25−------
26−
27− ++ mink
28− ~/ %mink
29− |= [[sub=* fol=*] sky=$+(* (unit))]
30− =+ tax=*(list ,[@ta *])
31− |- ^- tone
32− ?@ fol
33− [%2 tax]
34− ?: ?=(^ -.fol)
35− =+ hed=$(fol -.fol)
36− ?: ?=(%2 -.hed)
37− hed
38− =+ tal=$(fol +.fol)
39− ?- -.tal
40− %0 ?-(-.hed %0 [%0 p.hed p.tal], %1 hed)
41− %1 ?-(-.hed %0 tal, %1 [%1 (weld p.hed p.tal)])
42− %2 tal
43− ==
44− ?+ fol
45− [%2 tax]
46− ::
47− [0 b=@]
48− ?: =(0 b.fol) [%2 tax]
49− ?: =(1 b.fol) [%0 sub]
50− ?: ?=(@ sub) [%2 tax]
51− =+ [now=(cap b.fol) lat=(mas b.fol)]
52− $(b.fol lat, sub ?:(=(2 now) -.sub +.sub))
53− ::
54− [1 b=*]
55− [%0 b.fol]
56− ::
57− [2 b=[^ *]]
58− =+ ben=$(fol b.fol)
59− ?. ?=(%0 -.ben) ben
60− ?>(?=(^ p.ben) $(sub -.p.ben, fol +.p.ben))
61− ::?>(?=(^ p.ben) $([sub fol] p.ben)
62− ::
63− [3 b=*]
64− =+ ben=$(fol b.fol)
65− ?. ?=(%0 -.ben) ben
66− [%0 .?(p.ben)]
67− ::
68− [4 b=*]
69− =+ ben=$(fol b.fol)
70− ?. ?=(%0 -.ben) ben
71− ?. ?=(@ p.ben) [%2 tax]
72− [%0 .+(p.ben)]
73− ::
74− [5 b=*]
75− =+ ben=$(fol b.fol)
76− ?. ?=(%0 -.ben) ben
77− ?. ?=(^ p.ben) [%2 tax]
78− [%0 =(-.p.ben +.p.ben)]
79− ::
80− [6 b=* c=* d=*]
81− $(fol =>(fol [2 [0 1] 2 [1 c d] [1 0] 2 [1 2 3] [1 0] 4 4 b]))
82− ::
83− [7 b=* c=*] $(fol =>(fol [2 b 1 c]))
84− [8 b=* c=*] $(fol =>(fol [7 [[0 1] b] c]))
85− [9 b=* c=*] $(fol =>(fol [7 c 0 b]))
86− [10 @ c=*] $(fol c.fol)
87− [10 [b=* c=*] d=*]
88− =+ ben=$(fol c.fol)
89− ?. ?=(%0 -.ben) ben
90− ?: ?=(?(%hunk %lose %mean %spot) b.fol)
91− $(fol d.fol, tax [[b.fol p.ben] tax])
92− $(fol d.fol)
93− ::
94− [11 b=*]
95− =+ ben=$(fol b.fol)
96− ?. ?=(%0 -.ben) ben
97− =+ val=(sky p.ben)
98− ?~(val [%1 p.ben ~] [%0 u.val])
99− ::
100− ==
101− ::
102−
103−Examples
104−--------
105−
106− ~zod/try=> (mink [20 [4 0 1]] ,~)
107− [%0 p=21]
108− ~zod/try=> (mink [[90 5 3] [0 3]] ,~)
109− [%0 p=[5 3]]
110− ~zod/try=> (mink 20^[4 0 1] ,~)
111− [%0 p=21]
112− ~zod/try=> (mink [90 5 3]^[0 3] ,~)
113− [%0 p=[5 3]]
114− ~zod/try=> (mink [0]^[11 1 20] ,~)
115− [%1 p=~[20]]
116− ~zod/try=> (mink [0]^[11 1 20] |=(a=* `[40 a]))
117− [%0 p=[40 20]]
118− ~zod/try=> (mink [5]^[0 2] ,~)
119− [%2 p=~]
120− ~zod/try=> (mink [5]^[10 yelp/[0 1] 0 0] ,~)
121− [%2 p=~[[~.yelp 5]]]
122−
docs/system/hoon/library/gate/mix.mddeleted−52
@@ -1,52 +0,0 @@
1−### `++mix`
2−
3−Binary XOR
4−
5−Produces the bit-wise logical XOR of `a` and `b`, producing an [atom]().
6−
7−Accepts
8−-------
9−
10−`a` is an atom
11−
12−`b` is an atom
13−
14−Produces
15−--------
16−
17−An atom.
18−
19−Source
20−------
21−
22− ++ mix :: binary xor
23− ~/ %mix
24− |= [a=@ b=@]
25− ^- @
26− =+ [c=0 d=0]
27− |-
28− ?: ?&(=(0 a) =(0 b)) d
29− %= $
30− a (rsh 0 1 a)
31− b (rsh 0 1 b)
32− c +(c)
33− d (add d (lsh 0 c =((end 0 1 a) (end 0 1 b))))
34− ==
35−
36−Examples
37−--------
38−
39− ~zod/try=> `@ub`2
40− 0b10
41− ~zod/try=> `@ub`3
42− 0b11
43− ~zod/try=> `@ub`(mix 2 3)
44− 0b1
45− ~zod/try=> (mix 2 3)
46− 1
47− ~zod/try=> `@ub`(mix 2 2)
48− 0b0
49− ~zod/try=> (mix 2 2)
50− 0
51−
52−
docs/system/hoon/library/gate/mo.mddeleted−34
@@ -1,34 +0,0 @@
1−### `++mo`
2−
3−Map from list
4−
5−Produces a map of key-value pairs from the left-right cell pairs of list
6−
7−Accepts
8−-------
9−
10−`a` is a [`++list`]().
11−
12−Produces
13−--------
14−
15−A [`++map]()
16−
17−Source
18−------
19−
20− ++ mo :: map from list
21− |* a=(list)
22− => .(a `_(homo a)`a)
23− => .(a `(list ,[p=_-<.a q=_->.a])`a)
24− =+ b=*(map ,_?>(?=(^ a) p.i.a) ,_?>(?=(^ a) q.i.a))
25− (~(gas by b) a)
26− ::
27−
28−Examples
29−--------
30−
31− ~zod/try=> (mo `(list ,[@t *])`[[`a` 1] [`b` 2] ~])
32− {[p=`a` q=1] [p=`b` q=2]}
33−
34−
docs/system/hoon/library/gate/mock.mddeleted−50
@@ -1,50 +0,0 @@
1−### `++mock`
2−
3−Compute formula on subject with hint
4−
5−Produces a [`++toon`](), which is either a sucessful, blocked, or
6−crashed result. If nock 11 is invoked, `sky` computes on the subject and
7−produces a [`++unit`]() result. An empty result becomes a `%1` `++tune`,
8−indicating a block.
9−
10−Accepts
11−-------
12−
13−`sub` is the subject as a [noun]().
14−
15−`fol` is the formula as a noun.
16−
17−`sky` is an [%iron]() gate invoked with [nock operator 11]().
18−
19−Produces
20−--------
21−
22−The `++unit` of a noun.
23−
24−Source
25−------
26−
27− ++ mock
28− |= [[sub=* fol=*] sky=$+(* (unit))]
29− (mook (mink [sub fol] sky))
30− ::
31−
32−Examples
33−--------
34−
35− ~zod/try=> (mock [5 4 0 1] ,~)
36− [%0 p=6]
37− ~zod/try=> (mock [~ 11 1 0] |=(* `999))
38− [%0 p=999]
39− ~zod/try=> (mock [~ 0 1.337] ,~)
40− [%2 p=~]
41− ~zod/try=> (mock [~ 11 1 1.337] ,~)
42− [%1 p=~[1.337]]
43− ~zod/try=> (mock [[[4 4 4 4 0 3] 10] 11 9 2 0 1] |=(* `[+<]))
44− [%0 p=14]
45− ~zod/try=> (mock [[[4 4 4 4 0 3] 10] 11 9 2 0 1] |=(* `[<+<>]))
46− [%0 p=[49 52 0]]
47− ~zod/try=> ;;(tape +:(mock [[[4 4 4 4 0 3] 10] 11 9 2 0 1] |=(* `[<+<>])))
48− "14"
49−
50−
docs/system/hoon/library/gate/mod.mddeleted−38
@@ -1,38 +0,0 @@
1−### `++mod`
2−
3−Modulus
4−
5−Computes the remainder of dividing `a` by `b`.
6−
7−Accepts
8−-------
9−
10−`a` is an [atom]().
11−
12−`b` is an atom.
13−
14−Produces
15−--------
16−
17−An atom.
18−
19−Source
20−------
21−
22− ++ mod :: remainder
23− ~/ %mod
24− |= [a=@ b=@]
25− ^- @
26− ?< =(0 b)
27− (sub a (mul b (div a b)))
28− ::
29−
30−Examples
31−--------
32−
33− ~zod/try=> (mod 5 2)
34− 1
35− ~zod/try=> (mod 5 5)
36− 0
37−
38−
docs/system/hoon/library/gate/mong.mddeleted−55
@@ -1,55 +0,0 @@
1−### `++mong`
2−
3−Slam gate with sample
4−
5−Produces a [`++toon`]() computation result from slamming `gat` with
6−`sam`, using `sky` to compute or block on nock 11 when applicable.
7−
8−Accepts
9−-------
10−
11−`gat` is a [noun]() that is generally a [`gate`]().
12−
13−`sam` is a [`sample`]() noun.
14−
15−`sky` is an [%iron]() gate invoked with [nock operator 11]().
16−
17−Produces
18−--------
19−
20−A `++toon`.
21−
22−Source
23−------
24−
25− ++ mong
26− |= [[gat=* sam=*] sky=$+(* (unit))]
27− ^- toon
28− ?. &(?=(^ gat) ?=(^ +.gat))
29− [%2 ~]
30− (mock [[-.gat [sam +>.gat]] -.gat] sky)
31− ::
32−
33−Examples
34−--------
35−
36− ~zod/try=> (mong [|=(@ 20) ~] ,~)
37− [%0 p=20]
38− ~zod/try=> (mong [|=(@ !!) ~] ,~)
39− [%2 p=~]
40− ~zod/try=> (mong [|=(a=@ (add 20 a)) ~] ,~)
41− [%0 p=20]
42− ~zod/try=> (mong [|=(a=[@ @] (add 20 -.a)) ~] ,~)
43− [%2 p=~]
44− ~zod/try=> (mong [|=(a=[@ @] (add 20 -.a)) [4 6]] ,~)
45− [%0 p=24]
46− ~zod/try=> (mong [|=(a=@ .^(a)) ~] ,~)
47− [%1 p=~[0]]
48− ~zod/try=> (mong [|=(a=@ .^(a)) ~] ,[~ %42])
49− [%0 p=42]
50− ~zod/try=> (mong [|=(a=@ .^(a)) ~] |=(a=* [~ a 6]))
51− [%0 p=[0 6]]
52− ~zod/try=> (mong [|=(a=@ .^(a)) 8] |=(a=* [~ a 6]))
53− [%0 p=[8 6]]
54−
55−
docs/system/hoon/library/gate/mook.mddeleted−82
@@ -1,82 +0,0 @@
1−### `++mook`
2−
3−Intelligently render crash annotation
4−
5−Converts a `%2` `++tone` nock stack trace to a list of [`++tank`]().
6−Each may be a tank, cord, [`++spot`](), or trapped tank.
7−
8−Accepts
9−-------
10−
11−`ton` is a [`++tone`]().
12−
13−Produces
14−--------
15−
16−A [`++toon`]().
17−
18−Source
19−------
20−
21− ++ mook
22− |= ton=tone
23− ^- toon
24− ?. ?=([2 *] ton) ton
25− :- %2
26− =+ yel=(lent p.ton)
27− =. p.ton
28− ?. (gth yel 256) p.ton
29− %+ weld
30− (scag 128 p.ton)
31− ^- (list ,[@ta *])
32− :_ (slag (sub yel 128) p.ton)
33− :- %lose
34− %+ rap 3
35− ;: weld
36− "[skipped "
37− ~(rend co %$ %ud (sub yel 256))
38− " frames]"
39− ==
40− |- ^- (list tank)
41− ?~ p.ton ~
42− =+ rex=$(p.ton t.p.ton)
43− ?+ -.i.p.ton rex
44− %hunk [(tank +.i.p.ton) rex]
45− %lose [[%leaf (rip 3 (,@ +.i.p.ton))] rex]
46− %mean :_ rex
47− ?@ +.i.p.ton [%leaf (rip 3 (,@ +.i.p.ton))]
48− =+ mac=(mack +.i.p.ton +<.i.p.ton)
49− ?~(mac [%leaf "####"] (tank u.mac))
50− %spot :_ rex
51− =+ sot=(spot +.i.p.ton)
52− :- %leaf
53− ;: weld
54− ~(ram re (smyt p.sot))
55− ":<["
56− ~(rend co ~ %ud p.p.q.sot)
57− " "
58− ~(rend co ~ %ud q.p.q.sot)
59− "].["
60− ~(rend co ~ %ud p.q.q.sot)
61− " "
62− ~(rend co ~ %ud q.q.q.sot)
63− "]>"
64− ==
65− ==
66− ::
67−
68−Examples
69−--------
70−
71− ~zod/try=> (mook [%0 5 4 5 1])
72− [%0 p=[5 4 5 1]]
73− ~zod/try=> (mook [%2 ~[[%hunk %rose ["<" "," ">"] ~[[%leaf "err"]]]]])
74− [%2 p=~[[%rose p=[p="<" q="," r=">"] q=[i=[%leaf p="err"] t=~]]]]
75− ~zod/try=> (mook [%2 ~[[%malformed %elem] [%lose 'do print']]])
76− [%2 p=~[[%leaf p="do print"]]]
77− ~zod/try=> (mook [%2 ~[[%mean |.(>(add 5 6)<)]]])
78− [%2 p=~[[%leaf p="11"]]]
79− ~zod/try=> (mook [%2 ~[[%spot /b/repl [1 1]^[1 2]] [%mean |.(!!)]]])
80− [%2 p=~[[%leaf p="/b/repl/:<[1 1].[1 2]>"] [%leaf p="####"]]]
81−
82−
docs/system/hoon/library/gate/moon.mddeleted−40
@@ -1,40 +0,0 @@
1−### `++moon`
2−
3−Mime type to `++cord`
4−
5−Renders a [mime](http://en.wikipedia.org/wiki/MIME) type path with infix
6−`/` to a [`++cord`]().
7−Accepts
8−-------
9−
10−`myn` is a ++[`mite`](), a [`++list`]() of [`@ta`]().
11−
12−Produces
13−--------
14−
15−A `++cord`.
16−
17−Source
18−------
19−
20− ++ moon :: mime type to text
21− |= myn=mite
22− %+ rap
23− 3
24− |- ^- tape
25− ?~ myn ~
26− ?: =(~ t.myn) (trip i.myn)
27− (weld (trip i.myn) `tape`['/' $(myn t.myn)])
28− ::
29−
30−Examples
31−--------
32−
33− ~zod/try=> `@t`(moon /image/png)
34− 'image/png'
35− ~zod/try=> `@t`(moon /text/x-hoon)
36− 'text/x-hoon'
37− ~zod/try=> `@t`(moon /application/x-pnacl)
38− 'application/x-pnacl'
39−
40−
docs/system/hoon/library/gate/more.mddeleted−36
@@ -1,36 +0,0 @@
1−### `++more`
2−
3−Parse list with delimiter
4−
5−Parser modifier: Parse a list of matches using a delimiter [`++rule`]().
6−
7−Accepts
8−-------
9−
10−`bus` is a `++rule`.
11−
12−`fel` is a `++rule`.
13−
14−Produces
15−--------
16−
17−A `++rule`.
18−
19−Source
20−------
21−
22− ++ more
23− |* [bus=_rule fel=_rule]
24− ;~(pose (most bus fel) (easy ~))
25−
26−Examples
27−--------
28−
29− ~zod/try=> (scan "" (more ace dem))
30− ~
31− ~zod/try=> (scan "40 20" (more ace dem))
32− [q=40 ~[q=20]]
33− ~zod/try=> (scan "40 20 60 1 5" (more ace dem))
34− [q=40 ~[q=20 q=60 q=1 q=5]]
35−
36−
docs/system/hoon/library/gate/most.mddeleted−37
@@ -1,37 +0,0 @@
1−### `++most`
2−
3−Parse list of at least one match
4−
5−Parser modifier: parse a [`++list`]() of at least one match using a delimiter [`++rule`]().
6−
7−Accepts
8−-------
9−
10−`bus` is a `++rule`.
11−
12−`fel` is a `++rule`.
13−
14−Produces
15−--------
16−
17−A `++rule`.
18−
19−Source
20−------
21−
22− ++ most
23− |* [bus=_rule fel=_rule]
24− ;~(plug fel (star ;~(pfix bus fel)))
25−
26−Examples
27−--------
28−
29− ~zod/try=> (scan "40 20" (most ace dem))
30− [q=40 ~[q=20]]
31− ~zod/try=> (scan "40 20 60 1 5" (most ace dem))
32− [q=40 ~[q=20 q=60 q=1 q=5]]
33− ~zod/try=> (scan "" (most ace dem))
34− ! {1 1}
35− ! exit
36−
37−
docs/system/hoon/library/gate/mug.mddeleted−54
@@ -1,54 +0,0 @@
1−### `++mug`
2−
3−Hashes `a` with the 31-bit nonzero FNV-1a non-cryptographic hash
4−algorithm, producing an [atom]().
5−
6−Accepts
7−-------
8−
9−A is a [noun]().
10−
11−Produces
12−--------
13−
14−An atom.
15−
16−Source
17−------
18−
19− ++ mug :: 31bit nonzero FNV1a
20− ~/ %mug
21− |= a=*
22− ?^ a
23− =+ b=[p=$(a -.a) q=$(a +.a)]
24− |- ^- @
25− =+ c=(fnv (mix p.b (fnv q.b)))
26− =+ d=(mix (rsh 0 31 c) (end 0 31 c))
27− ?. =(0 c) c
28− $(q.b +(q.b))
29− =+ b=2.166.136.261
30− |- ^- @
31− =+ c=b
32− =+ [d=0 e=(met 3 a)]
33− |- ^- @
34− ?: =(d e)
35− =+ f=(mix (rsh 0 31 c) (end 0 31 c))
36− ?. =(0 f) f
37− ^$(b +(b))
38− $(c (fnv (mix c (cut 3 [d 1] a))), d +(d))
39−
40−Examples
41−--------
42−
43− ~zod/try=> (mug 10.000)
44− 178.152.889
45− ~zod/try=> (mug 10.001)
46− 714.838.017
47− ~zod/try=> (mug 1)
48− 67.918.732
49− ~zod/try=> (mug (some 10))
50− 1.872.403.737
51− ~zod/try=> (mug (limo [1 2 3 4 5 ~]))
52− 1.067.931.605
53−
54−
docs/system/hoon/library/gate/mul.mddeleted−40
@@ -1,40 +0,0 @@
1−### `++mul`
2−
3−Multiply
4−
5−Multiplies `a` by `b`.
6−
7−Accepts
8−-------
9−
10−`a` is an [atom]().
11−
12−`b` is an atom.
13−
14−Produces
15−--------
16−
17−An atom.
18−
19−Source
20−------
21−
22− ++ mul :: multiply
23− ~/ %mul
24− |= [a=@ b=@]
25− ^- @
26− =+ c=0
27− |-
28− ?: =(0 a) c
29− $(a (dec a), c (add b c))
30− ::
31−
32−Examples
33−--------
34−
35− ~zod/try=> (mul 3 4)
36− 12
37− ~zod/try=> (mul 0 1)
38− 0
39−
40−
docs/system/hoon/library/gate/mule.mddeleted−52
@@ -1,52 +0,0 @@
1−### `++mule`
2−
3−Typed virtual
4−
5−Kicks a [`++trap`](), producing its results or any errors that occur along
6−the way. Used to lazily compute stack traces.
7−
8−Accepts
9−-------
10−
11−`taq` is a [`++trap`](), generally producing a list of [`++tank`]()s.
12−
13−Produces
14−--------
15−
16−XX
17−
18−Source
19−------
20−
21− ++ mule :: typed virtual
22− ~/ %mule
23− |* taq=_|.(_*)
24− =+ mud=(mute taq)
25− ?- -.mud
26− & [%& p=$:taq]
27− | [%| p=p.mud]
28− ==
29− ::
30−
31−Examples
32−--------
33−
34− ~zod/try=> (mule |.(leaf/"hello"))
35− [%.y p=[%leaf "hello"]]
36− ~zod/try=> (mule |.(!!))
37− [%.n p=~]
38− ~zod/try=> (mule |.(.^(a//=pals/1)))
39− [ %.n
40− p
41− ~[
42− [ %rose
43− p=[p="/" q="/" r="/"]
44− q
45− [ i=[%leaf p="a"]
46− t=[i=[%leaf p="~zod"] t=[i=[%leaf p="pals"] t=[i=[%leaf p="1"] t=~]]]
47− ]
48− ]
49− ]
50− ]
51−
52−
docs/system/hoon/library/gate/mum.mddeleted−69
@@ -1,69 +0,0 @@
1−### `++mum`
2−
3−XX document
4−
5−Accepts
6−-------
7−
8−Produces
9−--------
10−
11−Source
12−------
13−
14− ++ mum :: mug with murmur3
15− ~/ %mum
16− |= a=*
17− |^ (trim ?@(a a (mix $(a -.a) (mix 0x7fff.ffff $(a +.a)))))
18− ++ spec :: standard murmur3
19− |= [syd=@ key=@]
20− ?> (lte (met 5 syd) 1)
21− =+ ^= row
22− |= [a=@ b=@]
23− (con (end 5 1 (lsh 0 a b)) (rsh 0 (sub 32 a) b))
24− =+ mow=|=([a=@ b=@] (end 5 1 (mul a b)))
25− =+ len=(met 5 key)
26− =- =. goc (mix goc len)
27− =. goc (mix goc (rsh 4 1 goc))
28− =. goc (mow goc 0x85eb.ca6b)
29− =. goc (mix goc (rsh 0 13 goc))
30− =. goc (mow goc 0xc2b2.ae35)
31− (mix goc (rsh 4 1 goc))
32− ^= goc
33− =+ [inx=0 goc=syd]
34− |- ^- @
35− ?: =(inx len) goc
36− =+ kop=(cut 5 [inx 1] key)
37− =. kop (mow kop 0xcc9e.2d51)
38− =. kop (row 15 kop)
39− =. kop (mow kop 0x1b87.3593)
40− =. goc (mix kop goc)
41− =. goc (row 13 goc)
42− =. goc (end 5 1 (add 0xe654.6b64 (mul 5 goc)))
43− $(inx +(inx))
44− ::
45− ++ trim :: 31-bit nonzero
46− |= key=@
47− =+ syd=0xcafe.babe
48− |- ^- @
49− =+ haz=(spec syd key)
50− =+ ham=(mix (rsh 0 31 haz) (end 0 31 haz))
51− ?.(=(0 ham) ham $(syd +(syd)))
52− --
53− ::
54−
55−Examples
56−--------
57−
58− ~zod/try=> (mum 10.000)
59− 1.232.632.901
60− ~zod/try=> (mum 10.001)
61− 658.093.079
62− ~zod/try=> (mum 1)
63− 818.387.364
64− ~zod/try=> (mum (some 10))
65− 1.177.215.703
66− ~zod/try=> (mum ~[1 2 3 4 5])
67− 1.517.902.092
68−
69−
docs/system/hoon/library/gate/mung.mddeleted−55
@@ -1,55 +0,0 @@
1−### `++mung`
2−
3−Virtualize slamming gate
4−
5−Produces a [`++tone`]() computation result from slamming `gat` with
6−`sam`, using `sky` to compute or block on nock 11 when applicable.
7−
8−Accepts
9−-------
10−
11−`gat` is a [noun]() that is generally a [`gate`]().
12−
13−`sam` is a [`sample`]() noun.
14−
15−`sky` is an [%iron]() gate invoked with [nock operator 11]().
16−
17−Produces
18−--------
19−
20−A `++tone`.
21−
22−Source
23−------
24−
25− ++ mung
26− |= [[gat=* sam=*] sky=$+(* (unit))]
27− ^- tone
28− ?. &(?=(^ gat) ?=(^ +.gat))
29− [%2 ~]
30− (mink [[-.gat [sam +>.gat]] -.gat] sky)
31− ::
32−
33−Examples
34−--------
35−
36− ~zod/try=> (mung [|=(@ 20) ~] ,~)
37− [%0 p=20]
38− ~zod/try=> (mung [|=(@ !!) ~] ,~)
39− [%2 p=~]
40− ~zod/try=> (mung [|=(a=@ (add 20 a)) ~] ,~)
41− [%0 p=20]
42− ~zod/try=> (mung [|=(a=[@ @] (add 20 -.a)) ~] ,~)
43− [%2 p=~]
44− ~zod/try=> (mung [|=(a=[@ @] (add 20 -.a)) [4 6]] ,~)
45− [%0 p=24]
46− ~zod/try=> (mung [|=(a=@ .^(a)) ~] ,~)
47− [%1 p=~[0]]
48− ~zod/try=> (mung [|=(a=@ .^(a)) ~] ,[~ %42])
49− [%0 p=42]
50− ~zod/try=> (mung [|=(a=@ .^(a)) ~] |=(a=* [~ a 6]))
51− [%0 p=[0 6]]
52− ~zod/try=> (mung [|=(a=@ .^(a)) 8] |=(a=* [~ a 6]))
53− [%0 p=[8 6]]
54−
55−
docs/system/hoon/library/gate/murn.mddeleted−40
@@ -1,40 +0,0 @@
1−### `++murn`
2−
3−Maybe transform
4−
5−Passes each member of [`++list`]() `a` to [gate]() `b`, which must produce a
6−[`++unit`](). Produces a new list with all the results that do not produce
7−`~`.
8−
9−Accepts
10−-------
11−
12−`a` is a [list]().
13−
14−`b` is a [gate]() that produces a [unit]().
15−
16−Produces
17−--------
18−
19−A unit.
20−
21−Source
22−------
23−
24− ++ murn :: maybe transform
25− |* [a=(list) b=$+(* (unit))]
26− |-
27− ?~ a ~
28− =+ c=(b i.a)
29− ?~ c
30− $(a t.a)
31− [i=u.c t=$(a t.a)]
32−
33−Examples
34−--------
35−
36− ~zod/try=> =a |=(a=@ ?.((gte a 2) ~ (some (add a 10))))
37− ~zod/try=> (murn (limo [0 1 2 3 ~]) a)
38− [i=12 t=[i=13 t=~]]
39−
40−
docs/system/hoon/library/gate/mute.mddeleted−50
@@ -1,50 +0,0 @@
1−### `++mute`
2−
3−Untyped virtual
4−
5−Kicks a `++trap`, producing its result as a noun or the tanks of any
6−error that occurs. Similar to [`++mule`](), but preserves no type
7−information.
8−
9−Accepts
10−-------
11−
12−`taq` is a [`++trap`](/doc/hoon/library/1#++trap).
13−
14−Produces
15−--------
16−
17−Either a noun or a [`++list`]() of [`++tank`]().
18−
19−Source
20−------
21−
22− ++ mute :: untyped virtual
23− |= taq=_^?(|.(_*))
24− ^- (each ,* (list tank))
25− =+ ton=(mock [taq 9 2 0 1] |=(* ~))
26− ?- -.ton
27− %0 [%& p.ton]
28− %1 [%| (turn p.ton |=(a=* (smyt (path a))))]
29− %2 [%| p.ton]
30− ==
31−
32−Examples
33−--------
34−
35− ~zod/try=> (mute |.(leaf/"hello"))
36− [%.y p=[1.717.658.988 104 101 108 108 111 0]]
37− ~zod/try=> (mute |.(!!))
38− [%.n p=~]
39− ~zod/try=> (mute |.(.^(a//=pals/1)))
40− [ %.n
41− p
42− ~[
43− [ %rose
44− p=[p="/" q="/" r="/"]
45− q=[i=[%leaf p="a"] t=[i=[%leaf p="~zod"] t=[i=[%leaf p="pals"] t=[i=[%leaf p="1"] t=~]]]]
46− ]
47− ]
48− ]
49−
50−
docs/system/hoon/library/gate/need.mddeleted−38
@@ -1,38 +0,0 @@
1−### `++need`
2−
3−Unwrap unit
4−
5−Retrieve the value from a [`++unit`]() and crash if the unit is null.
6−
7−Accepts
8−-------
9−
10−`a` is a unit.
11−
12−Produces
13−--------
14−
15−Either the unwrapped value of `a` (`u.a`), or crash.
16−
17−Source
18−------
19−
20− ++ need :: demand
21− |* a=(unit)
22− ?~ a !!
23− u.a
24−
25−Examples
26−--------
27−
28− ~zod/try=> =a ((unit ,[@t @t]) [~ ['a' 'b']])
29− ~zod/try=> (need a)
30− ['a' 'b']
31− ~zod/try=> =a ((unit ,@ud) [~ 17])
32− ~zod/try=> (need a)
33− 17
34− ~zod/try=> =a ((unit ,@) [~])
35− ~zod/try=> (need a)
36− ! exit
37−
38−
docs/system/hoon/library/gate/next.mddeleted−37
@@ -1,37 +0,0 @@
1−### `++next`
2−
3−Consume char
4−
5−Consume any character, producing it as a result.
6−
7−Accepts
8−-------
9−
10−`tub` is a [`++nail`]()
11−
12−Produces
13−--------
14−
15−An [`++edge`]().
16−
17−Source
18−------
19−
20− ++ next :: consume a char
21− |= tub=nail
22− ^- (like char)
23− ?~ q.tub
24− (fail tub)
25− =+ zac=(lust i.q.tub p.tub)
26− [zac [~ i.q.tub [zac t.q.tub]]]
27− ::
28−
29−Examples
30−--------
31−
32− ~zod/try=> (next [[1 1] "ebc"])
33− [p=[p=1 q=2] q=[~ [p=~~e q=[p=[p=1 q=2] q="bc"]]]]
34− ~zod/try=> (next [[1 1] "john jumps jones"])
35− [p=[p=1 q=2] q=[~ [p=~~j q=[p=[p=1 q=2] q="ohn jumps jones"]]]]
36−
37−
docs/system/hoon/library/gate/nix.mddeleted−20
@@ -1,20 +0,0 @@
1−### `++nix`
2−
3−Letters and `-`
4−
5−Parse Letters and `-`.
6−
7−Source
8−------
9−
10− ++ nix (boss 256 (star ;~(pose aln cab))) ::
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "as_me" nix)
16− q=435.626.668.897
17− ~zod/try=> `@t`(scan "as_me" nix)
18− 'as_me'
19−
20−
docs/system/hoon/library/gate/not.mddeleted−44
@@ -1,44 +0,0 @@
1−### `++not`
2−
3−Binary NOT
4−
5−Computes the bit-wise logical NOT of the bottom `b` blocks of size `a`
6−of `c`.
7−
8−Accepts
9−-------
10−
11−`a` is a block size (see [`++bloq`]()).
12−
13−`b` is an [atom]().
14−
15−`c` is an atom.
16−
17−Produces
18−--------
19−
20−An atom.
21−
22−Source
23−------
24−
25− ++ not |= [a=bloq b=@ c=@] :: binary not (sized)
26− (mix c (dec (bex (mul b (bex a)))))
27−
28−Examples
29−--------
30−
31− ~zod/try=> `@ub`24
32− 0b1.1000
33− ~zod/try=> (not 0 5 24)
34− 7
35− ~zod/try=> `@ub`7
36− 0b111
37− ~zod/try=> (not 2 5 24)
38− 1.048.551
39− ~zod/try=> (not 2 5 1.048.551)
40− 24
41− ~zod/try=> (not 1 1 (not 1 1 10))
42− 10
43−
44−
docs/system/hoon/library/gate/nud.mddeleted−24
@@ -1,24 +0,0 @@
1−
2−### `++nud`
3−
4−Numeric
5−
6−Parse a numeric character - A number.
7−
8−Source
9−------
10−
11− ++ nud (shim '0' '9') :: numeric
12−
13−Examples
14−--------
15−
16− ~zod/try=> (scan "0" nud)
17− ~~0
18− ~zod/try=> (scan "7" nud)
19− ~~7
20− ~zod/try=> (nud [[1 1] "1"])
21− [p=[p=1 q=2] q=[~ [p=~~1 q=[p=[p=1 q=2] q=""]]]]
22− ~zod/try=> (scan "0123456789" (star nud))
23− "0123456789"
24−
docs/system/hoon/library/gate/pam.mddeleted−24
@@ -1,24 +0,0 @@
1−### `++pam`
2−
3−Parse ampersand
4−
5−Parses ASCII character 38, the ampersand.
6−
7−Source
8−------
9−
10− ++ pam (just '&')
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "&" pam)
16− ~~~26.
17− ~zod/try=> `cord`(scan "&" pam)
18− '&'
19− ~zod/try=> (pam [[1 1] "&"])
20− [p=[p=1 q=2] q=[~ [p=~~~26. q=[p=[p=1 q=2] q=""]]]]
21− ~zod/try=> (pam [[1 1] "?&"])
22− [p=[p=1 q=1] q=~]
23−
24−
docs/system/hoon/library/gate/pat.mddeleted−24
@@ -1,24 +0,0 @@
1−### `++pat`
2−
3−Parse "at" sign
4−
5−Parses ASCII character 64, the "at" sign.
6−
7−Source
8−------
9−
10− ++ pat (just '@')
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "@" pat)
16− ~~~4.
17− ~zod/try=> `cord`(scan "@" pat)
18− '@'
19− ~zod/try=> (pat [[1 1] "@"])
20− [p=[p=1 q=2] q=[~ [p=~~~4. q=[p=[p=1 q=2] q=""]]]]
21− ~zod/try=> (pat [[1 1] "?@"])
22− [p=[p=1 q=1] q=~]
23−
24−
docs/system/hoon/library/gate/peg.mddeleted−44
@@ -1,44 +0,0 @@
1−### `++peg`
2−
3−Axis within axis
4−
5−Computes the axis of `b` within axis `a`.
6−
7−Accepts
8−-------
9−
10−`a` is an [atom]().
11−
12−`b` is an atom.
13−
14−Produces
15−--------
16−
17−An atom.
18−
19−Source
20−------
21−
22− ++ peg :: tree connect
23− ~/ %peg
24− |= [a=@ b=@]
25− ^- @
26− ?- b
27− 1 a
28− 2 (mul a 2)
29− 3 +((mul a 2))
30− * (add (mod b 2) (mul $(b (div b 2)) 2))
31− ==
32− ::
33−
34−Examples
35−--------
36−
37− ~zod/try=> (peg 4 1)
38− 4
39− ~zod/try=> (peg 4 2)
40− 8
41− ~zod/try=> (peg 8 45)
42− 269
43−
44−
docs/system/hoon/library/gate/pel.mddeleted−24
@@ -1,24 +0,0 @@
1−### `++pel`
2−
3−Parse left parenthesis
4−
5−Parses ASCII character 40, the left parenthesis.
6−
7−Source
8−------
9−
10− ++ pel (just '(')
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "(" pel)
16− ~~~28.
17− ~zod/try=> `cord`(scan "(" pel)
18− '('
19− ~zod/try=> (pel [[1 1] "("])
20− [p=[p=1 q=2] q=[~ [p=~~~28. q=[p=[p=1 q=2] q=""]]]]
21− ~zod/try=> (pel [[1 1] ";("])
22− [p=[p=1 q=1] q=~]
23−
24−
docs/system/hoon/library/gate/per.mddeleted−24
@@ -1,24 +0,0 @@
1−### `++per`
2−
3−Parse right parenthesis
4−
5−Parses ASCII character 41, the right parenthesis.
6−
7−Source
8−------
9−
10− ++ per (just ')')
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan ")" per)
16− ~~~29.
17− ~zod/try=> `cord`(scan ")" per)
18− ')'
19− ~zod/try=> (per [[1 1] ")"])
20− [p=[p=1 q=2] q=[~ [p=~~~29. q=[p=[p=1 q=2] q=""]]]]
21− ~zod/try=> (per [[1 1] " )"])
22− [p=[p=1 q=1] q=~]
23−
24−
docs/system/hoon/library/gate/perk.mddeleted−49
@@ -1,49 +0,0 @@
1−### `++perk`
2−
3−Parse cube with fork
4−
5−Parser generator. Produces a parser that succeeds upon encountering one
6−of the [`++term`]()s in a faceless list `a`.
7−
8−A perk is an arm used to parse one of a finite set of options, formally
9−a choice between [`++term`]()s: if you want to match "true" or "false", and
10−nothing else, (perk \~[%true %false]) produces the relevant parser,
11−whose result type is `?(%true %false)`. For more complicated
12−transformations, a combintation of ++[`++sear`]() and map ++[`++get`]() is recommended,
13−e.g. `(sear ~(get by (mo ~[[%true &] [%false |]]))) sym)` will have a
14−similar effect but produce `?(& |)` , a [boolean](). However, constructions
15−such as `(sear (flit ~(has in (sa %true %false %other ~))) sym)` are
16−needlessly unwieldy.
17−
18−Accepts
19−-------
20−
21−`a` is a [`++pole`](), which is a [`++list`]() without [`%face`]()s.
22−
23−Produces
24−--------
25−
26−XX
27−
28−Source
29−------
30−
31− ++ perk :: parse cube with fork
32− |* a=(pole ,@tas)
33− ?~ a fail
34− ;~ pose
35− (cold -.a (jest -.a))
36− $(a +.a)
37− ==
38− ::
39−
40−Examples
41−--------
42−
43− ~zod/try=> (scan "ham" (perk %sam %ham %lam ~))
44− %ham
45− ~zod/try=> (scan "ram" (perk %sam %ham %lam ~))
46− ! {1 1}
47− ! exit
48−
49−
docs/system/hoon/library/gate/pfix.mddeleted−34
@@ -1,34 +0,0 @@
1−### `++pfix`
2−
3−Discard first rule
4−
5−Parsing composer: connects an [`++edge`]() `vex` with two subsequent [`++rule`]()s,
6−ignoring the result of the first and producing the result of the second.
7−
8−Accepts
9−-------
10−
11−`vex` is an [edge]().
12−
13−Produces
14−--------
15−
16−
17−
18−Source
19−------
20−
21− ++ pfix :: discard first rule
22− ~/ %pfix
23− (comp |*([a=* b=*] b))
24− ::
25−
26−Examples
27−--------
28−
29− ~zod/try=> `@t`(scan "%him" ;~(pfix cen sym))
30− 'him'
31− ~zod/try=> (scan "+++10" ;~(pfix (star lus) dem))
32− q=10
33−
34−
docs/system/hoon/library/gate/plug.mddeleted−46
@@ -1,46 +0,0 @@
1−### `++plug`
2−
3−Parse to tuple
4−
5−Parsing composer: connects an [`++edge`]() `vex` with a following [`++rule`]() `sab`, producing
6−a cell of both the results. See also: the monad applicator [;\~]() for a
7−more detailed explanation.
8−
9−Accepts
10−-------
11−
12−`sab` is a `++rule`.
13−
14−`vex` is an `++edge`.
15−
16−Produces
17−--------
18−
19−
20−
21−Source
22−------
23−
24− ++ plug :: first then second
25− ~/ %plug
26− |* [vex=edge sab=_rule]
27− ?~ q.vex
28− vex
29− =+ yit=(sab q.u.q.vex)
30− =+ yur=(last p.vex p.yit)
31− ?~ q.yit
32− [p=yur q=q.yit]
33− [p=yur q=[~ u=[p=[p.u.q.vex p.u.q.yit] q=q.u.q.yit]]]
34− ::
35−
36−Examples
37−--------
38−
39− ~zod/try=> (scan "1..20" ;~(plug dem dot dot dem))
40− [q=1 ~~~. ~~~. q=20]
41− ~zod/try=> (scan "moke/~2014.1.1" ;~(plug sym fas nuck:so))
42− [1.701.539.693 ~~~2f. [% p=[p=~.da q=170.141.184.500.766.106.671.844.917.172.921.958.400]]]
43− ~zod/try=> ;;(,[@tas @t ~ %da @da] (scan "moke/~2014.1.1" ;~(plug sym fas nuck:so)))
44− [%moke '/' ~ %da ~2014.1.1]
45−
46−
docs/system/hoon/library/gate/plus.mddeleted−35
@@ -1,35 +0,0 @@
1−
2−### `++plus`
3−
4−List of at least one match.
5−
6−Parser modifier: parse [`++list`]() of at least one match.
7−
8−Accepts
9−-------
10−
11−`fel` is a [`++rule`]().
12−
13−Produces
14−--------
15−
16−A `++rule`.
17−
18−Source
19−------
20−
21− ++ plus |*(fel=_rule ;~(plug fel (star fel)))
22−
23−Examples
24−--------
25−
26− ~zod/try=> (scan ">>>>" (cook lent (plus gar)))
27− 4
28− ~zod/try=> (scan "- - " (plus ;~(pose ace hep)))
29− [~~- " - "]
30− ~zod/try=> `tape`(scan "- - " (plus ;~(pose ace hep)))
31− "- - "
32− ~zod/try=> `(pole ,@t)`(scan "- - " (plus ;~(pose ace hep)))
33− ['-' [' ' [' ' ['-' [' ' ~]]]]]
34−
35−
docs/system/hoon/library/gate/pojo.mddeleted−78
@@ -1,78 +0,0 @@
1−### `++pojo`
2−
3−Print JSON
4−
5−Renders a [`++json`]() `val` as a [`++tape`]().
6−
7−Accepts
8−-------
9−
10−`val` is a [`json`]().
11−
12−Produces
13−--------
14−
15−A `++tape`.
16−
17−Source
18−------
19−
20− ++ pojo :: print json
21− |= val=json
22− ^- tape
23− ?~ val "null"
24− ?- -.val
25− %a
26− ;: weld
27− "["
28− =| rez=tape
29− |- ^+ rez
30− ?~ p.val rez
31− $(p.val t.p.val, rez :(weld rez ^$(val i.p.val) ?~(t.p.val ~ ",")))
32− "]"
33− ==
34− ::
35− %b ?:(p.val "true" "false")
36− %n (trip p.val)
37− %s
38− ;: welp
39− "\""
40− %+ reel
41− (turn (trip p.val) jesc)
42− |=([p=tape q=tape] (welp +<))
43− "\""
44− ==
45− %o
46− ;: welp
47− "\{"
48− =+ viz=(~(tap by p.val) ~)
49− =| rez=tape
50− |- ^+ rez
51− ?~ viz rez
52− %= $
53− viz t.viz
54− rez
55− :(welp rez "\"" (trip p.i.viz) "\":" ^$(val q.i.viz) ?~(t.viz ~ ","))
56− ==
57− "}"
58− ==
59− ==
60− ::
61−
62−Examples
63−--------
64−
65− ~zod/try=> (pojo [%n '12.6'])
66− "12.6"
67− ~zod/try=> (crip (pojo %n '12.6'))
68− '12.6'
69− ~zod/try=> (crip (pojo %s 'samtel'))
70− '"samtel"'
71− ~zod/try=> (crip (pojo %a ~[(jone 12) (jape "ha")]))
72− '[12,"ha"]'
73− ~zod/try=> (crip (pojo %a ~[(jone 12) ~ (jape "ha")]))
74− '[12,null,"ha"]'
75− ~zod/try=> (crip (pojo %o (mo sale/(jone 12) same/b/| ~)))
76− '{"same":false,"sale":12}'
77−
78−
docs/system/hoon/library/gate/pose.mddeleted−44
@@ -1,44 +0,0 @@
1−### `++pose`
2−
3−Parse options
4−
5−Parsing composer: if `vex` reflects a failure, connect it with the
6−following rule `sab`. See also: the monad applicator [;\~]()
7−
8−Accepts
9−-------
10−
11−`sab` is a [`++rule`]().
12−
13−`vex` is an [`++edge`]().
14−
15−Produces
16−--------
17−
18−
19−
20−Source
21−------
22−
23− ++ pose :: first or second
24− ~/ %pose
25− |* [vex=edge sab=_rule]
26− ?~ q.vex
27− =+ roq=(sab)
28− [p=(last p.vex p.roq) q=q.roq]
29− vex
30−
31−Examples
32−--------
33−
34− ~zod/try=> `@t`(scan "+" ;~(pose lus tar cen))
35− '+'
36− ~zod/try=> `@t`(scan "*" ;~(pose lus tar cen))
37− '*'
38− ~zod/try=> `@t`(scan "%" ;~(pose lus tar cen))
39− '%'
40− ~zod/try=> `@t`(scan "-" ;~(pose lus tar cen))
41− ! {1 1}
42− ! exit
43−
44−
docs/system/hoon/library/gate/prn.mddeleted−23
@@ -1,23 +0,0 @@
1−### `++prn`
2−
3−Printable character
4−
5−Parse any printable character.
6−
7−Source
8−------
9−
10− ++ prn ;~(less (just `@`127) (shim 32 256))
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "h" prn)
16− ~~h
17− ~zod/try=> (scan "!" prn)
18− ~~~21.
19− ~zod/try=> (scan "\01" prn)
20− ! {1 1}
21− ! exit
22−
23−
docs/system/hoon/library/gate/qat.mddeleted−35
@@ -1,35 +0,0 @@
1−### `++qit`
2−
3−Chars in cord
4−
5−Parse an individual character to its cord atom representation.
6−
7−Source
8−------
9−
10− ++ qit ;~ pose :: chars in a cord
11− ;~(less bas soq prn)
12− ;~(pfix bas ;~(pose bas soq mes)) :: escape chars
13− ==
14−
15−Examples
16−--------
17−
18− ~zod/try=> (scan "%" qit)
19− 37
20− ~zod/try=> `@t`(scan "%" qit)
21− '%'
22− ~zod/try=> (scan "0" qit)
23− 48
24− ~zod/try=> (scan "E" qit)
25− 69
26− ~zod/try=> (scan "a" qit)
27− 97
28− ~zod/try=> (scan "\\0a" qit)
29− 10
30− ~zod/try=> `@ux`(scan "\\0a" qit)
31− 0xa
32− ~zod/try=> (scan "cord" (star qit))
33− ~[99 111 114 100]
34−
35−
docs/system/hoon/library/gate/qit.mddeleted−36
@@ -1,36 +0,0 @@
1−### `++qit`
2−
3−Chars in cord
4−
5−Parse an individual character to its cord atom representation.
6−
7−Source
8−------
9−
10− ++ qit ;~ pose :: chars in a cord
11− ;~(less bas soq prn)
12− ;~(pfix bas ;~(pose bas soq mes)) :: escape chars
13− ==
14−
15−Examples
16−--------
17−
18− ~zod/try=> (scan "%" qit)
19− 37
20− ~zod/try=> `@t`(scan "%" qit)
21− '%'
22− ~zod/try=> (scan "0" qit)
23− 48
24− ~zod/try=> (scan "E" qit)
25− 69
26− ~zod/try=> (scan "a" qit)
27− 97
28− ~zod/try=> (scan "\\0a" qit)
29− 10
30− ~zod/try=> `@ux`(scan "\\0a" qit)
31− 0xa
32− ~zod/try=> (scan "cord" (star qit))
33− ~[99 111 114 100]
34−
35−
36−
docs/system/hoon/library/gate/qu.mddeleted−37
@@ -1,37 +0,0 @@
1−### `++qu`
2−
3−Queue from list
4−
5−Produces a queue from list `a`.
6−
7−Accepts
8−-------
9−
10−`a` is a [list]().
11−
12−Produces
13−--------
14−
15−A [`++que`]().
16−
17−Source
18−------
19−
20− ++ qu :: queue from list
21− |* a=(list)
22− => .(a `_(homo a)`a)
23− =+ b=*(qeu ,_?>(?=(^ a) i.a))
24− (~(gas to b) a)
25−
26−
27−Examples
28−--------
29−
30− ~zod/try=> (qu `(list ,@ud)`~[1 2 3 5])
31− {5 3 2 1}
32− ~zod/try=> (qu "sada")
33− {'a' 'd' 'a' 's'}
34− ~zod/try=> ~(top to (qu "sada"))
35− [~ 's']
36−
37−
docs/system/hoon/library/gate/qut.mddeleted−38
@@ -1,38 +0,0 @@
1−### `++qut`
2−
3−Cord
4−
5−Parse single-soq cord with `\{gap}/` anywhere in the middle, or triple-single
6−quote (aka triple-soq) cord, between which must be in an indented block.
7−
8−Source
9−------
10−
11− ++ qut ;~ pose :: cord
12− ;~ less soqs
13− (ifix [soq soq] (boss 256 (more gon qit)))
14− ==
15− %- inde %+ ifix
16− :- ;~ plug soqs
17− ;~(pose ;~(plug (plus ace) vul) (just '\0a'))
18− ==
19− ;~(plug (just '\0a') soqs)
20− (boss 256 (star qat))
21− ==
22− ::
23−
24−Examples
25−--------
26−
27− ~zod/try=> (scan "'cord'" qut)
28− q=1.685.221.219
29− ~zod/try=> 'cord'
30− 'cord'
31− ~zod/try=> `@ud`'cord'
32− 1.685.221.219
33− /~zod/try=> '''
34− Heredoc isn't prohibited from containing quotes
35− '''
36− 'Heredoc isn't prohibited from containing quotes'
37−
38−
docs/system/hoon/library/gate/rap.mddeleted−41
@@ -1,41 +0,0 @@
1−### `++rap`
2−
3−Assemble non-zero
4−
5−Concatenates a list of [atom]()s `b` using blocksize `a`, producing an atom.
6−
7−Accepts
8−-------
9−
10−`a` is a block size (see [`++bloq`]()).
11−
12−`b` is a [`++list`]() of [atom]()s.
13−
14−Produces
15−--------
16−
17−An atom.
18−
19−Source
20−------
21−
22− ++ rap :: assemble nonzero
23− ~/ %rap
24− |= [a=bloq b=(list ,@)]
25− ^- @
26− ?~ b 0
27− (cat a i.b $(b t.b))
28−
29−Examples
30−--------
31−
32− ~zod/try=> `@ub`(rap 2 (limo [1 2 3 4 ~]))
33− 0b100.0011.0010.0001
34− ~zod/try=> `@ub`(rap 1 (limo [1 2 3 4 ~]))
35− 0b1.0011.1001
36− ~zod/try=> (rap 0 (limo [0 0 0 ~]))
37− 0
38− ~zod/try=> (rap 0 (limo [1 0 1 ~]))
39− 3
40−
41−
docs/system/hoon/library/gate/rash.mddeleted−41
@@ -1,41 +0,0 @@
1−### `++rash`
2−
3−Parse or crash
4−
5−Parse a cord with a given [`++rule`]() and crash if the [`++cord`]() isn't entirely
6−parsed.
7−
8−Accepts
9−-------
10−
11−`naf` is an atom.
12−
13−`sab` is a `++rule`.
14−
15−Produces
16−--------
17−
18−The value of the parse result, or crash.
19−
20−Source
21−------
22−
23− ++ rash |*([naf=@ sab=_rule] (scan (trip naf) sab)) ::
24−
25−Examples
26−--------
27−
28− ~zod/try=> (rash 'I was the world in which I walked, and what I saw' (star (shim 0 200)))
29− "I was the world in which I walked, and what I saw"
30− ~zod/try=> (rash 'abc' (just 'a'))
31− ! {1 2}
32− ! 'syntax-error'
33− ! exit
34− ~zod/try=> (rash 'abc' (jest 'abc'))
35− 'abc'
36− `~zod/try=> (rash 'abc' (jest 'ab'))
37− ! {1 3}
38− ! 'syntax-error'
39− ! exit
40−
41−
docs/system/hoon/library/gate/reap.mddeleted−36
@@ -1,36 +0,0 @@
1−### `++reap`
2−
3−Replicate
4−
5−Replicate: produces a [`++list`]() containing `a` copies of `b`.
6−
7−Accepts
8−-------
9−
10−`b` is a [noun]()
11−
12−Produces
13−--------
14−
15−A list.
16−
17−Source
18−------
19−
20− ++ reap :: replicate
21− |* [a=@ b=*]
22− |- ^- (list ,_b)
23− ?~ a ~
24− [b $(a (dec a))]
25−
26−Examples
27−--------
28−
29− ~zod/try=> (reap 20 %a)
30− ~[%a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a]
31− ~zod/try=> (reap 5 ~s1)
32− ~[~s1 ~s1 ~s1 ~s1 ~s1]
33− ~zod/try=> `@dr`(roll (reap 5 ~s1) add)
34− ~s5
35−
36−
docs/system/hoon/library/gate/reel.mddeleted−43
@@ -1,43 +0,0 @@
1−### `++reel`
2−
3−Right fold
4−
5−Right fold: moves right to left across a [`++list`]() `a`, recursively slamming
6−a binary [gate]() `b` with an element from `a` and an accumulator, producing
7−the final value of the accumulator.
8−
9−Accepts
10−-------
11−
12−`b` is a binary gate.
13−
14−Produces
15−--------
16−
17−The accumulator, which is a [noun]().
18−
19−Source
20−------
21−
22− ++ reel :: right fold
23− ~/ %reel
24− |* [a=(list) b=_|=([* *] +<+)]
25− |- ^+ +<+.b
26− ?~ a
27− +<+.b
28− (b i.a $(a t.a))
29−
30−Examples
31−--------
32−
33− ~zod/try=> =sum =|([p=@ q=@] |.((add p q)))
34− ~zod/try=> (reel (limo [1 2 3 4 5 ~]) sum)
35− 15
36− ~zod/try=> =a =|([p=@ q=@] |.((sub p q)))
37− ~zod/try=> (reel (limo [6 3 1 ~]) a)
38− 4
39− ~zod/try=> (reel (limo [3 6 1 ~]) a)
40− ! subtract-underflow
41− ! exit
42−
43−
docs/system/hoon/library/gate/rep.mddeleted−49
@@ -1,49 +0,0 @@
1−### `++rep`
2−
3−Assemble single
4−
5−Produces an [atom]() by assembling a list of atoms `b` using block size `a`.
6−
7−Accepts
8−-------
9−
10−`a` is a block size (see [`++bloq`]()).
11−
12−`b` is a list of atoms.
13−
14−Produces
15−--------
16−
17−An atom.
18−
19−Source
20−------
21−
22− ++ rep :: assemble single
23− ~/ %rep
24− |= [a=bloq b=(list ,@)]
25− ^- @
26− =+ c=0
27− |-
28− ?~ b 0
29− (con (lsh a c (end a 1 i.b)) $(c +(c), b t.b))
30−
31−Examples
32−--------
33−
34− ~zod/try=> `@ub`(rep 2 (limo [1 2 3 4 ~]))
35− 0b100.0011.0010.0001
36− ~zod/try=> (rep 0 (limo [0 0 1 ~]))
37− 4
38− ~zod/try=> (rep 0 (limo [0 0 0 1 ~]))
39− 8
40− ~zod/try=> (rep 0 (limo [0 1 0 0 ~]))
41− 2
42− ~zod/try=> (rep 0 (limo [0 1 0 1 ~]))
43− 10
44− ~zod/try=> (rep 0 (limo [0 1 0 1 0 1 ~]))
45− 42
46− ~zod/try=> `@ub`42
47− 0b10.1010
48−
49−
docs/system/hoon/library/gate/rip.mddeleted−49
@@ -1,49 +0,0 @@
1−### `++rip`
2−
3−Disassemble
4−
5−Produces a list of [atom]()s from the bits of `b` using block size `a`.
6−
7−Accepts
8−-------
9−
10−`a` is a block size (see [`++bloq`]()).
11−
12−`b` is an atom.
13−
14−Produces
15−--------
16−
17−A list of atoms.
18−
19−Source
20−------
21−
22− ++ rip :: disassemble
23− ~/ %rip
24− |= [a=bloq b=@]
25− ^- (list ,@)
26− ?: =(0 b) ~
27− [(end a 1 b) $(b (rsh a 1 b))]
28−
29−Examples
30−--------
31−
32− ~zod/try=> `@ub`155
33− 0b1001.1011
34− ~zod/try=> (rip 0 155)
35− ~[1 1 0 1 1 0 0 1]
36− ~zod/try=> (rip 2 155)
37− ~[11 9]
38− ~zod/try=> (rip 1 155)
39− ~[3 2 1 2]
40− ~zod/try=> `@ub`256
41− 0b1.0000.0000
42− ~zod/try=> (rip 0 256)
43− ~[0 0 0 0 0 0 0 0 1]
44− ~zod/try=> (rip 2 256)
45− ~[0 0 1]
46− ~zod/try=> (rip 3 256)
47− ~[0 1]
48−
49−
docs/system/hoon/library/gate/roll.mddeleted−43
@@ -1,43 +0,0 @@
1−### `++roll`
2−
3−Left fold
4−
5−Left fold: moves left to right across a list `a`, recursively slamming a
6−binary [gate]() `b` with an element from the [`++list`]() and an accumulator,
7−producing the final value of the accumulator.
8−
9−Accepts
10−-------
11−
12−`b` is a binary [gate]().
13−
14−Produces
15−--------
16−
17−The accumulator, which is a [noun]().
18−
19−Source
20−------
21−
22− ++ roll :: left fold
23− ~/ %roll
24− |* [a=(list) b=_|=([* *] +<+)]
25− |- ^+ +<+.b
26− ?~ a
27− +<+.b
28− $(a t.a, b b(+<+ (b i.a +<+.b)))
29−
30−Examples
31−--------
32−
33− ~zod/try=> =sum =|([p=@ q=@] |.((add p q)))
34− ~zod/try=> (roll (limo [1 2 3 4 5 ~]) sum)
35− q=15
36− ~zod/try=> =a =|([p=@ q=@] |.((sub p q)))
37− ~zod/try=> (roll (limo [6 3 1 ~]) a)
38− ! subtract-underflow
39− ! exit
40− ~zod/try=> (roll (limo [1 3 6 ~]) a)
41− q=4
42−
43−
docs/system/hoon/library/gate/rsh.mddeleted−55
@@ -1,55 +0,0 @@
1−### `++rsh`
2−
3−Right-shift
4−
5−Right-shifts `c` by `b` blocks of size `a`, producing an [atom]().
6−
7−Accepts
8−-------
9−
10−`a` is a block size (see [`++bloq`]()).
11−
12−`b` is an atom.
13−
14−`c` is an atom.
15−
16−Produces
17−--------
18−
19−An atom.
20−
21−Source
22−------
23−
24− ++ rsh :: right-shift
25− ~/ %rsh
26− |= [a=bloq b=@ c=@]
27− (div c (bex (mul (bex a) b)))
28−
29−Examples
30−--------
31−
32− ~zod/try=> `@ub`145
33− 0b1001.0001
34− ~zod/try=> `@ub`(rsh 1 1 145)
35− 0b10.0100
36− ~zod/try=> (rsh 1 1 145)
37− 36
38− ~zod/try=> `@ub`(rsh 2 1 145)
39− 0b1001
40− ~zod/try=> (rsh 2 1 145)
41− 9
42− ~zod/try=> `@ub`10
43− 0b1010
44− ~zod/try=> `@ub`(rsh 0 1 10)
45− 0b101
46− ~zod/try=> (rsh 0 1 10)
47− 5
48− ~zod/try=> `@ux`'abc'
49− 0x63.6261
50− ~zod/try=> `@t`(rsh 3 1 'abc')
51− 'bc'
52− ~zod/try=> `@ux`(rsh 3 1 'abc')
53− 0x6362
54−
55−
docs/system/hoon/library/gate/rub.mddeleted−50
@@ -1,50 +0,0 @@
1−### `++rub`
2−
3−Length-decode
4−
5−The inverse of `++mat`. Accepts a cell of index `a` and a bitstring `b`
6−and produces the cell whose tail `q` is the decoded atom at index `a`
7−and whose head is the length of the encoded atom `q`, by which the
8−offset `a` is advanced. Only used internally as a helper cue.
9−
10−Accepts
11−-------
12−
13−`a` is an atom.
14−
15−`b` is a bitstring as an atom.
16−
17−Produces
18−--------
19−
20−A cell of two atoms, `p` and `q`.
21−
22−Source
23−------
24−
25− ++ rub :: length-decode
26− ~/ %rub
27− |= [a=@ b=@]
28− ^- [p=@ q=@]
29− =+ ^= c
30− =+ [c=0 m=(met 0 b)]
31− |- ?< (gth c m)
32− ?. =(0 (cut 0 [(add a c) 1] b))
33− c
34− $(c +(c))
35− ?: =(0 c)
36− [1 0]
37− =+ d=(add a +(c))
38− =+ e=(add (bex (dec c)) (cut 0 [d (dec c)] b))
39− [(add (add c c) e) (cut 0 [(add d (dec c)) e] b)]
40−
41−
42−Examples
43−--------
44−
45− ~zod/try=> `@ub`(jam 0xaaa)
46− 0b1.0101.0101.0101.0010.0000
47− ~zod/try=> (rub 1 0b1.0101.0101.0101.0010.0000)
48− [p=20 q=2.730]
49− ~zod/try=> `@ux`q:(rub 1 0b1.0101.0101.0101.0010.0000)
50− 0xaaa
docs/system/hoon/library/gate/runt.mddeleted−38
@@ -1,38 +0,0 @@
1−### `++runt`
2−
3−Prepend `n` times
4−
5−Add `a` repetitions of character `b` to the head of [`++tape`]() `c`.
6−
7−Accepts
8−-------
9−
10−`a` and `b` are atoms.
11−
12−`c` is a `++tape`.
13−
14−Produces
15−--------
16−
17−A `++tape`.
18−
19−Source
20−------
21−
22− ++ runt :: prepend repeatedly
23− |= [[a=@ b=@] c=tape]
24− ^- tape
25− ?: =(0 a)
26− c
27− [b $(a (dec a))]
28− ::
29−
30−Examples
31−--------
32−
33− /~zod/try=> (runt [2 '/'] "ham")
34− "//ham"
35− /~zod/try=> (runt [10 'a'] "")
36− "aaaaaaaaaa"
37−
38−
docs/system/hoon/library/gate/rush.mddeleted−39
@@ -1,39 +0,0 @@
1−### `++rush`
2−
3−Parse or null
4−
5−Parse a given with a given rule and produce null if the cord isn't
6−entirely parsed.
7−
8−Accepts
9−-------
10−
11−`naf` is an [atom]().
12−
13−`sab` is a [rule]().
14−
15−Produces
16−--------
17−
18−The value of the parse result, or null.
19−
20−Source
21−------
22−
23− ++ rush |*([naf=@ sab=_rule] (rust (trip naf) sab))
24−
25−Examples
26−--------
27−
28− ~zod/try=> (rush 'I was the world in which I walked, and what I saw' (star (shim 0 200)))
29− [~ "I was the world in which I walked, and what I saw"]
30− ~zod/try=> (rush 'abc' (just 'a'))
31− ~
32− ~zod/try=> (rush 'abc' (jest 'abc'))
33− [~ 'abc']
34− ~zod/try=> (rush 'abc' (jest 'ac'))
35− ~
36− ~zod/try=> (rush 'abc' (jest 'ab'))
37− ~
38−
39−
docs/system/hoon/library/gate/rust.mddeleted−37
@@ -1,37 +0,0 @@
1−### `++rust`
2−
3−Parse tape or null
4−
5−Parse a [`++tape`]() with a given [`++rule`]() and produce null if the `++tape` isn't
6−entirely parsed.
7−
8−Accepts
9−-------
10−
11−`los` is a `++tape`.
12−
13−`sab` is a `++rule`.
14−
15−Produces
16−--------
17−
18−A `(unit ,@t)`
19−
20−Source
21−------
22−
23− ++ rust |* [los=tape sab=_rule]
24− =+ vex=((full sab) [[1 1] los])
25− ?~(q.vex ~ [~ u=p.u.q.vex])
26−
27−Examples
28−--------
29−
30− ~zod/try=> (rust "I was the world in which I walked, and what I saw" (star (shim 0 200)))
31− [~ "I was the world in which I walked, and what I saw"]
32− ~zod/try=> (rust "Or heard or felt came not but from myself;" (star (shim 0 200)))
33− [~ "Or heard or felt came not but from myself;"]
34− ~zod/try=> (rust "And there I found myself more truly and more strange." (jest 'And there I'))
35− ~
36−
37−
docs/system/hoon/library/gate/sa.mddeleted−36
@@ -1,36 +0,0 @@
1−### `++sa`
2−
3−Set from list
4−
5−Produces a set of the elements in list `a`.
6−
7−Accepts
8−-------
9−
10−`a` is a [list]().
11−
12−Produces
13−--------
14−
15−A [`++set`]().
16−
17−Source
18−------
19−
20− ++ sa :: set from list
21− |* a=(list)
22− => .(a `_(homo a)`a)
23− =+ b=*(set ,_?>(?=(^ a) i.a))
24− (~(gas in b) a)
25− ::
26−
27−
28−Examples
29−--------
30−
31− ~zod/try=> (sa `(list ,@)`[1 2 3 4 5 ~])
32− {5 4 1 3 2}
33− ~zod/try=> (sa `(list ,[@t *])`[[`a` 1] [`b` 2] ~])
34− {[`a` 1] [`b` 2]}
35−
36−
docs/system/hoon/library/gate/sand.mddeleted−36
@@ -1,36 +0,0 @@
1−### `++sand`
2−
3−Soft-cast by odor
4−
5−Soft-cast validity by [odor]().
6−
7−Accepts
8−-------
9−
10−`a` is a [`++span`]() (`@ta`).
11−
12−`b` is an atom.
13−
14−Produces
15−--------
16−
17−A `(unit ,@)`.
18−
19−Source
20−------
21−
22− ++ sand :: atom sanity
23− |= a=@ta
24− |= b=@ ^- (unit ,@)
25− ?.(((sane a) b) ~ [~ b])
26− ::
27−
28−Examples
29−--------
30−
31− /~zod/try=> `(unit ,@ta)`((sand %ta) 'sym-som')
32− [~ ~.sym-som]
33− /~zod/try=> `(unit ,@ta)`((sand %ta) 'err!')
34− ~
35−
36−
docs/system/hoon/library/gate/sane.mddeleted−68
@@ -1,68 +0,0 @@
1−### `++sane`
2−
3−Check odor validity
4−
5−Check validity by [odor](). Produces a [gate]().
6−
7−Accepts
8−-------
9−
10−`a` is a [`++span`]() (`@ta`).
11−
12−`b` is an [atom]().
13−
14−Produces
15−--------
16−
17−A boolean.
18−
19−Source
20−------
21−
22− ++ sane :: atom sanity
23− |= a=@ta
24− |= b=@ ^- ?
25− ?. =(%t (end 3 1 a))
26− ~|(%sane-stub !!)
27− =+ [inx=0 len=(met 3 b)]
28− ?: =(%tas a)
29− |- ^- ?
30− ?: =(inx len) &
31− =+ cur=(cut 3 [inx 1] b)
32− ?& ?| &((gte cur 'a') (lte cur 'z'))
33− &(=('-' cur) !=(0 inx) !=(len inx))
34− &(&((gte cur '0') (lte cur '9')) !=(0 inx))
35− ==
36− $(inx +(inx))
37− ==
38− ?: =(%ta a)
39− |- ^- ?
40− ?: =(inx len) &
41− =+ cur=(cut 3 [inx 1] b)
42− ?& ?| &((gte cur 'a') (lte cur 'z'))
43− &((gte cur '0') (lte cur '9'))
44− |(=('-' cur) =('~' cur) =('_' cur) =('.' cur))
45− ==
46− $(inx +(inx))
47− ==
48− |- ^- ?
49− ?: =(0 b) &
50− =+ cur=(end 3 1 b)
51− ?: &((lth cur 32) !=(10 cur)) |
52− =+ len=(teff cur)
53− ?& |(=(1 len) =+(i=1 |-(|(=(i len) &((gte (cut 3 [i 1] b) 128) $(i +(i)))))))
54− $(b (rsh 3 len b))
55− ==
56− ::
57−
58−Examples
59−--------
60−
61− /~zod/try=> ((sane %tas) %mol)
62− %.y
63− /~zod/try=> ((sane %tas) 'lam')
64− %.y
65− /~zod/try=> ((sane %tas) 'more ace')
66− %.n
67−
68−
docs/system/hoon/library/gate/saxo.mddeleted−37
@@ -1,37 +0,0 @@
1−### `++saxo`
2−
3−List ancestors
4−
5−Lists the ancestors of `who`.
6−
7−Accepts
8−-------
9−
10−`who` is a [`++ship`]().
11−
12−Produces
13−--------
14−
15−A [`++list`]() of `++ship`.
16−
17−Source
18−------
19−
20− ++ saxo :: autocanon
21− |= who=ship
22− ^- (list ship)
23− ?: (lth who 256) [who ~]
24− [who $(who (sein who))]
25− ::
26−
27−Examples
28−--------
29−
30− ~zod/main=> (saxo ~pittyp-pittyp)
31− ~[~pittyp-pittyp ~dalnel ~del]
32− ~zod/main=> (saxo ~tasfyn-partyv)
33− ~[~tasfyn-partyv ~doznec ~zod]
34− ~zod/main=> (saxo ~ractul-fodsug-sibryg-modsyl--difrun-mirfun-filrec-patmet)
35− ~[~ractul-fodsug-sibryg-modsyl--difrun-mirfun-filrec-patmet ~zod]
36−
37−
docs/system/hoon/library/gate/scag.mddeleted−36
@@ -1,36 +0,0 @@
1−### `++scag`
2−
3−Prefix
4−
5−Accepts an atom `a` and [list]() `b`, producing the first `a` elements of
6−the front of the list.
7−
8−Accepts
9−-------
10−
11−`b` is a list.
12−
13−Produces
14−--------
15−
16−A list of the same type as `b`.
17−
18−Source
19−------
20−
21− ++ scag :: prefix
22− ~/ %scag
23− |* [a=@ b=(list)]
24− |- ^+ b
25− ?: |(?=(~ b) =(0 a)) ~
26− [i.b $(b t.b, a (dec a))]
27−
28−Examples
29−--------
30−
31− ~zod/try=> (scag 2 (limo [0 1 2 3 ~]))
32− [i=0 t=[i=1 t=~]]
33− ~zod/try=> (scag 10 (limo [1 2 3 4 ~]))
34− [i=1 t=[i=2 t=[i=3 t=[i=4 t=~]]]]
35−
36−
docs/system/hoon/library/gate/scan.mddeleted−41
@@ -1,41 +0,0 @@
1−### `++scan`
2−
3−Parse tape or crash
4−
5−Parse a [`++tape`]() with a given [`++rule`]() and crash if the `++tape` isn't entirely
6−parsed.
7−
8−Accepts
9−-------
10−
11−`los` is a [tape]().
12−
13−`sab` is a [rule]().
14−
15−Produces
16−--------
17−
18−Either a `++tape` or a crash.
19−
20−Source
21−------
22−
23− ++ scan |* [los=tape sab=_rule]
24− =+ vex=((full sab) [[1 1] los])
25− ?~ q.vex
26− ~_ (show [%m '{%d %d}'] p.p.vex q.p.vex ~)
27− ~|('syntax-error' !!)
28− p.u.q.vex
29−
30−Examples
31−--------
32−
33− ~zod/try=> (scan "I was the world in which I walked, and what I saw" (star (shim 0 200)))
34− "I was the world in which I walked, and what I saw"
35− ~zod/try=> (scan "Or heard or felt came not but from myself;" (star (shim 0 200)))
36− "Or heard or felt came not but from myself;"
37− ~zod/try=> (scan "And there I found myself more truly and more strange." (jest 'And there I'))
38− ! {1 12}
39− ! 'syntax-error'
40− ! exit
41−
docs/system/hoon/library/gate/scanf.mddeleted−83
@@ -1,83 +0,0 @@
1−### `++scanf` XX
2−
3−Formatted scan
4−
5− ++ scanf :: formatted scan
6− |* [tape (pole ,_:/(*$&(_rule tape)))]
7− => .(+< [a b]=+<)
8− (scan a (parsf b))
9−
10−Scan with `;"`-interpolated parsers.
11−
12−A- here there be monsters, monsters of my making. But the basic idea is
13−you use `;"` (which currently is parsed by sail but shouldn't be) to mix
14−literal text and [++rule]s, and apply this to text which is a
15−correspending mixture of aforementioned literals and sections parsable
16−by the relevant rules. ++parsf is the parser form that combines a
17−tape-rule mix into one big ++rule, ++norm being a parsf internal that
18−winnows the `;"` result into a list of discriminate literals and rules,
19−and ++bill doing the actual composing: ++\$:parsf just adds a layer that
20−collapses the result list to a tuple, such that (scanf "foo 1 2 bar"
21−;"foo {dem} {dem} bar") parses [1 2] and not [1 2 \~].
22−
23− ~zod/try=> `[p=@ud q=@ud]`(scanf "Score is 5 to 2" [;"Score is {n} to {n}"]:n=dim:ag)
24− [p=5 q=2]
25−
26− ~zod/try=> =n ;~(pfix (star (just '0')) (cook |=(@ud +<) dim:ag))
27− ~zod/try=> (scanf "2014-08-12T23:10:58.931Z" ;"{n}\-{n}\-{n}T{n}:{n}:{n}.{n}Z")
28− [2.014 8 12 23 10 58 931]
29− ~zod/try=> =dat (scanf "2014-08-12T23:10:58.931Z" ;"{n}\-{n}\-{n}T{n}:{n}:{n}.{n}Z")
30− ~zod/try=> `@da`(year `date`dat(- [%& -.dat], |6 ~[(div (mul |6.dat (bex 16)) 1.000)]))
31− ~2014.8.12..23.10.58..ee56
32−
33−### `++parsf` XX
34−
35− ++ parsf :: make parser from:
36− |^ |* a=(pole ,_:/(*$&(_rule tape))) :: ;"chars{rule}chars"
37− %- cook :_ (bill (norm a))
38− |* (list)
39− ?~ +< ~
40− ?~ t i
41− [i $(+< t)]
42− ::
43−
44−`parsf` generates a `_rule` from a tape with rules embedded in it,
45−literal sections being matched verbatim. The parsed type is a tuple of
46−the embedded rules' results.
47−
48−Two intermediate arms are used:
49−
50−#### ++norm XX
51−
52− :: .= (norm [;"{n}, {n}"]:n=dim:ag) ~[[& dim] [| ", "] [& dim]]:ag
53− ++ norm
54− |* (pole ,_:/(*$&(_rule tape)))
55− ?~ +< ~
56− => .(+< [i=+<- t=+<+])
57− :_ t=$(+< t)
58− =+ rul=->->.i
59− ^= i
60− ?~ rul [%| p=rul]
61− ?~ +.rul [%| p=rul]
62− ?@ &2.rul [%| p=;;(tape rul)]
63− [%& p=rul]
64− ::
65−
66−`norm` converts a `;"` pole of `[[%~. [%~. ?(tape _rule)] ~] ~]` into a
67−more convenient list of discriminated tapes and rules.
68−
69−#### ++bill XX
70−
71− :: .= (bill ~[[& dim] [| ", "] [& dim]]:ag)
72− :: ;~(plug dim ;~(pfix com ace ;~(plug dim (easy)))):ag
73− ++ bill
74− |* (list (each ,_rule tape))
75− ?~ +< (easy ~)
76− ?: ?=(| -.i) ;~(pfix (jest (crip p.i)) $(+< t))
77− %+ cook |*([* *] [i t]=+<)
78− ;~(plug p.i $(+< t))
79− --
80− ::
81−
82−`bill` builds a parser out of rules and tapes, ignoring the literal
83−sections and producing a list of the rules' results.
docs/system/hoon/library/gate/scot.mddeleted−40
@@ -1,40 +0,0 @@
1−### `++scot`
2−
3−Render dime as cord
4−
5−Renders a dime `mol` as a cord.
6−
7−Accepts
8−-------
9−
10−Produces
11−--------
12−
13−`mol` is a [`++dime`]().
14−
15−Source
16−------
17−
18− ++ scot |=(mol=dime ~(rent co %$ mol))
19−
20−Examples
21−--------
22−
23− ~zod/try=> (scot %p ~pillyt)
24− ~.~pillyt
25− ~zod/try=> `@t`(scot %p ~pillyt)
26− '~pillyt'
27− ~zod/try=> (scot %ux 0x12)
28− ~.0x12
29− ~zod/try=> `@t`(scot %ux 0x12)
30− '0x12'
31− ~zod/try=> (scot %if .127.0.0.1)
32− ~..127.0.0.1
33− ~zod/try=> `@t`(scot %if .127.0.0.1)
34− '.127.0.0.1'
35− ~zod/try=> (scot %ta ~.asd_a)
36− ~.~.asd_a
37− ~zod/try=> `@t`(scot %ta ~.asd_a)
38− '~.asd_a'
39−
40−
docs/system/hoon/library/gate/scow.mddeleted−32
@@ -1,32 +0,0 @@
1−### `++scow`
2−
3−Render dime as tape
4−
5−Renders `mol` as a tape.
6−
7−Accepts
8−-------
9−
10−Produces
11−--------
12−
13−`mol` is a [`++dime`]().
14−
15−Source
16−------
17−
18− ++ scow |=(mol=dime ~(rend co %$ mol))
19−
20−Examples
21−--------
22−
23− ~zod/try=> (scow %p ~pillyt)
24− "~pillyt"
25− ~zod/try=> (scow %ux 0x12)
26− "0x12"
27− ~zod/try=> (scow %if .127.0.0.1)
28− ".127.0.0.1"
29− ~zod/try=> (scow %ta ~.asd_a)
30− "~.asd_a"
31−
32−
docs/system/hoon/library/gate/sear.mddeleted−41
@@ -1,41 +0,0 @@
1−### `++sear`
2−
3−Conditional `++cook`
4−
5−Conditional [`++cook`](). Slams the result through a gate that produces
6−a unit; if that unit is empty, fail.
7−
8−Accepts
9−-------
10−
11−`tub` is a [`++nail`](/doc/hoon/library/1#++nail)
12−
13−Produces
14−--------
15−
16−A [`++rule`]().
17−
18−Source
19−------
20−
21− ++ sear :: conditional cook
22− |* [pyq=_|=(* *(unit)) sef=_rule]
23− |= tub=nail
24− =+ vex=(sef tub)
25− ?~ q.vex
26− vex
27− =+ gey=(pyq p.u.q.vex)
28− ?~ gey
29− [p=p.vex q=~]
30− [p=p.vex q=[~ u=[p=u.gey q=q.u.q.vex]]]
31− ::
32−
33−Examples
34−--------
35−
36− ~zod/try=> ((sear |=(a=* ?@(a (some a) ~)) (just `a`)) [[1 1] "abc"])
37− [p=[p=1 q=2] q=[~ u=[p=97 q=[p=[p=1 q=2] q="bc"]]]]
38− ~zod/try=> ((sear |=(* ~) (just 'a')) [[1 1] "abc"])
39− [p=[p=1 q=2] q=~]
40−
41−
docs/system/hoon/library/gate/sein.mddeleted−56
@@ -1,56 +0,0 @@
1−### `++sein`
2−
3−Direct parent
4−
5−Computes the direct parent of `who`.
6−
7−Accepts
8−-------
9−
10−`who` is a [`++ship`]().
11−
12−Produces
13−--------
14−
15−A `++ship`.
16−
17−Source
18−------
19−
20− ++ sein :: autoboss
21− |= who=ship ^- ship
22− =+ mir=(clan who)
23− ?- mir
24− %czar who
25− %king (end 3 1 who)
26− %duke (end 4 1 who)
27− %earl (end 5 1 who)
28− %pawn `@p`0
29− ==
30−
31−Examples
32−--------
33−
34− ~zod/main=> (sein ~tasfyn-partyv)
35− ~doznec
36− ~zod/main=> (sein ~doznec)
37− ~zod
38− ~zod/main=> (sein ~zod)
39− ~zod
40− ~zod/main=> (sein ~pittyp-pittyp)
41− ~dalnel
42− ~zod/main=> (sein ~dalnel)
43− ~del
44− ~zod/main=> (sein ~ractul-fodsug-sibryg-modsyl--difrun-mirfun-filrec-patmet)
45− ~zod
46−
47− ~zod/main=> (saxo ~rabdec-monfer)
48− ~[~rabdec-monfer ~dalnel ~del]
49− ~zod/main=> `@rd`~rabdec-monfer
50− 0x5fd25
51− [%rlyd 0x5.fd25]
52− 0b1.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000
53− ~zod/main=> `@p`0x5.fd25
54− ~rabdec-monfer
55−
56− For `@rd` and `@p` see the [odors](../reference/odors) reference
docs/system/hoon/library/gate/sel.mddeleted−24
@@ -1,24 +0,0 @@
1−### `++sel`
2−
3−Parse left square bracket
4−
5−Parses ASCII character 91, the left square bracket.
6−
7−Source
8−------
9−
10− ++ sel (just '[')
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "[" sel)
16− ~~~5b.
17− ~zod/try=> `cord`(scan "[" sel)
18− '['
19− ~zod/try=> (sel [[1 1] "["])
20− [p=[p=1 q=2] q=[~ [p=~~~5b. q=[p=[p=1 q=2] q=""]]]]
21− ~zod/try=> (sel [[1 1] "-["])
22− [p=[p=1 q=1] q=~]
23−
24−
docs/system/hoon/library/gate/sem.mddeleted−24
@@ -1,24 +0,0 @@
1−### `++sem`
2−
3−Parse semicolon
4−
5−Parses ASCII character 59, the semicolon.
6−
7−Source
8−------
9−
10− ++ sem (just ';')
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan ";" sem)
16− ~~~3b.
17− ~zod/try=> `cord`(scan ";" sem)
18− ';'
19− ~zod/try=> (sem [[1 1] ";"])
20− [p=[p=1 q=2] q=[~ [p=~~~3b. q=[p=[p=1 q=2] q=""]]]]
21− ~zod/try=> (sem [[1 1] " ;"])
22− [p=[p=1 q=1] q=~]
23−
24−
docs/system/hoon/library/gate/ser.mddeleted−24
@@ -1,24 +0,0 @@
1−### `++ser`
2−
3−Parse right square bracket
4−
5−Parses ASCII character 93, the right square bracket.
6−
7−Source
8−------
9−
10− ++ ser (just ']')
11−
12−Examples
13−--------
14−
15− ~zod/try=> (scan "]" ser)
16− ~~~5d.
17− ~zod/try=> `cord`(scan "]" ser)
18− ']'
19− ~zod/try=> (ser [[1 1] "]"])
20− [p=[p=1 q=2] q=[~ [p=~~~5d. q=[p=[p=1 q=2] q=""]]]]
21− ~zod/try=> (ser [[1 1] "[ ]"])
22− [p=[p=1 q=1] q=~]
23−
24−
docs/system/hoon/library/gate/sfix.mddeleted−35
This diff is too big to show here.
docs/system/hoon/library/gate/shad.mddeleted−7
This diff is too big to show here.
docs/system/hoon/library/gate/shaf.mddeleted−11
This diff is too big to show here.
docs/system/hoon/library/gate/shak.mddeleted−10
This diff is too big to show here.
docs/system/hoon/library/gate/shal.mddeleted−118
This diff is too big to show here.
docs/system/hoon/library/gate/sham.mddeleted−12
This diff is too big to show here.
docs/system/hoon/library/gate/shan.mddeleted−71
This diff is too big to show here.
docs/system/hoon/library/gate/shas.mddeleted−10
This diff is too big to show here.
docs/system/hoon/library/gate/shaw.mddeleted−8
This diff is too big to show here.
docs/system/hoon/library/gate/shax.mddeleted−92
This diff is too big to show here.
docs/system/hoon/library/gate/shaz.mddeleted−7
This diff is too big to show here.
docs/system/hoon/library/gate/shim.mddeleted−45
This diff is too big to show here.
docs/system/hoon/library/gate/show.mddeleted−103
This diff is too big to show here.
docs/system/hoon/library/gate/sifo.mddeleted−46
This diff is too big to show here.
docs/system/hoon/library/gate/sig.mddeleted−24
This diff is too big to show here.
docs/system/hoon/library/gate/simu.mddeleted−44
This diff is too big to show here.
docs/system/hoon/library/gate/skid.mddeleted−36
This diff is too big to show here.
docs/system/hoon/library/gate/skim.mddeleted−35
This diff is too big to show here.
docs/system/hoon/library/gate/skip.mddeleted−37
This diff is too big to show here.
docs/system/hoon/library/gate/slag.mddeleted−37
This diff is too big to show here.
docs/system/hoon/library/gate/slat.mddeleted−35
This diff is too big to show here.
docs/system/hoon/library/gate/slav.mddeleted−43
This diff is too big to show here.
docs/system/hoon/library/gate/slaw.mddeleted−47
This diff is too big to show here.
docs/system/hoon/library/gate/slay.mddeleted−54
This diff is too big to show here.
docs/system/hoon/library/gate/slug.mddeleted−36
This diff is too big to show here.
docs/system/hoon/library/gate/smyt.mddeleted−43
This diff is too big to show here.
docs/system/hoon/library/gate/snag.mddeleted−38
This diff is too big to show here.
docs/system/hoon/library/gate/soft.mddeleted−29
This diff is too big to show here.
docs/system/hoon/library/gate/some.mddeleted−32
This diff is too big to show here.
docs/system/hoon/library/gate/soq.mddeleted−25
This diff is too big to show here.
docs/system/hoon/library/gate/sort.mddeleted−40
This diff is too big to show here.
docs/system/hoon/library/gate/soz.mddeleted−21
This diff is too big to show here.
docs/system/hoon/library/gate/spat.mddeleted−30
This diff is too big to show here.
docs/system/hoon/library/gate/spud.mddeleted−30
This diff is too big to show here.
docs/system/hoon/library/gate/stab.mddeleted−35
This diff is too big to show here.
docs/system/hoon/library/gate/stag.mddeleted−43
This diff is too big to show here.
docs/system/hoon/library/gate/star.mddeleted−37
This diff is too big to show here.
docs/system/hoon/library/gate/stet.mddeleted−50
This diff is too big to show here.
docs/system/hoon/library/gate/stew.mddeleted−54
This diff is too big to show here.
docs/system/hoon/library/gate/stir.mddeleted−47
This diff is too big to show here.
docs/system/hoon/library/gate/stud.mddeleted−58
This diff is too big to show here.
docs/system/hoon/library/gate/stun.mddeleted−50
This diff is too big to show here.
docs/system/hoon/library/gate/sub.mddeleted−43
This diff is too big to show here.
docs/system/hoon/library/gate/swag.mddeleted−33
This diff is too big to show here.
docs/system/hoon/library/gate/swp.mddeleted−40
This diff is too big to show here.
docs/system/hoon/library/gate/sym.mddeleted−26
This diff is too big to show here.
docs/system/hoon/library/gate/taco.mddeleted−27
This diff is too big to show here.
docs/system/hoon/library/gate/tact.mddeleted−34
This diff is too big to show here.
docs/system/hoon/library/gate/tame.mddeleted−54
This diff is too big to show here.
docs/system/hoon/library/gate/tar.mddeleted−24
This diff is too big to show here.
docs/system/hoon/library/gate/tec.mddeleted−25
This diff is too big to show here.
docs/system/hoon/library/gate/teff.mddeleted−37
This diff is too big to show here.
docs/system/hoon/library/gate/tell.mddeleted−39
This diff is too big to show here.
docs/system/hoon/library/gate/tis.mddeleted−24
This diff is too big to show here.
docs/system/hoon/library/gate/tome.mddeleted−46
This diff is too big to show here.
docs/system/hoon/library/gate/tope.mddeleted−30
This diff is too big to show here.
docs/system/hoon/library/gate/trim.mddeleted−41
This diff is too big to show here.
docs/system/hoon/library/gate/trip.mddeleted−38
This diff is too big to show here.
docs/system/hoon/library/gate/tuba.mddeleted−34
This diff is too big to show here.
docs/system/hoon/library/gate/tufa.mddeleted−35
This diff is too big to show here.
docs/system/hoon/library/gate/tuft.mddeleted−59
This diff is too big to show here.
docs/system/hoon/library/gate/turf.mddeleted−54
This diff is too big to show here.
docs/system/hoon/library/gate/turn.mddeleted−37
This diff is too big to show here.
docs/system/hoon/library/gate/txml.mddeleted−32
This diff is too big to show here.
docs/system/hoon/library/gate/unt.mddeleted−35
This diff is too big to show here.
docs/system/hoon/library/gate/urld.mddeleted−48
This diff is too big to show here.
docs/system/hoon/library/gate/urle.mddeleted−51
This diff is too big to show here.
docs/system/hoon/library/gate/ven.mddeleted−35
This diff is too big to show here.
docs/system/hoon/library/gate/vit.mddeleted−30
This diff is too big to show here.
docs/system/hoon/library/gate/vor.mddeleted−39
This diff is too big to show here.
docs/system/hoon/library/gate/vul.mddeleted−26
This diff is too big to show here.
docs/system/hoon/library/gate/wack.mddeleted−45
This diff is too big to show here.
docs/system/hoon/library/gate/weld.mddeleted−31
This diff is too big to show here.
docs/system/hoon/library/gate/welp.mddeleted−45
This diff is too big to show here.
docs/system/hoon/library/gate/wick.mddeleted−42
This diff is too big to show here.
docs/system/hoon/library/gate/woad.mddeleted−60
This diff is too big to show here.
docs/system/hoon/library/gate/wood.mddeleted−55
This diff is too big to show here.
docs/system/hoon/library/gate/wut.mddeleted−24
This diff is too big to show here.
docs/system/hoon/library/gate/xeb.mddeleted−42
This diff is too big to show here.
docs/system/hoon/library/gate/yall.mddeleted−54
This diff is too big to show here.
docs/system/hoon/library/gate/yawn.mddeleted−60
This diff is too big to show here.
docs/system/hoon/library/gate/year.mddeleted−35
This diff is too big to show here.
docs/system/hoon/library/gate/yell.mddeleted−38
This diff is too big to show here.
docs/system/hoon/library/gate/yelp.mddeleted−37
This diff is too big to show here.
docs/system/hoon/library/gate/yore.mddeleted−36
This diff is too big to show here.
docs/system/hoon/library/gate/yule.mddeleted−55
This diff is too big to show here.
docs/system/hoon/library/gate/zap.mddeleted−24
This diff is too big to show here.
docs/system/hoon/library/gate/zing.mddeleted−37
This diff is too big to show here.
docs/system/hoon/library/junk/hoon.mddeleted−37
This diff is too big to show here.
docs/system/hoon/library/mold/abel.mddeleted−16
This diff is too big to show here.
docs/system/hoon/library/mold/axis.mddeleted−25
This diff is too big to show here.
docs/system/hoon/library/mold/base.mddeleted−27
This diff is too big to show here.
docs/system/hoon/library/mold/bean.mddeleted−23
This diff is too big to show here.
docs/system/hoon/library/mold/beer.mddeleted−19
This diff is too big to show here.
docs/system/hoon/library/mold/beet.mddeleted−18
This diff is too big to show here.
docs/system/hoon/library/mold/bloq.mddeleted−20
This diff is too big to show here.
docs/system/hoon/library/mold/calf.mddeleted−26
This diff is too big to show here.
docs/system/hoon/library/mold/char.mddeleted−22
This diff is too big to show here.
docs/system/hoon/library/mold/chub.mddeleted−16
This diff is too big to show here.
docs/system/hoon/library/mold/chum.mddeleted−29
This diff is too big to show here.
docs/system/hoon/library/mold/clue.mddeleted−14
This diff is too big to show here.
docs/system/hoon/library/mold/coil.mddeleted−16
This diff is too big to show here.
docs/system/hoon/library/mold/coin.mddeleted−36
This diff is too big to show here.
docs/system/hoon/library/mold/cord.mddeleted−28
This diff is too big to show here.
docs/system/hoon/library/mold/date.mddeleted−20
This diff is too big to show here.
docs/system/hoon/library/mold/dime.mddeleted−21
This diff is too big to show here.
docs/system/hoon/library/mold/each.mddeleted−19
This diff is too big to show here.
docs/system/hoon/library/mold/edge.mddeleted−22
This diff is too big to show here.
docs/system/hoon/library/mold/foot.mddeleted−31
This diff is too big to show here.
docs/system/hoon/library/mold/gate.mddeleted−29
This diff is too big to show here.
docs/system/hoon/library/mold/hair.mddeleted−25
This diff is too big to show here.
docs/system/hoon/library/mold/jar.mddeleted−30
This diff is too big to show here.
docs/system/hoon/library/mold/jug.mddeleted−28
This diff is too big to show here.
docs/system/hoon/library/mold/like.mddeleted−27
This diff is too big to show here.
docs/system/hoon/library/mold/limb.mddeleted−18
This diff is too big to show here.
docs/system/hoon/library/mold/line.mddeleted−28
This diff is too big to show here.
docs/system/hoon/library/mold/list.mddeleted−26
This diff is too big to show here.
docs/system/hoon/library/mold/lone.mddeleted−12
This diff is too big to show here.
docs/system/hoon/library/mold/mane.mddeleted−26
This diff is too big to show here.
docs/system/hoon/library/mold/manx.mddeleted−17
This diff is too big to show here.
docs/system/hoon/library/mold/map.mddeleted−25
This diff is too big to show here.
docs/system/hoon/library/mold/marl.mddeleted−16
This diff is too big to show here.
docs/system/hoon/library/mold/mars.mddeleted−15
This diff is too big to show here.
docs/system/hoon/library/mold/mart.mddeleted−18
This diff is too big to show here.
docs/system/hoon/library/mold/marx.mddeleted−16
This diff is too big to show here.
docs/system/hoon/library/mold/metl.mddeleted−9
This diff is too big to show here.
docs/system/hoon/library/mold/nail.mddeleted−19
This diff is too big to show here.
docs/system/hoon/library/mold/nock.mddeleted−29
This diff is too big to show here.
docs/system/hoon/library/mold/noun.mddeleted−10
This diff is too big to show here.
docs/system/hoon/library/mold/null.mddeleted−11
This diff is too big to show here.
docs/system/hoon/library/mold/numb.mddeleted−6
This diff is too big to show here.
docs/system/hoon/library/mold/odor.mddeleted−22
This diff is too big to show here.
docs/system/hoon/library/mold/pair.mddeleted−20
This diff is too big to show here.
docs/system/hoon/library/mold/pass.mddeleted−12
This diff is too big to show here.
docs/system/hoon/library/mold/path.mddeleted−19
This diff is too big to show here.
docs/system/hoon/library/mold/pint.mddeleted−22
This diff is too big to show here.
docs/system/hoon/library/mold/pole.mddeleted−18
This diff is too big to show here.
docs/system/hoon/library/mold/port.mddeleted−23
This diff is too big to show here.
docs/system/hoon/library/mold/post.mddeleted−22
This diff is too big to show here.
docs/system/hoon/library/mold/prop.mddeleted−10
This diff is too big to show here.
docs/system/hoon/library/mold/qeu.mddeleted−24
This diff is too big to show here.
docs/system/hoon/library/mold/qual.mddeleted−18
This diff is too big to show here.
docs/system/hoon/library/mold/rege.mddeleted−34
This diff is too big to show here.
docs/system/hoon/library/mold/ring.mddeleted−12
This diff is too big to show here.
docs/system/hoon/library/mold/rule.mddeleted−27
This diff is too big to show here.
docs/system/hoon/library/mold/set.mddeleted−26
This diff is too big to show here.
docs/system/hoon/library/mold/span.mddeleted−30
This diff is too big to show here.
docs/system/hoon/library/mold/spot.mddeleted−21
This diff is too big to show here.
docs/system/hoon/library/mold/tang.mddeleted−7
This diff is too big to show here.
docs/system/hoon/library/mold/tank.mddeleted−39
This diff is too big to show here.
docs/system/hoon/library/mold/tape.mddeleted−21
This diff is too big to show here.
docs/system/hoon/library/mold/tarp.mddeleted−27
This diff is too big to show here.
docs/system/hoon/library/mold/term.mddeleted−28
This diff is too big to show here.
docs/system/hoon/library/mold/tiki.mddeleted−34
This diff is too big to show here.
docs/system/hoon/library/mold/time.mddeleted−23
This diff is too big to show here.
docs/system/hoon/library/mold/tine.mddeleted−30
This diff is too big to show here.
docs/system/hoon/library/mold/toga.mddeleted−40
This diff is too big to show here.
docs/system/hoon/library/mold/tone.mddeleted−45
This diff is too big to show here.
docs/system/hoon/library/mold/toon.mddeleted−26
This diff is too big to show here.
docs/system/hoon/library/mold/tram.mddeleted−24
This diff is too big to show here.
docs/system/hoon/library/mold/trap.mddeleted−24
This diff is too big to show here.
docs/system/hoon/library/mold/tree.mddeleted−19
This diff is too big to show here.
docs/system/hoon/library/mold/trel.mddeleted−18
This diff is too big to show here.
docs/system/hoon/library/mold/tuna.mddeleted−25
This diff is too big to show here.
docs/system/hoon/library/mold/tune.mddeleted−13
This diff is too big to show here.
docs/system/hoon/library/mold/tusk.mddeleted−21
This diff is too big to show here.
docs/system/hoon/library/mold/twig.mddeleted−9
This diff is too big to show here.
docs/system/hoon/library/mold/twin.mddeleted−25
This diff is too big to show here.
docs/system/hoon/library/mold/tyke.mddeleted−23
This diff is too big to show here.
docs/system/hoon/library/mold/type.mddeleted−6
This diff is too big to show here.
docs/system/hoon/library/mold/typo.mddeleted−18
This diff is too big to show here.
docs/system/hoon/library/mold/tyre.mddeleted−12
This diff is too big to show here.
docs/system/hoon/library/mold/udal.mddeleted−10
This diff is too big to show here.
docs/system/hoon/library/mold/udon.mddeleted−15
This diff is too big to show here.
docs/system/hoon/library/mold/umph.mddeleted−13
This diff is too big to show here.
docs/system/hoon/library/mold/unce.mddeleted−8
This diff is too big to show here.
docs/system/hoon/library/mold/unit.mddeleted−25
This diff is too big to show here.
docs/system/hoon/library/mold/upas.mddeleted−12
This diff is too big to show here.
docs/system/hoon/library/mold/urge.mddeleted−7
This diff is too big to show here.
docs/system/hoon/library/mold/vase.mddeleted−19
This diff is too big to show here.
docs/system/hoon/library/mold/vise.mddeleted−17
This diff is too big to show here.
docs/system/hoon/library/mold/wain.mddeleted−32
This diff is too big to show here.
docs/system/hoon/library/mold/wall.mddeleted−31
This diff is too big to show here.
docs/system/hoon/library/mold/wine.mddeleted−86
This diff is too big to show here.
docs/system/hoon/library/mold/wing.mddeleted−15
This diff is too big to show here.
docs/system/hoon/library/mold/wonk.mddeleted−29
This diff is too big to show here.
docs/system/hoon/library/zuse/diff.mddeleted−810
This diff is too big to show here.
docs/system/hoon/library/zuse/rsa.mddeleted−399
This diff is too big to show here.