on master help sign in
remove zuse, since totally out of date
2ac81e7Anthony Arroyo
docs/bridge.mddeleted−11
@@ -1,11 +0,0 @@
1−---
2−navhome: /docs/
3−sort: 11
4−title: Bridge
5−---
6−
7−# Bridge
8−
9−Bridge is our UI for interacting with the Ethereum-based Urbit Constitution. You can use it to manage, transfer, rekey and spawn ships.
10−
11−Coming soon.
docs/pki.mddeleted−12
@@ -1,12 +0,0 @@
1−---
2−navhome: /docs/
3−sort: 10
4−title: PKI
5−---
6−
7−# Public-Key Infrastructure
8−
9−Urbit uses the Ethereum blockchain as the decentralized ledger of its public-key
10−infrastructure.
11−
12−<list/>
docs/pki/constitution.mddeleted−11
@@ -1,11 +0,0 @@
1−---
2−navhome: /docs/
3−sort: 2
4−title: Constitution
5−---
6−
7−# Constitution
8−
9−The [Urbit Constitution](https://github.com/urbit/constitution) is a suite of smart contracts that manage the rules and ownership of the Urbit address space.
10−
11−Note: As of `~2018.11` these contracts are still being tested. In the future — Urbit will depend on these contracts to track ownership of Urbit assets.
docs/pki/storage.mddeleted−11
@@ -1,11 +0,0 @@
1−---
2−navhome: /docs/
3−sort: 1
4−title: The Urbit HD Wallet
5−---
6−
7−# The Urbit HD Wallet
8−
9−On-chain Urbit assets can require many different keypairs for operation. To simplify this potentially complex process, we designed our own wallet specification. [This Urbit Proposal](https://github.com/urbit/fora-posts/blob/master/proposals/posts/~2018.11.8..19.31.59..ba77~.md) describes the spec in detail. There are no new cryptographic primitives: it's bascially a Type 2 HD wallet nested inside of a Type 1 HD wallet.
10−
11−Note: As of `~2018.11` Urbit assets are not yet deployed to the Ethereum blockchain. This wallet structure is not yet in use for managing live assets.
getting-started/azimuth.udon+1−1
@@ -5,5 +5,5 @@
5
5
6# Using Azimuth
6# Using Azimuth
7
7
8−[PLACEHOLDER]
8+The primary way to interact with Azimuth, our identity platform, is through our application [Bridge](https://github.com/urbit/bridge) and the node libraries that it depends on, azimuth-js and keygen-js. Take a look at the source and play around or see our [introduction to Bridge](/getting-started/installation).
9
9
getting-started/landscape.udon+1−14
@@ -5,19 +5,6 @@
5
5
6# Landscape
6# Landscape
7
7
8−Your ship is also accessible through its own web interface. Through the web
9−interface you'll have access to our chat and message boards, the two components
10−of _Landscape_. This is a user-friendly way to chat with Arvo network and access
11−and materials you've published on your ship. If you're running Arvo locally on
12−your own machine, try opening `http://localhost/` in your browser.
13−
14−The `/~~/` in the URL will redirect you to a login page. The page will tell
15−you to run the +code generator (an Arvo shell script) in your Dojo to get your
16−password. Copy and paste that into your password input box and hit Enter.
17−After loading, you'll find yourself redirected to your home page, authenticated,
18−where you can then use the navigation bar at the top of the page to use the Landscape
19−interface.
20−
21−We're using Landscape to bootstrap a city dedicated to learning Hoon and
8+We're using Landscape, our new UI, to bootstrap a city dedicated to learning Hoon and
22contributing to Urbit. If you'd like to know more about joining this city, visit
9contributing to Urbit. If you'd like to know more about joining this city, visit
23this [signup page](/landscape).
10this [signup page](/landscape).
getting-started/landscape/desktop.udondeleted

No changes to the content.

getting-started/landscape/mobile.udondeleted

No changes to the content.

introduction.udon+15−22
@@ -7,41 +7,34 @@
7
7
8# Introduction
8# Introduction
9
9
10−<<<<<<< HEAD
11Welcome to the documentation for the Urbit project, including the Azimuth identity layer, the Arvo operating system, and the Hoon programming language. This documentation is maintained by [Tlon](https://tlon.io) in a public [Github repository](https://github.com/urbit/docs). Issues and contributions are welcome.
10Welcome to the documentation for the Urbit project, including the Azimuth identity layer, the Arvo operating system, and the Hoon programming language. This documentation is maintained by [Tlon](https://tlon.io) in a public [Github repository](https://github.com/urbit/docs). Issues and contributions are welcome.
12
11
13The documentation is organized into four high-level sections, and further divided between Azimuth and Arvo. Read on to get acquainted.
12The documentation is organized into four high-level sections, and further divided between Azimuth and Arvo. Read on to get acquainted.
14
13
15−## [Introduction](docs/introduction)
14+## [Introduction](/docs/introduction)
16
15
17If you're looking for a high-level introduction to the Urbit project and its components, start here.
16If you're looking for a high-level introduction to the Urbit project and its components, start here.
18
17
19−- See [Technical Overview](docs/introduction/technical-overview) for an in-depth description of Urbit.
18+- See [Technical Overview](/docs/introduction/technical-overview) for an in-depth description of Urbit.
20−- See [Contributing](docs/introduction/contributing) for a guide to getting involved with the Urbit project.
19+- See [Contributing](/docs/introduction/contributing) for a guide to getting involved with the Urbit project.
21
20
22−## [Getting Started](docs/getting-started)
21+## [Getting Started](/docs/getting-started)
23
22
24−If you'd like to install Arvo, get an Azimuth point, and/or get on the Urbit network, you'll find guides here. Dive in, and don't be afraid to [ask for help](support@urbit.org)!
23+If you'd like to install Arvo, get an Azimuth point, and/or get on the Urbit network, you'll find guides here. Dive in, and don't be afraid to [ask for help](support@urbit.org)!
25
24
26−- [Get started with Azimuth](docs/getting-started/azimuth), the identity system.
25+- [Get started with Azimuth](/docs/getting-started/azimuth), the identity system.
27−- [Get started with Arvo](docs/getting-started/arvo), the Urbit OS.
26+- [Get started with Arvo](/docs/getting-started/arvo), the Urbit OS.
28
27
29−## [Learn](docs/learn)
28+## [Learn](/docs/learn)
30
29
31−If you're interested in contributing to the Urbit project, building applications, or understanding the system technically, find tutorials and explanations of all the compontents of the system.
30+If you're interested in contributing to the Urbit project, building applications, or understanding the system technically, find tutorials and explanations of all the compontents of the system.
32
31
33−- If you want to dive into learning Urbit, we recommend starting with the [Hoon Tutorial](docs/learn/arvo/hoon).
32+- If you want to dive into learning Urbit, we recommend starting with the [Hoon Tutorial](/docs/learn/arvo/hoon).
34−- For Arvo internals, start at [Arvo](docs/learn/arvo).
33+- For Arvo internals, start at [Arvo](/docs/learn/arvo).
35
34
36−## [Reference](docs/reference)
35+## [Reference](/docs/reference)
37
36
38−If you're a developer looking for Arvo reference documentation, this section is for you.
37+If you're a developer looking for Arvo reference documentation, this section is for you.
39
38
40−- Confused about all the new words? Check out the [Glossary](docs/reference/glossary).
39+- Confused about all the new words? Check out the [Glossary](/docs/reference/glossary).
41−- Don't miss the helpful Hoon rune [Cheat Sheet](docs/reference/cheat-sheet).
40+- Don't miss the helpful Hoon rune [Cheat Sheet](/docs/reference/cheat-sheet).
42−=======
43−Urbit is a new software stock for
44−
45−Learn more about the Urbit project here before delving deeper into the developer
46−documentation.
47−>>>>>>> 00f3572eae751223638daa96d6689323ec024b2a
reference/library/zuse/core/crua.udondeleted−603
@@ -1,603 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−### `++crua`
7−
8− ++ crua !: :: cryptosuite A (RSA)
9− ^- acru
10− =| [mos=@ pon=(unit ,[p=@ q=@ r=[p=@ q=@] s=_*fu])]
11− => |%
12−
13−XX document
14−
15−### `++mx`
16−
17− ++ mx (dec (met 0 mos)) :: bit length
18−
19−XX document
20−
21−### `++dap`
22−
23− ++ dap :: OEAP decode
24− |= [wid=@ xar=@ dog=@] ^- [p=@ q=@]
25− =+ pav=(sub wid xar)
26− =+ qoy=(cut 0 [xar pav] dog)
27− =+ dez=(mix (end 0 xar dog) (shaw %pad-b xar qoy))
28− [dez (mix qoy (shaw %pad-a pav dez))]
29− ::
30−
31−XX document
32−
33−### `++pad`
34−
35− ++ pad :: OEAP encode
36− |= [wid=@ rax=[p=@ q=@] meg=@] ^- @
37− =+ pav=(sub wid p.rax)
38− ?> (gte pav (met 0 meg))
39− ^- @
40− =+ qoy=(mix meg (shaw %pad-a pav q.rax))
41− =+ dez=(mix q.rax (shaw %pad-b p.rax qoy))
42− (can 0 [p.rax dez] [pav qoy] ~)
43− |%
44−
45−XX document
46−
47−### `++pull`
48−
49− ++ pull |=(a=@ (~(exp fo mos) 3 a))
50−
51−XX document
52−
53−### `++push`
54−
55− ++ push |=(a=@ (~(exp fo mos) 5 a))
56−
57−XX document
58−
59−### `++pump`
60−
61− ++ pump
62− |= a=@ ^- @
63− ?~ pon !!
64− (out.s.u.pon (exp.s.u.pon p.r.u.pon (sit.s.u.pon a)))
65− ::
66−
67−XX document
68−
69−### `++punt`
70−
71− ++ punt
72− |= a=@ ^- @
73− ?~ pon !!
74− (out.s.u.pon (exp.s.u.pon q.r.u.pon (sit.s.u.pon a)))
75− |%
76−
77−XX document
78−
79−### `++as`
80−
81− ++ as
82− => |%
83−
84−XX document
85−
86−### `++haul`
87−
88− ++ haul :: revealing haul
89− |= a=pass
90− !!
91− ^?
92− |% ++ seal
93− |= [a=pass b=@ c=@]
94− ^- @
95− !!
96−
97−XX document
98−
99−### `++seal`
100−
101−
102− XX document
103−
104− ###++sign
105−
106− ```
107− ++ sign
108− |= [a=@ b=@] ^- @
109− !!
110− ```
111−
112− XX document
113−
114− ###++sure
115−
116− ```
117− ++ sure
118− |= [a=@ b=@]
119− ^- (unit ,@)
120− !!
121− ```
122−
123− XX document
124−
125− ###++tear
126−
127− ```
128− ++ tear
129− |= [a=pass b=@]
130− ^- (unit ,[p=@ q=@])
131− !!
132− ::
133− ```
134−
135− XX document
136−
137− ###++de
138−
139− ```
140− ++ de
141− |+ [key=@ cep=@] ^- (unit ,@)
142− !!
143− ::
144− ```
145−
146− XX document
147−
148− ###++dy
149−
150− ```
151− ++ dy
152− |+ [a=@ b=@] ^- @
153− !!
154− ```
155−
156− XX document
157−
158− ###++en
159−
160− ```
161− ++ en
162− |+ [key=@ msg=@] ^- @ux
163− !!
164− ::
165− ```
166−
167− XX document
168−
169− ###++ex
170−
171− ```
172− ++ ex ^?
173− |% ++ fig ^- @uvH (shaf %bfig puc)
174− ```
175−
176− XX document
177−
178− ###++fig
179−
180−XX document
181−
182−### `++pac`
183−
184− ++ pac ^- @uvG (end 6 1 (shaf %acod sec))
185−
186−XX document
187−
188−### `++pub`
189−
190− ++ pub ^- pass (cat 3 'b' puc)
191−
192−XX document
193−
194−### `++sec`
195−
196− ++ sec ^- ring sed
197− ::
198−
199−XX document
200−
201−### `++nu`
202−
203− ++ nu
204− ^?
205− |% ++ com
206− |= a=@
207− ^+ ^?(..nu)
208− ..nu(sed ~, puc a)
209− ::
210−
211−XX document
212−
213−### `++elcm`
214−
215− ++ elcm
216− |= [a=@ b=@]
217− (div (mul a b) d:(egcd a b))
218− ::
219−
220−XX document
221−
222−### `++eldm`
223−
224− ++ eldm
225− |= [a=@ b=@ c=@]
226− (~(inv fo (elcm (dec b) (dec c))) a)
227− ::
228−
229−XX document
230−
231−### `++ersa`
232−
233− ++ ersa
234− |= [a=@ b=@]
235− [a b [(eldm 3 a b) (eldm 5 a b)] (fu a b)]
236− ^?
237− |% ++ com
238− |= a=@
239− ^+ ^?(..nu)
240− ..nu(mos a, pon ~)
241− ::
242−
243−XX document
244−
245−### `++com`
246−
247−
248− XX document
249−
250− ###++pit
251−
252− ```
253− ++ pit
254− |= [a=@ b=@]
255− ^+ ^?(..nu)
256− ..nu(sed b, puc (puck:ed b))
257− ::
258− ```
259−
260− XX document
261−
262− ###++nol
263−
264− ```
265− ++ nol
266− |= a=@
267− ^+ ^?(..nu)
268− ..nu(sed a, puc (puck:ed a))
269− ```
270−
271− XX document
272−
273− ###++bruw
274−
275− ```
276− ++ bruw :: create keypair
277− |= [a=@ b=@] :: width seed
278− ^- acru
279− (pit:nu:crua a b)
280− ::
281− ```
282−
283− XX document
284−
285− ###++haul
286−
287− ```
288− ++ haul :: revealing haul
289− |= a=pass
290− !!
291− ^?
292− |% ++ seal
293− |= [a=pass b=@ c=@]
294− ^- @
295− !!
296− ```
297−
298− XX document
299−
300− ###++weur
301−
302− ```
303− ++ weur :: activate secret key
304− |= a=ring
305− ^- acru
306− =+ [mag=(end 3 1 a) bod=(rsh 3 1 a)]
307− ?> =('A' mag)
308− (nol:nu:crua bod)
309− ::
310− ```
311−
312− XX document
313−
314− ###++trua
315−
316− ```
317− ++ trua :: test rsa
318− |= msg=@tas
319− ^- @
320− =+ ali=(bruw 1.024 (shax 'ali'))
321− =+ bob=(bruw 1.024 (shax 'bob'))
322− =+ tef=(sign:as.ali [0 msg])
323− =+ lov=(sure:as.ali [0 tef])
324− ?. &(?=(^ lov) =(msg u.lov))
325− ~|(%test-fail-sign !!)
326− =+ key=(shax (shax (shax msg)))
327− =+ sax=(seal:as.ali pub:ex.bob key msg)
328− =+ tin=(tear:as.bob pub:ex.ali sax)
329− ?. &(?=(^ tin) =(key p.u.tin) =(msg q.u.tin))
330− ~|(%test-fail-seal !!)
331− msg
332− ::
333− ```
334−
335− XX document
336−
337− ###++crub
338−
339− ```
340− ++ crub :: cryptosuite B (Ed)
341− ^- acru
342− =| [puc=pass sed=ring]
343− => |%
344− ```
345−
346− XX document
347−
348− ###++dap
349−
350− ```
351− ++ dap :: OEAP decode
352− |= [wid=@ xar=@ dog=@] ^- [p=@ q=@]
353− =+ pav=(sub wid xar)
354− =+ qoy=(cut 0 [xar pav] dog)
355− =+ dez=(mix (end 0 xar dog) (shaw %pad-b xar qoy))
356− [dez (mix qoy (shaw %pad-a pav dez))]
357− ::
358− ```
359−
360− XX document
361−
362− ###++pad
363−
364− ```
365− ++ pad :: OEAP encode
366− |= [wid=@ rax=[p=@ q=@] meg=@] ^- @
367− =+ pav=(sub wid p.rax)
368− ?> (gte pav (met 0 meg))
369− ^- @
370− =+ qoy=(mix meg (shaw %pad-a pav q.rax))
371− =+ dez=(mix q.rax (shaw %pad-b p.rax qoy))
372− (can 0 [p.rax dez] [pav qoy] ~)
373− |%
374− ```
375−
376− XX document
377−
378− ###++as
379−
380− ```
381− ++ as
382− => |%
383− ```
384−
385− XX document
386−
387− ###++haul
388−
389− ```
390− ++ haul :: revealing haul
391− |= a=pass
392− !!
393− ^?
394− |% ++ seal
395− |= [a=pass b=@ c=@]
396− ^- @
397− !!
398− ```
399−
400− XX document
401−
402− ###++seal
403−
404−XX document
405−
406−### `++sign`
407−
408− ++ sign
409− |= [a=@ b=@] ^- @
410− !!
411−
412−XX document
413−
414−### `++sure`
415−
416− ++ sure
417− |= [a=@ b=@]
418− ^- (unit ,@)
419− !!
420−
421−XX document
422−
423−### `++tear`
424−
425− ++ tear
426− |= [a=pass b=@]
427− ^- (unit ,[p=@ q=@])
428− !!
429− ::
430−
431−XX document
432−
433−### `++de`
434−
435− ++ de
436− |+ [key=@ cep=@] ^- (unit ,@)
437− !!
438− ::
439−
440−XX document
441−
442−### `++dy`
443−
444− ++ dy
445− |+ [a=@ b=@] ^- @
446− !!
447−
448−XX document
449−
450−### `++en`
451−
452− ++ en
453− |+ [key=@ msg=@] ^- @ux
454− !!
455− ::
456−
457−XX document
458−
459−### `++ex`
460−
461− ++ ex ^?
462− |% ++ fig ^- @uvH (shaf %bfig puc)
463−
464−XX document
465−
466−### `++fig`
467−
468−
469− XX document
470−
471− ###++pac
472−
473− ```
474− ++ pac ^- @uvG (end 6 1 (shaf %acod sec))
475− ```
476−
477− XX document
478−
479− ###++pub
480−
481− ```
482− ++ pub ^- pass (cat 3 'b' puc)
483− ```
484−
485− XX document
486−
487− ###++sec
488−
489− ```
490− ++ sec ^- ring sed
491− ::
492− ```
493−
494− XX document
495−
496− ###++nu
497−
498− ```
499− ++ nu
500− ^?
501− |% ++ com
502− |= a=@
503− ^+ ^?(..nu)
504− ..nu(sed ~, puc a)
505− ::
506− ```
507−
508− XX document
509−
510− ###++com
511−
512−XX document
513−
514−### `++pit`
515−
516− ++ pit
517− |= [a=@ b=@]
518− ^+ ^?(..nu)
519− ..nu(sed b, puc (puck:ed b))
520− ::
521−
522−XX document
523−
524−### `++nol`
525−
526− ++ nol
527− |= a=@
528− ^+ ^?(..nu)
529− ..nu(sed a, puc (puck:ed a))
530−
531−XX document
532−
533−### `++brew`
534−
535− ++ brew :: create keypair
536− |= [a=@ b=@] :: width seed
537− ^- acru
538− (pit:nu:crub a b)
539− ::
540−
541−XX document
542−
543−### `++hail`
544−
545− ++ hail :: activate public key
546− |= a=pass
547− ^- acru
548− =+ [mag=(end 3 1 a) bod=(rsh 3 1 a)]
549− ?> =('b' mag)
550− (com:nu:crub bod)
551− ::
552−
553−XX document
554−
555−### `++wear`
556−
557− ++ wear :: activate secret key
558− |= a=ring
559− ^- acru
560− =+ [mag=(end 3 1 a) bod=(rsh 3 1 a)]
561− ?> =('b' mag)
562− (nol:nu:crub bod)
563− ::
564−
565−XX document
566−
567−### `++trub`
568−
569− ++ trub :: test ed
570− |= msg=@tas
571− ^- @
572− =+ ali=(brew 1.024 (shax 'ali'))
573− =+ bob=(brew 1.024 (shax 'bob'))
574− =+ tef=(sign:as.ali [0 msg])
575− =+ lov=(sure:as.ali [0 tef])
576− ?. &(?=(^ lov) =(msg u.lov))
577− ~|(%test-fail-sign !!)
578− =+ key=(shax (shax (shax msg)))
579− =+ sax=(seal:as.ali pub:ex.bob key msg)
580− =+ tin=(tear:as.bob pub:ex.ali sax)
581− ?. &(?=(^ tin) =(key p.u.tin) =(msg q.u.tin))
582− ~|(%test-fail-seal !!)
583− msg
584− ::
585−
586−XX document
587−
588−### `++hmac`
589−
590− ++ hmac :: HMAC-SHA1
591− |= [key=@ mes=@]
592− =+ ip=(fil 3 64 0x36)
593− =+ op=(fil 3 64 0x5c)
594− =+ ^= kex
595− ?: (gth (met 3 key) 64)
596− (lsh 3 44 (shan (swap 3 key)))
597− (lsh 3 (sub 64 (met 3 key)) (swap 3 key))
598− =+ inn=(shan (swap 3 (cat 3 (swap 3 mes) (mix ip kex))))
599− (shan (swap 3 (cat 3 inn (mix op kex))))
600− ::
601−
602−XX document
603−
reference/library/zuse/core/epur.udondeleted−890
@@ -1,890 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−### `++epur`
7−
8−Top-level URL parser
9−
10−Parses an entire URL.
11−
12−Accepts
13−-------
14−
15−`a` is a [`++cord`](/docs/hoon/library/1#++cord).
16−
17−Produces
18−--------
19−
20−A [`++purl`]().
21−
22−Source
23−------
24−
25− ++ epur :: url/header parser
26− =< |=(a=cord (rush a auri))
27− |%
28−
29−Examples
30−--------
31−
32− ~zod/main=> (epur 'http://127.0.0.1/')
33− [~ [p=[p=%.n q=~ r=[%.n p=.127.0.0.1]] q=[p=~ q=<||>] r=~]]
34− ~zod/main=> (epur 'http://www.google.com/')
35− [~ [p=[p=%.n q=~ r=[%.y p=<|com google www|>]] q=[p=~ q=<||>] r=~]]
36− ~zod/main=> (epur 'https://www.google.com/')
37− [~ [p=[p=%.y q=~ r=[%.y p=<|com google www|>]] q=[p=~ q=<||>] r=~]]
38− ~zod/main=> (epur 'https//www.google.com/')
39− ~
40− ~zod/main=> (epur 'https://www.google.com:200/')
41− [~ [p=[p=%.y q=[~ 200] r=[%.y p=<|com google www|>]] q=[p=~ q=<||>] r=~]]
42− ~zod/main=> (epur 'https://www.google.com:200/search')
43− [ ~
44− [p=[p=%.y q=[~ 200] r=[%.y p=<|com google www|>]] q=[p=~ q=<|search|>] r=~]
45− ]
46− ~zod/main=> (epur 'https://www.google.com/search')
47− [~ [p=[p=%.y q=~ r=[%.y p=<|com google www|>]] q=[p=~ q=<|search|>] r=~]]
48− ~zod/main=> (epur 'https://www.google.com/search?q=urbit')
49− [ ~
50− [ p=[p=%.y q=~ r=[%.y p=<|com google www|>]]
51− q=[p=~ q=<|search|>]
52− r=~[[p='q' q='urbit']]
53− ]
54− ]
55− ~zod/main=> (epur 'https://www.google.com/search?q=urb it')
56− ~
57− ~zod/main=> (epur 'https://www.google.com/search?q=urb%20it')
58− [ ~
59− [ p=[p=%.y q=~ r=[%.y p=<|com google www|>]]
60− q=[p=~ q=<|search|>]
61− r=~[[p='q' q='urb it']]
62− ]
63− ]
64− ~zod/main=> (epur 'https://www.google.com/search?q=urbit%20escaping%3F')
65− [ ~
66− [ p=[p=%.y q=~ r=[%.y p=<|com google www|>]]
67− q=[p=~ q=<|search|>]
68− r=~[[p='q' q='urbit escaping?']]
69− ]
70− ]
71−
72−### `++apat`
73−
74−URL path as ++pork
75−
76−Parses a URL path as a [`++pork`]().
77−
78−Produces
79−--------
80−
81−A [`++rule`]().
82−
83−Source
84−------
85−
86− ++ apat :: 2396 abs_path
87− %+ cook deft
88− (ifix [fas ;~(pose fas (easy ~))] (more fas smeg))
89−
90−Examples
91−--------
92−
93− ~zod/try=> (scan "/foo/mol/lok" apat:epur)
94− [p=~ q=<|foo mol lok|>]
95− ~zod/try=> (scan "/foo/mol/lok.htm" apat:epur)
96− [p=[~ ~.htm] q=<|foo mol lok|>]
97−
98−### `++auri`
99−
100−URL parsing rule
101−
102−Accepts
103−-------
104−
105−A [`++purl`]().
106−
107−Produces
108−--------
109−
110−XX
111−
112−Source
113−------
114−
115− ++ auri
116− %+ cook
117− |= a=purl
118− ?.(=([& /localhost] r.p.a) a a(p.p &))
119− ;~ plug
120− ;~ plug
121− %+ sear
122− |= a=@t
123− ^- (unit ,?)
124− ?+(a ~ %http [~ %|], %https [~ %&])
125− ;~(sfix scem ;~(plug col fas fas))
126− thor
127− ==
128− ;~(plug ;~(pose apat (easy *pork)) yque)
129− ==
130−
131−Examples
132−--------
133−
134− ~zod/main=> (auri:epur [1 1] "http://127.0.0.1/")
135− [ p=[p=1 q=18]
136− q
137− [ ~
138− u
139− [ p=[p=[p=%.n q=~ r=[%.n p=.127.0.0.1]] q=[p=~ q=<||>] r=~]
140− q=[p=[p=1 q=18] q=""]
141− ]
142− ]
143− ]
144− ~zod/main=> (auri:epur [1 1] "http://www.google.com/")
145− [ p=[p=1 q=23]
146− q
147− [ ~
148− u
149− [ p=[p=[p=%.n q=~ r=[%.y p=<|com google www|>]] q=[p=~ q=<||>] r=~]
150− q=[p=[p=1 q=23] q=""]
151− ]
152− ]
153− ]
154− ~zod/main=> (auri:epur [1 1] "https://www.google.com/")
155− [ p=[p=1 q=24]
156− q
157− [ ~
158− u
159− [ p=[p=[p=%.y q=~ r=[%.y p=<|com google www|>]] q=[p=~ q=<||>] r=~]
160− q=[p=[p=1 q=24] q=""]
161− ]
162− ]
163− ]
164− ~zod/main=> (auri:epur [1 1] "https//www.google.com/")
165− [ p=[p=1 q=6] q=~]
166− ~zod/main=> (auri:epur [1 1] "https://www.google.com:200/")
167− [ p=[p=1 q=28]
168− 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=""]]]
169− ]
170− ~zod/main=> (auri:epur [1 1] "https://www.google.com:200/search")
171− [ p=[p=1 q=34]
172− 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=""]]]
173− ]
174− ~zod/main=> (auri:epur [1 1] "https://www.google.com/search")
175− [ p=[p=1 q=30]
176− 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=""]]]
177− ]
178− ~zod/main=> (auri:epur [1 1] "https://www.google.com/search?q=urbit")
179− [ p=[p=1 q=38]
180− q
181− [ ~
182− u
183− [ p=[p=[p=%.y q=~ r=[%.y p=<|com google www|>]] q=[p=~ q=<|search|>] r=~[[p='q' q='urbit']]]
184− q=[p=[p=1 q=38] q=""]
185− ]
186− ]
187− ]
188− ~zod/main=> (auri:epur [1 1] "https://www.google.com/search?q=urb it")
189− [ p=[p=1 q=36]
190− q
191− [ ~
192− u
193− [ p=[p=[p=%.y q=~ r=[%.y p=<|com google www|>]] q=[p=~ q=<|search|>] r=~[[p='q' q='urb']]]
194− q=[p=[p=1 q=36] q=" it"]
195− ]
196− ]
197− ]
198− ~zod/main=> (auri:epur [1 1] "https://www.google.com/search?q=urb%20it")
199− [ p=[p=1 q=41]
200− q
201− [ ~
202− u
203− [ p=[p=[p=%.y q=~ r=[%.y p=<|com google www|>]] q=[p=~ q=<|search|>] r=~[[p='q' q='urb it']]]
204− q=[p=[p=1 q=41] q=""]
205− ]
206− ]
207− ]
208− ~zod/main=> (auri:epur [1 1] "https://www.google.com/search?q=urbit%20escaping%3F")
209− [ p=[p=1 q=52]
210− q
211− [ ~
212− u
213− [ p=[p=[p=%.y q=~ r=[%.y p=<|com google www|>]] q=[p=~ q=<|search|>] r=~[[p='q' q='urbit escaping?']]]
214− q=[p=[p=1 q=52] q=""]
215− ]
216− ]
217− ]
218−
219−### `++cock`
220−
221−HTTP cookies, results in associative list of cord to cord.
222−
223−Accepts
224−-------
225−
226−Produces
227−--------
228−
229−Source
230−------
231−
232− ++ cock :: cookie
233− (most ;~(plug sem ace) ;~(plug toke ;~(pfix tis tosk)))
234−
235−Examples
236−--------
237−
238− ~zod/try=> (scan "sam=lop" cock:epur)
239− [['sam' 'lop'] ~]
240− ~zod/try=> (scan "sam=lop; res=\"salo don -keg!mo\"" cock:epur)
241− [['sam' 'lop'] ~[['res' 'salo don -keg!mo']]]
242− ~zod/try=> (scan "sam=lop; res=\"salo don -keg!mo\"; so" cock:epur)
243− ! {1 34}
244− ! exit
245−
246−### `++dlab`
247−
248−Domain label: alphanumeric, with `-` allowed in middle.
249−
250−Accepts
251−-------
252−
253−Produces
254−--------
255−
256−Source
257−------
258−
259− ++ dlab :: 2396 domainlabel
260− %+ sear
261− |= a=@ta
262− ?.(=('-' (rsh 3 (dec (met 3 a)) a)) [~ u=a] ~)
263− %+ cook cass
264− ;~(plug aln (star alp))
265− ::
266−
267−Examples
268−--------
269−
270− ~zod/try=> (scan "google" dlab:epur)
271− ~.google
272− ~zod/try=> (scan "lera2" dlab:epur)
273− ~.lera2
274− ~zod/try=> (scan "gor-tem" dlab:epur)
275− ~.gor-tem
276− ~zod/try=> (scan "gortem-" dlab:epur)
277− ! {1 8}
278− ! exit
279−
280−### `++fque`
281−
282−One or more query string characters
283−
284−Accepts
285−-------
286−
287−Produces
288−--------
289−
290−Source
291−------
292−
293− ++ fque (cook crip (plus pquo)) :: normal query field
294−
295−Examples
296−--------
297−
298− ~zod/try=> (scan "%20" fque:epur)
299− ' '
300− ~zod/try=> (scan "sam" fque:epur)
301− 'sam'
302− ~zod/try=> (scan "les+tor" fque:epur)
303− 'les tor'
304− ~zod/try=> (scan "sore-%22mek%22" fque:epur)
305− 'sore-"mek"'
306− ~zod/try=> (scan "" fque:epur)
307− ! {1 1}
308− ! exit
309−
310−### `++fquu`
311−
312−Zero or more query string characters
313−
314−Accepts
315−-------
316−
317−Produces
318−--------
319−
320−Source
321−------
322−
323− ++ fquu (cook crip (star pquo)) :: optional field
324−
325−Examples
326−--------
327−
328− ~zod/try=> (scan "%20" fquu:epur)
329− ' '
330− ~zod/try=> (scan "sam" fquu:epur)
331− 'sam'
332− ~zod/try=> (scan "les+tor" fquu:epur)
333− 'les tor'
334− ~zod/try=> (scan "sore-%22mek%22" fquu:epur)
335− 'sore-"mek"'
336− ~zod/try=> (scan "" fquu:epur)
337− ''
338−
339−### `++pcar`
340−
341−Single URL path character: literal, `%` escape, subpath delimiter, `:`
342−or `@`
343−
344−Accepts
345−-------
346−
347−Produces
348−--------
349−
350−Source
351−------
352−
353− ++ pcar ;~(pose pure pesc psub col pat) :: 2396 path char
354−
355−Examples
356−--------
357−
358− ~zod/try=> (scan "a" pcar:epur)
359− ~~a
360− ~zod/try=> (scan "ab" pcar:epur)
361− ! {1 2}
362− ! exit
363− ~zod/try=> (scan "-" pcar:epur)
364− ~~-
365− ~zod/try=> (scan "." pcar:epur)
366− ~~~.
367− ~zod/try=> (scan "%20" pcar:epur)
368− ~~.
369− ~zod/try=> (scan "!" pcar:epur)
370− ~~~21.
371−
372−### `++pcok`
373−
374−Cookie character
375−
376−Accepts
377−-------
378−
379−Produces
380−--------
381−
382−Source
383−------
384−
385− ++ pcok ;~(less bas sem com doq prn) :: cookie char
386−
387−Examples
388−--------
389−
390− ~zod/try=> (scan "a" pcok:epur)
391− ~~a
392− ~zod/try=> (scan "ab" pcok:epur)
393− ! {1 2}
394− ! exit
395− ~zod/try=> (scan "!" pcok:epur)
396− ~~~21.
397− ~zod/try=> (scan ";" pcok:epur)
398− ! {1 2}
399− ! exit
400−
401−### `++pesc`
402−
403−URL `%` escape, by two hex characters.
404−
405−Accepts
406−-------
407−
408−Produces
409−--------
410−
411−Source
412−------
413−
414− ++ pesc ;~(pfix cen mes) :: 2396 escaped
415−
416−Examples
417−--------
418−
419− ~zod/try=> `@t`(scan "%22" pesc:epur)
420− '"'
421− ~zod/try=> `@t`(scan "%20" pesc:epur)
422− ' '
423−
424−### `++pold`
425−
426−Old URL `' '` escape
427−
428−Accepts
429−-------
430−
431−Produces
432−--------
433−
434−Source
435−------
436−
437− ++ pold (cold ' ' (just '+')) :: old space code
438−
439−Examples
440−--------
441−
442− ~zod/try=> `@t`(scan "+" pold:epur)
443− ' '
444− ~zod/try=> `@t`(scan " " pold:epur)
445− ! {1 1}
446− ! exit
447−
448−### `++pque`
449−
450−Irregular query string character.
451−
452−Accepts
453−-------
454−
455−Produces
456−--------
457−
458−Source
459−------
460−
461− ++ pque ;~(pose pcar fas wut) :: 3986 query char
462−
463−Examples
464−--------
465−
466− ~zod/try=> `@t`(scan "a" pque:epur)
467− 'a'
468− ~zod/try=> `@t`(scan "?" pque:epur)
469− '?'
470− ~zod/try=> `@t`(scan "%20" pque:epur)
471− ' '
472− ~zod/try=> `@t`(scan "+" pque:epur)
473− '+'
474−
475−### `++pquo`
476−
477−Character in query string key/value
478−
479−Accepts
480−-------
481−
482−Produces
483−--------
484−
485−Source
486−------
487−
488− ++ pquo ;~(pose pure pesc pold) :: normal query char
489−
490−Examples
491−--------
492−
493− ~zod/try=> (scan "a" pquo:epur)
494− 'a'
495− ~zod/try=> (scan "ab" pquo:epur)
496− ! {1 2}
497− ! exit
498− ~zod/try=> (scan "%22" pquo:epur)
499− '"'
500− ~zod/try=> (scan "%20" pquo:epur)
501− ' '
502− ~zod/try=> (scan "+" pquo:epur)
503− ' '
504−
505−### `++pure`
506−
507−URL-safe character
508−
509−Accepts
510−-------
511−
512−Produces
513−--------
514−
515−Source
516−------
517−
518− ++ pure ;~(pose aln hep dot cab sig) :: 2396 unreserved
519−
520−Examples
521−--------
522−
523− ~zod/try=> (scan "a" pure:epur)
524− ~~a
525− ~zod/try=> (scan "%20" pure:epur)
526− ! {1 1}
527− ! exit
528− ~zod/try=> (scan "." pure:epur)
529− ~~~.
530− ~zod/try=> (scan "-" pure:epur)
531− ~~-
532−
533−### `++psub`
534−
535−URL path subdelimeter
536−
537−Accepts
538−-------
539−
540−Produces
541−--------
542−
543−Source
544−------
545−
546− ++ psub ;~ pose :: 3986 sub-delims
547− zap buc pam soq pel per
548− tar lus com sem tis
549− ==
550−
551−Examples
552−--------
553−
554− ~zod/try=> `@t`(scan "+" psub:epur)
555− '+'
556− ~zod/try=> `@t`(scan "(" psub:epur)
557− '('
558− ~zod/try=> `@t`(scan "$" psub:epur)
559− '$'
560− ~zod/try=> `@t`(scan "a" psub:epur)
561− ! {1 1}
562− ! exit
563−
564−### `++ptok`
565−
566−Character valid in HTTP token
567−
568−Accepts
569−-------
570−
571−Produces
572−--------
573−
574−Source
575−------
576−
577− ++ ptok ;~ pose :: 2616 token
578− aln zap hax buc cen pam soq tar lus
579− hep dot ket cab tec bar sig
580− ==
581−
582−Examples
583−--------
584−
585− ~zod/try=> `tape`(murn =+(a=' ' |-(`tape`?:(=(0x7f a) ~ [a $(a +(a))]))) (curr rush ptok):epur)
586− "!#$%&'*+-.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ^_`abcdefghijklmnopqrstuvwxyz|~"
587− ~zod/try=> `tape`(skim =+(a=' ' |-(`tape`?:(=(0x7f a) ~ [a $(a +(a))]))) |=(a=char ?=(~ (rush a ptok:epur))))
588− " "(),/:;<=>?@[\]{}"
589−
590−### `++scem`
591−
592−URI scheme: alphabetic character, followed by any number of
593−alphanumeric, `+` `-` or `.`
594−
595−Accepts
596−-------
597−
598−Produces
599−--------
600−
601−Source
602−------
603−
604− ++ scem :: 2396 scheme
605− %+ cook cass
606− ;~(plug alf (star ;~(pose aln lus hep dot)))
607− ::
608−
609−Examples
610−--------
611−
612− ~zod/try=> `@t`(scan "http" scem:epur)
613− 'http'
614− ~zod/try=> `@t`(scan "https" scem:epur)
615− 'https'
616− ~zod/try=> `@t`(scan "chrome-extension" scem:epur)
617− 'chrome-extension'
618−
619−### `++smeg`
620−
621−URL path segment
622−
623−Accepts
624−-------
625−
626−Produces
627−--------
628−
629−Source
630−------
631−
632− ++ smeg (cook crip (plus pcar)) :: 2396 segment
633−
634−Examples
635−--------
636−
637− ~zod/try=> (scan "foo" smeg:epur)
638− 'foo'
639− ~zod/try=> (scan "bar%20baz-bam" smeg:epur)
640− 'bar baz-bam'
641−
642−### `++tock`
643−
644−HTTP cookie value
645−
646−Accepts
647−-------
648−
649−Produces
650−--------
651−
652−Source
653−------
654−
655− ++ tock (cook crip (plus pcok)) :: 6265 cookie-value
656−
657−Examples
658−--------
659−
660− ~zod/try=> (rush 'sam' tock:epur)
661− [~ 'sam']
662− ~zod/try=> (rush 'las!tore' tock:epur)
663− [~ 'las!tore']
664− ~zod/try=> (rush '"sop""les"tor' tock:epur)
665− ~
666− ~zod/try=> (rush '"zemug"' tock:epur)
667− ~
668−
669−### `++tosk`
670−
671−Possibly quoted HTTP cookie value
672−
673−Accepts
674−-------
675−
676−Produces
677−--------
678−
679−Source
680−------
681−
682− ++ tosk ;~(pose tock (ifix [doq doq] tock)) :: 6265 cookie-value
683−
684−Examples
685−--------
686−
687− ~zod/try=> (rush 'sam' tosk:epur)
688− [~ 'sam']
689− ~zod/try=> (rush 'las!tore' tosk:epur)
690− [~ 'las!tore']
691− ~zod/try=> (rush '"sop""les"tor' tosk:epur)
692− ~
693− ~zod/try=> (rush '"zemug"' tosk:epur)
694− [~ 'zemug']
695−
696−### `++toke`
697−
698−HTTP cookie name
699−
700−Accepts
701−-------
702−
703−Produces
704−--------
705−
706−Source
707−------
708−
709− ++ toke (cook crip (plus ptok)) :: 2616 token
710−
711−Examples
712−--------
713−
714− ~zod/try=> (rush 'sam' toke:epur)
715− [~ 'sam']
716− ~zod/try=> (rush 'las!tore' toke:epur)
717− [~ 'las!tore']
718− ~zod/try=> (rush 'sop""les"tor' toke:epur)
719− ~
720− ~zod/try=> (rush '"zemug"' toke:epur)
721− ~
722−
723−### `++thor`
724−
725−Parse ++host and unit `@ui` port.
726−
727−Accepts
728−-------
729−
730−Produces
731−--------
732−
733−Source
734−------
735−
736− ++ thor :: 2396 host/port
737− %+ cook |*(a=[* *] [+.a -.a])
738− ;~ plug
739− thos
740− ;~(pose (stag ~ ;~(pfix col dim:ag)) (easy ~))
741− ==
742−
743−Examples
744−--------
745−
746− ~zod/try=> (scan "localhost" thor:epur)
747− [~ [%.y i='localhost' t=~]]
748− ~zod/try=> (scan "localhost:8080" thor:epur)
749− [[~ q=8.080] [%.y i='localhost' t=~]]
750− ~zod/try=> (scan "192.168.0.1:8080" thor:epur)
751− [[~ q=8.080] [%.n q=3.232.235.521]]
752− ~zod/try=> (scan "www.google.com" thor:epur)
753− [~ [%.y i='com' t=~['google' 'www']]]
754−
755−### `++thos`
756−
757−URI host: dot-separated segments, or IP address.
758−
759−Accepts
760−-------
761−
762−Produces
763−--------
764−
765−Source
766−------
767−
768− ++ thos :: 2396 host, no local
769− ;~ plug
770− ;~ pose
771− %+ stag %&
772− %+ sear :: LL parser weak here
773− |= a=(list ,@t)
774− =+ b=(flop a)
775− ?> ?=(^ b)
776− =+ c=(end 3 1 i.b)
777− ?.(&((gte c 'a') (lte c 'z')) ~ [~ u=b])
778− (most dot dlab)
779− ::
780− %+ stag %|
781− =+ tod=(ape:ag ted:ab)
782− %+ bass 256
783− ;~(plug tod (stun [3 3] ;~(pfix dot tod)))
784− ==
785− ==
786−
787−Examples
788−--------
789−
790− ~zod/try=> (scan "localhost" thos:epur)
791− [%.y i='localhost' t=~]
792− ~zod/try=> (scan "192.168.0.1" thos:epur)
793− [%.n q=3.232.235.521]
794− ~zod/try=> (scan "192.168.0.1:80" thos:epur)
795− ! {1 12}
796− ! exit
797− ~zod/try=> (scan "www.google.com" thos:epur)
798− [%.y i='com' t=~['google' 'www']]
799−
800−### `++yque`
801−
802−Parses query string, or lack thereof. Result type ++quay
803−
804−Accepts
805−-------
806−
807−Produces
808−--------
809−
810−Source
811−------
812−
813− ++ yque :: query ending
814− ;~ pose
815− ;~(pfix wut yquy)
816− (easy ~)
817− ==
818−
819−Examples
820−--------
821−
822− ~zod/try=> (scan "?sar=tok" yque:epur)
823− [['sar' 'tok'] ~]
824− ~zod/try=> (scan "?les=urbit%20sep&met=kam" yque:epur)
825− [['les' 'urbit sep'] ~[['met' 'kam']]]
826− ~zod/try=> (scan "" yque:epur)
827− ~
828−
829−### `++yquy`
830−
831−Parse query string after `?`
832−
833−Accepts
834−-------
835−
836−Produces
837−--------
838−
839−Source
840−------
841−
842− ++ yquy :: query
843− ;~ pose :: proper query
844− %+ more
845− ;~(pose pam sem)
846− ;~(plug fque ;~(pose ;~(pfix tis fquu) (easy '')))
847− ::
848− %+ cook :: funky query
849− |=(a=tape [[%$ (crip a)] ~])
850− (star pque)
851− ==
852−
853−Examples
854−--------
855−
856− ~zod/try=> (scan "sar=tok" yquy:epur)
857− [['sar' 'tok'] ~]
858− ~zod/try=> (scan "les=urbit%20sep&met=kam" yquy:epur)
859− [['les' 'urbit sep'] ~[['met' 'kam']]]
860− ~zod/try=> (scan "" yquy:epur)
861− ~
862−
863−### `++zest`
864−
865−Parse ++quri absolute or relative request path
866−
867−Accepts
868−-------
869−
870−Produces
871−--------
872−
873−Source
874−------
875−
876− ++ zest :: 2616 request-uri
877− ;~ pose
878− (stag %& (cook |=(a=purl a) auri))
879− (stag %| ;~(plug apat yque))
880− ==
881− --
882−
883−Examples
884−--------
885−
886− ~zod/try=> (scan "http://www.google.com:80/search?q=foo" zest:epur)
887− [%.y p=[p=%.n q=[~ 80] r=[%.y p=<|com google www|>]] q=[p=~ q=<|search|>] r=~[[p='q' q='foo']]]
888− ~zod/try=> (scan "/rel/bat" zest:epur)
889− [%.n [p=~ q=<|rel bat|>] ~]
890−
reference/library/zuse/core/fu.udondeleted−73
@@ -1,73 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−3bA lite number theory
7−======================
8−
9−### `++fu`
10−
11− ++ fu :: modulo (mul p q)
12− |= a=[p=@ q=@]
13− =+ b=?:(=([0 0] a) 0 (~(inv fo p.a) (~(sit fo p.a) q.a)))
14− |%
15−
16−XX document
17−
18−### `++dif`
19−
20− ++ dif
21− |= [c=[@ @] d=[@ @]]
22− [(~(dif fo p.a) -.c -.d) (~(dif fo q.a) +.c +.d)]
23− ::
24−
25−XX document
26−
27−### `++exp`
28−
29− ++ exp
30− |= [c=@ d=[@ @]]
31− :- (~(exp fo p.a) (mod c (dec p.a)) -.d)
32− (~(exp fo q.a) (mod c (dec q.a)) +.d)
33− ::
34−
35−XX document
36−
37−### `++out`
38−
39− ++ out :: garner's formula
40− |= c=[@ @]
41− %+ add
42− +.c
43− (mul q.a (~(pro fo p.a) b (~(dif fo p.a) -.c (~(sit fo p.a) +.c))))
44− ::
45−
46−XX document
47−
48−### `++pro`
49−
50− ++ pro
51− |= [c=[@ @] d=[@ @]]
52− [(~(pro fo p.a) -.c -.d) (~(pro fo q.a) +.c +.d)]
53− ::
54−
55−XX document
56−
57−### `++sum`
58−
59− ++ sum
60− |= [c=[@ @] d=[@ @]]
61− [(~(sum fo p.a) -.c -.d) (~(sum fo q.a) +.c +.d)]
62− ::
63−
64−XX document
65−
66−### `++sit`
67−
68− ++ sit
69− |= c=@
70− [(mod c p.a) (mod c q.a)]
71−
72−XX document
73−
reference/library/zuse/core/jo.udondeleted−953
@@ -1,953 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−
7−### `++jo`
8−
9−JSON reparsing core
10−
11−Contains converters of [`++json`]() to [`++unit`]()s of well-typed structures.
12−
13−Accepts
14−-------
15−
16−A `fist` is a gate that produces a `grub`.
17−
18−A `grub` is a unit of some JSON value.
19−
20−Source
21−------
22−
23− ++ jo :: json reparser
24− => |% ++ grub (unit ,*)
25− ++ fist $+(json grub)
26− |%
27−
28−
29−### `++ar`
30−
31−Parse array to list
32−
33−Reparser modifier. Reparses an array to the [`++unit`]() of a homogenous
34−[`++list`]() using `wit` to reparse every element.
35−
36−`wit` is a [`++fist`](), a JSON reparser.
37−
38−
39−Accepts
40−-------
41−
42−A [`++fist`]().
43−
44−Produces
45−--------
46−
47−A [`++rule`]().
48−
49−Source
50−------
51− ++ ar :: array as list
52− |* wit=fist
53− |= jon=json
54− ?. ?=([%a *] jon) ~
55− %- zl
56− |-
57− ?~ p.jon ~
58− [i=(wit i.p.jon) t=$(p.jon t.p.jon)]
59− ::
60−
61−Examples
62−--------
63−
64− ~zod/try=> :type; ((ar ni):jo a/~[n/'1' n/'2'])
65− [~ u=~[1 2]]
66− {[%~ u=it(@)] %~}
67−
68−
69−### `++at`
70−
71−Reparse array as tuple
72−
73−Reparser generator. Reparses an array as a fixed-length tuple of
74−[`++unit`]()s, using a list of `++fist`s.
75−
76−Accepts
77−-------
78−
79−`wil` is a [`++pole`](), a [`face`]()less list of [`++fist`]()s.
80−
81−Produces
82−--------
83−
84−A [`++rule`]().
85−
86−Source
87−------
88−
89− ++ at :: array as tuple
90− |* wil=(pole fist)
91− |= jon=json
92− ?. ?=([%a *] jon) ~
93− =+ raw=((at-raw wil) p.jon)
94− ?.((za raw) ~ (some (zp raw)))
95− ::
96−
97−Examples
98−--------
99−
100− ~zod/try=> ((at ni so ni ~):jo a/~[n/'3' s/'to' n/'4'])
101− [~ u=[q=3 ~.to q=4]]
102− ~zod/try=> :type; ((at ni so ni ~):jo a/~[n/'3' s/'to' n/'4'])
103− [~ u=[q=3 ~.to q=4]]
104− {{[%~ u=[q=@ @ta q=@]] %~} %~}
105− ~zod/try=> ((at ni so ni ~):jo a/~[n/'3' s/'to' n/''])
106− ~
107−
108−### `++at-raw`
109−
110−Reparse array to tuple
111−
112−Reparser generator. Reparses a list of [`++json`]() with `wil` to a tuple of [`++unit`]()s.
113−
114−Accepts
115−-------
116−
117−`wil` is a [`++pole`](), a [face]()less list of [`++fist`]()s.
118−
119−Produces
120−--------
121−
122−A [`++rule`]().
123−
124−Source
125−------
126−
127− ++ at-raw :: array as tuple
128− |* wil=(pole fist)
129− |= jol=(list json)
130− ?~ wil ~
131− :- ?~(jol ~ (-.wil i.jol))
132− ((at-raw +.wil) ?~(jol ~ t.jol))
133− ::
134−
135−Examples
136−--------
137−
138− ~zod/try=> ((at-raw ni ni bo ~):jo ~[s/'hi' n/'1' b/&])
139− [~ [~ 1] [~ u=%.y] ~]
140−
141−### `++bo`
142−
143−Reparse boolean
144−
145−Reparser modifier. Reparses a boolean to the [`++unit`]() of a
146−boolean.
147−
148−Accepts
149−-------
150−
151−A [`++json`]().
152−
153−Produces
154−--------
155−
156−A [`++fist`]().
157−
158−Source
159−------
160−
161− ++ bo :: boolean
162− |=(jon=json ?.(?=([%b *] jon) ~ [~ u=p.jon]))
163− ::
164−
165−Examples
166−--------
167−
168− ~zod/try=> (bo:jo [%b &])
169− [~ u=%.y]
170− ~zod/try=> (bo:jo [%b |])
171− [~ u=%.n]
172− ~zod/try=> (bo:jo [%s 'hi'])
173− ~
174−
175−### `++bu`
176−
177−Reparse boolean not
178−
179−Reparser modifier. Reparses the inverse of a boolean to the [`++unit`]()
180−of a loobean.
181−
182−
183−Accepts
184−-------
185−
186−A [`++json`]().
187−
188−Produces
189−--------
190−
191−A [`++fist`]().
192−
193−Source
194−------
195−
196− ++ bu :: boolean not
197− |=(jon=json ?.(?=([%b *] jon) ~ [~ u=!p.jon]))
198− ::
199−
200−Examples
201−--------
202−
203− ~zod/try=> (bu:jo [%b &])
204− [~ u=%.n]
205− ~zod/try=> (bu:jo [%b |])
206− [~ u=%.y]
207− ~zod/try=> (bu:jo [%s 'hi'])
208− ~
209−
210−### `++cu`
211−
212−Reparse and transform
213−
214−Reparser modifier. Reparses `jon` and slams the result through `wit`,
215−producing a [`++unit`]().
216−
217−Accepts
218−-------
219−
220−`wit` is a [`++fist`]().
221−
222−`poq` is a [`gate`]() that accepts and returns a [noun]().
223−
224−Produces
225−--------
226−
227−A [`++fist`]().
228−
229−Source
230−------
231−
232− ++ cu :: transform
233− |* [poq=$+(* *) wit=fist]
234− |= jon=json
235− (bind (wit jon) poq)
236− ::
237−
238−Examples
239−--------
240−
241− ~zod/try=> ((cu dec ni):jo [%n '20'])
242− [~ 19]
243− ~zod/try=> ((cu dec ni):jo [%b &])
244− ~
245−
246−### `++da`
247−
248−Reparse UTC date
249−
250−Reparser modifier. Reparses a UTC date string to a [`++unit`]().
251−
252−Accepts
253−-------
254−
255−`jon` is a [`++json`]().
256−
257−Produces
258−--------
259−
260−A [`++fist`]().
261−
262−Source
263−------
264−
265− ++ da :: UTC date
266− |= jon=json
267− ?. ?=([%s *] jon) ~
268− (bind (stud (trip p.jon)) |=(a=date (year a)))
269− ::
270−
271−Examples
272−--------
273−
274− ~zod/try=> (da:jo [%s 'Wed, 29 Oct 2014 0:26:15 +0000'])
275− [~ ~2014.10.29..00.26.15]
276− ~zod/try=> (da:jo [%s 'Wed, 29 Oct 2012 0:26:15'])
277− [~ ~2012.10.29..00.26.15]
278− ~zod/try=> (da:jo [%n '20'])
279− ~
280−
281−### `++di`
282−
283−Reparse millisecond date
284−
285−Reparser modifier. Reparses the javascript millisecond date integer to a
286−[`++unit`]().
287−
288−Accepts
289−-------
290−
291−`jon` is a [`++json`]().
292−
293−Produces
294−--------
295−
296−A [`++fist`]().
297−
298−Source
299−------
300−
301− ++ di :: millisecond date
302− |= jon=json
303− %+ bind (ni jon)
304− |= a=@u ^- @da
305− (add ~1970.1.1 (div (mul ~s1 a) 1.000))
306− ::
307−
308−Examples
309−--------
310−
311− ~zod/try=> (di:jo [%s '2014-10-29'])
312− ~
313− ~zod/try=> (di:jo [%n '1414545548325'])
314− [~ ~2014.10.29..01.19.08..5333.3333.3333.3333]
315− ~zod/try=> (di:jo [%n '1414545615128'])
316− [~ ~2014.10.29..01.20.15..20c4.9ba5.e353.f7ce]
317− ~zod/try=> (di:jo [%n '25000'])
318− [~ ~1970.1.1..00.00.25]
319−
320−### `++mu`
321−
322−Reparse unit
323−
324−Reparser modifier. Reparses `wit` to a [`++unit`]().
325−
326−JSON units are considered to be either JSON null or the requested
327−value, and are reparsed to results of \~ or (some {value}) respectively.
328−
329−Accepts
330−-------
331−
332−`wit` is a [`++fist`]().
333−
334−Produces
335−--------
336−
337−A [`++fist`]().
338−
339−Source
340−------
341−
342− ++ mu :: true unit
343− |* wit=fist
344− |= jon=json
345− ?~(jon (some ~) (bind (wit jon) some))
346− ::
347−
348−Examples
349−--------
350−
351− ~zod/try=> ((mu ni):jo [%n '20'])
352− [~ [~ u=q=20]]
353− ~zod/try=> ((mu ni):jo [%n '15'])
354− [~ [~ u=q=15]]
355− ~zod/try=> ((mu ni):jo ~)
356− [~ u=~]
357− ~zod/try=> ((mu ni):jo [%s 'ma'])
358− ~
359−
360−### `++ne`
361−
362−Reparse number as real
363−
364−XX Currently unimplemented
365−
366−A- yup, this will eventually reparse a floating point atom, but
367−interfaces for the latter are not currently stable.
368−
369−### `++ni`
370−
371−Reparse number as integer
372−
373−Reparser modifier. Reparses an integer representation to a [`++unit]().
374−
375−Accepts
376−-------
377−
378−`jon` is a ++[`++json`]().
379−
380−Produces
381−--------
382−
383−The `++unit` of an atom.
384−
385−Source
386−------
387−
388− ++ ni :: number as integer
389− |= jon=json
390− ?. ?=([%n *] jon) ~
391− (rush p.jon dem)
392− ::
393−
394−Examples
395−--------
396−
397− ~zod/try=> (ni:jo [%n '0'])
398− [~ q=0]
399− ~zod/try=> (ni:jo [%n '200'])
400− [~ q=200]
401− ~zod/try=> (ni:jo [%n '-2.5'])
402− ~
403− ~zod/try=> (ni:jo [%s '10'])
404− ~
405− ~zod/try=> (ni:jo [%b |])
406− ~
407− ~zod/try=> (ni:jo [%n '4'])
408− [~ q=4]
409− ~zod/try=> (ni:jo [%a ~[b/& b/& b/& b/&]])
410− ~
411−
412−### `++no`
413−
414−Reparse number as text
415−
416−Reparser modifier. Reparses a numeric representation to a [++cord]().
417−
418−Accepts
419−-------
420−
421−`jon` is a `++json`.
422−
423−Produces
424−--------
425−
426−The [`++unit`]() of a `++cord`.
427−
428−Source
429−------
430−
431− ++ no :: number as text
432− |= jon=json
433− ?. ?=([%n *] jon) ~
434− (some p.jon)
435− ::
436−
437−Examples
438−--------
439−
440− ~zod/try=> (no:jo [%n '0'])
441− [~ u=~.0]
442− ~zod/try=> (no:jo [%n '200'])
443− [~ u=~.200]
444− ~zod/try=> (no:jo [%n '-2.5'])
445− [~ u=~.-2.5]
446− ~zod/try=> (no:jo [%s '10'])
447− ~
448− ~zod/try=> (no:jo [%b |])
449− ~
450− ~zod/try=> (no:jo [%n '4'])
451− [~ u=~.4]
452− ~zod/try=> (no:jo [%a ~[b/& b/& b/& b/&]])
453− ~
454−
455−### `++of`
456−
457−Reparse object to frond
458−
459−Reparser generator. Reparses an object, succeeding if it corresponds to
460−one of the key-value pairs in `wer`.
461−
462−Accepts
463−-------
464−
465−`wer` is a [`++pole`](), a [`++face`]()less list of [`++cord`]() and
466−[`++fist`]() key-value pairs.
467−
468−Produces
469−--------
470−
471−The [`++unit`]() of a cell of a.....
472−
473−Source
474−------
475−
476− ++ of :: object as frond
477− |* wer=(pole ,[cord fist])
478− |= jon=json
479− ?. ?=([%o [@ *] ~ ~] jon) ~
480− |-
481− ?~ wer ~
482− ?: =(-.-.wer p.n.p.jon)
483− ((pe -.-.wer +.-.wer) q.n.p.jon)
484− ((of +.wer) jon)
485− ::
486−
487−Examples
488−--------
489−
490− ~zod/try=> ((of sem/sa som/ni ~):jo %o [%sem s/'hi'] ~ ~)
491− [~ [%sem "hi"]]
492− ~zod/try=> ((of sem/sa som/ni ~):jo %o [%som n/'20'] ~ ~)
493− [~ [%som q=20]]
494− ~zod/try=> ((of sem/sa som/ni ~):jo %o [%som s/'he'] ~ ~)
495− ~
496− ~zod/try=> ((of sem/sa som/ni ~):jo %o [%som s/'5'] ~ ~)
497− ~
498− ~zod/try=> ((of sem/sa som/ni ~):jo %o [%sem s/'5'] ~ ~)
499− [~ [%sem "5"]]
500− ~zod/try=> ((of sem/sa som/ni ~):jo %o [%sem n/'2'] ~ ~)
501− ~
502− ~zod/try=> ((of sem/sa som/ni ~):jo %o [%sem b/&] ~ ~)
503− ~
504− ~zod/try=> ((of sem/sa som/ni ~):jo %a ~[s/'som' n/'4'])
505− ~
506− ~zod/try=> ((of sem/sa som/ni ~):jo %o [%sem s/'hey'] ~ [%sam s/'other value'] ~ ~)
507− ~
508−
509−### `++ot`
510−
511−Reparse object as tuple
512−
513−Reparser generator. For every key in `wer` that matches a key in the
514−[`++edge`], the fist in `wer` is applied to the corresponding value in
515−the [`++edge`](), the results of which are produced in a tuple.
516−
517−
518−Accepts
519−-------
520−
521−`wer` is a [`++pole`]() of [`++cord`]() to [`++fist`]() key-value pairs.
522−
523−Produces
524−--------
525−
526−A [`++unit`]() of a tuple XX?
527−
528−Source
529−------
530−
531− ++ ot :: object as tuple
532− |* wer=(pole ,[cord fist])
533− |= jon=json
534− ?. ?=([%o *] jon) ~
535− =+ raw=((ot-raw wer) p.jon)
536− ?.((za raw) ~ (some (zp raw)))
537− ::
538−
539−Examples
540−--------
541−
542− ~zod/try=> (jobe [%sem s/'ha'] [%som n/'20'] ~)
543− [%o p={[p='sem' q=[%s p=~.ha]] [p='som' q=[%n p=~.20]]}]
544− ~zod/try=> ((ot sem/sa som/ni sem/sa ~):jo (jobe [%sem s/'ha'] [%som n/'20'] ~))
545− [~ u=["ha" q=20 "ha"]]
546−
547−### `++ot-raw`
548−
549−Reparser generator. Reparses a map `jom` using `wer`; for every key in
550−`wer` that matches a key in `map`, the corresponding `++fist` is applied
551−to the corresponding value in `jom`, the results of which are produced
552−in a tuple.
553−
554−
555−Accepts
556−-------
557−
558−`wer` is a [`++pole`]() of [`++cord`]() to [`++fist`]() key-value pairs.
559−
560−Produces
561−--------
562−
563−A [`++unit`]() of.
564−
565−Source
566−------
567−
568− ++ ot-raw :: object as tuple
569− |* wer=(pole ,[cord fist])
570− |= jom=(map ,@t json)
571− ?~ wer ~
572− =+ ten=(~(get by jom) -.-.wer)
573− [?~(ten ~ (+.-.wer u.ten)) ((ot-raw +.wer) jom)]
574− ::
575−
576−Examples
577−--------
578−
579− ~zod/try=> ((ot-raw sem/sa som/ni sem/sa ~):jo (mo [%sem s/'ha'] [%som n/'20'] ~))
580− [[~ u="ha"] [~ q=20] [~ u="ha"] ~]
581− ~zod/try=> ((ot-raw sem/sa som/ni sem/sa ~):jo (mo [%sem s/'ha'] [%som b/|] ~))
582− [[~ u="ha"] ~ [~ u="ha"] ~]
583−
584−### `++om`
585−
586−Parse object to map
587−
588−Reparser modifier. Reparses a [`++json`]() object to a homogenous map
589−using `wit`.
590−
591−Accepts
592−-------
593−
594−`wit` is a [`++fist`]().
595−
596−Produces
597−--------
598−
599−A [`++unit`]() of...
600−
601−Source
602−------
603−
604− ++ om :: object as map
605− |* wit=fist
606− |= jon=json
607− ?. ?=([%o *] jon) ~
608− (zm ~(run by p.jon) wit)
609− ::
610−
611−Examples
612−--------
613−
614− ~zod/try=> ((om ni):jo (jobe [%sap n/'20'] [%sup n/'5'] [%sop n/'177'] ~))
615− [~ {[p='sup' q=q=5] [p='sop' q=q=177] [p='sap' q=q=20]}]
616− ~zod/try=> ((om ni):jo (jobe [%sap n/'20'] [%sup n/'0x5'] [%sop n/'177'] ~))
617− ~
618−
619−### `++pe`
620−
621−Add prefix
622−
623−Reparser modifier. Adds a static prefix `pre` to the parse result of
624−`wit`. See also: [`++stag`]().
625−
626−Accepts
627−-------
628−
629−`pre` is a prefix [`noun`]().
630−
631−Produces
632−--------
633−
634−The [`++unit`]() of a cell of [noun]() and the result of parsing `wit`.
635−
636−Source
637−------
638−
639− ++ pe :: prefix
640− |* [pre=* wit=fist]
641− (cu |*(a=* [pre a]) wit)
642− ::
643−
644−Examples
645−--------
646−
647− ~zod/try=> (ni:jo n/'2')
648− [~ q=2]
649− ~zod/try=> (ni:jo b/|)
650− ~
651− ~zod/try=> ((pe %hi ni):jo n/'2')
652− [~ [%hi q=2]]
653− ~zod/try=> ((pe %hi ni):jo b/|)
654− ~
655−
656−### `++sa`
657−
658−Reparse string to tape
659−
660−Reparser modifier. Reparses a [`++json`]() string to a [`++tape`]().
661−
662−Accepts
663−-------
664−
665−`jon` is a [`++json`]().
666−
667−Produces
668−--------
669−
670−The [`++unit`]() of a [`++tape`]().
671−
672−Source
673−------
674−
675− ++ sa :: string as tape
676− |= jon=json
677− ?.(?=([%s *] jon) ~ (some (trip p.jon)))
678− ::
679−
680−Examples
681−--------
682−
683− ~zod/try=> (sa:jo s/'value')
684− [~ u="value"]
685− ~zod/try=> (sa:jo n/'46')
686− ~
687− ~zod/try=> (sa:jo a/~[s/'val 2'])
688− ~
689−
690−### `++so`
691−
692−Reparse string to cord
693−
694−Reparser modifier. Reparses a string to a [`++cord`]().
695−
696−Accepts
697−-------
698−
699−`jon` is a [`++json`]().
700−
701−Produces
702−--------
703−
704−The [`++unit`]() of a [`++cord`]().
705−
706−Source
707−------
708−
709− ++ so :: string as cord
710− |= jon=json
711− ?.(?=([%s *] jon) ~ (some p.jon))
712− ::
713−
714−Examples
715−--------
716−
717− ~zod/try=> (so:jo s/'value')
718− [~ u=~.value]
719− ~zod/try=> (so:jo n/'46')
720− ~
721− ~zod/try=> (so:jo a/~[s/'val 2'])
722− ~
723−
724−### `++su`
725−
726−Reparse string
727−
728−Reparser generator. Produces a reparser that applies `sab` to a string.
729−
730−Accepts
731−-------
732−
733−`sab` is a [`++rule`].
734−
735−Produces
736−--------
737−
738−A [`++rule`]().
739−
740−Source
741−------
742−
743− ++ su :: parse string
744− |* sab=rule
745− |= jon=json
746− ?. ?=([%s *] jon) ~
747− (rush p.jon sab)
748− ::
749−
750−Examples
751−--------
752−
753− ~zod/try=> ((su:jo fed:ag) s/'zod')
754− [~ 0]
755− ~zod/try=> ((su:jo fed:ag) s/'doznec')
756− [~ 256]
757− ~zod/try=> ((su:jo fed:ag) s/'notship')
758− ~
759− ~zod/try=> ((su:jo fed:ag) n/'20')
760− ~
761−
762−### `++ul`
763−
764−Reparse null
765−
766−Reparser modifier. Reparses a null value.
767−
768−Accepts
769−-------
770−
771−`jon` is a [`++json`]().
772−
773−Produces
774−--------
775−
776−The [`++unit`]() of null.
777−
778−Source
779−------
780−
781− ++ ul |=(jon=json ?~(jon (some ~) ~)) :: null
782−
783−Examples
784−--------
785−
786− ~zod/try=> (ul:jo `json`~)
787− [~ u=~]
788− ~zod/try=> (ul:jo s/'null')
789− ~
790− ~zod/try=> (ul:jo b/|)
791− ~
792− ~zod/try=> (ul:jo b/&)
793− ~
794−
795−### `++za`
796−
797−Pole of nonempty units
798−
799−Determines if `pod` contains all non-empty units, producing a boolean. Used
800−internally.
801−
802−Accepts
803−-------
804−
805−`pod` is a [`++pole`]() of [`++unit`]().
806−
807−Produces
808−--------
809−
810−A boolean.
811−
812−Source
813−------
814−
815− ++ za :: full unit pole
816− |* pod=(pole (unit))
817− ?~ pod &
818− ?~ -.pod |
819− (za +.pod)
820− ::
821−
822−Examples
823−--------
824−
825− ~zod/try=> (za:jo ~[`1 `2 `3])
826− %.y
827− ~zod/try=> (za:jo ~[`1 ~ `3])
828− %.n
829−
830−### `++zl`
831−
832−Collapse unit list
833−
834−Produces a unit of the values of `lut` if every unit in `lut` is
835−nonempty. Otherwise, produces `~`.
836−
837−Accepts
838−-------
839−
840−`lut` is a [`++list`]() of [`++unit`]()s.
841−
842−Produces
843−--------
844−
845−A boolean.
846−
847−Source
848−------
849−
850− ++ zl :: collapse unit list
851− |* lut=(list (unit))
852− ?. |- ^- ?
853− ?~(lut & ?~(i.lut | $(lut t.lut)))
854− ~
855− %- some
856− |-
857− ?~ lut ~
858− [i=u:+.i.lut t=$(lut t.lut)]
859− ::
860−
861−Examples
862−--------
863−
864− ~zod/try=> (zl:jo `(list (unit))`~[`1 `2 `3])
865− [~ u=~[1 2 3]]
866− ~zod/try=> (zl:jo `(list (unit))`~[`1 `17 `3])
867− [~ u=~[1 17 3]]
868− ~zod/try=> (zl:jo `(list (unit))`~[`1 ~ `3])
869− ~
870−
871−### `++zp`
872−
873−XX
874−
875−Collapses a `++pole` of `++unit`s `but`, producing a tuple.
876−
877−Accepts
878−-------
879−
880−`but` is a [`++pole`]() of [`++unit`]().
881−
882−Produces
883−--------
884−
885−??
886−
887−Source
888−------
889−
890− ++ zp :: unit tuple
891− |* but=(pole (unit))
892− ?~ but !!
893− ?~ +.but
894− u:->.but
895− [u:->.but (zp +.but)]
896− ::
897−
898−Examples
899−--------
900−
901− ~zod/try=> (zp:jo `(pole (unit))`~[`1 `2 `3])
902− [1 2 3]
903− ~zod/try=> (zp:jo `(pole (unit))`~[`1 `17 `3])
904− [1 17 3]
905− ~zod/try=> (zp:jo `(pole (unit))`~[`1 ~ `3])
906− ! exit
907−
908−### `++zm`
909−
910−Collapse unit map
911−
912−Produces a [`++unit`]() of the [`++map`]() `lum` of term to `++unit` key value
913−pairs, with all of the nonempty values stripped of their `++unit`
914−wrappers. If any of the `++units` in `lum` are empty, `~` is produced.
915−See also: [`++zp`](), [`++zl`]().
916−
917−Accepts
918−-------
919−
920−`lum` is a map of [`++term`]() to [`++unit`]()s.
921−
922−Produces
923−--------
924−
925−The `++unit` of a tuple of what were the key-value pairs of `lum`.
926−
927−Source
928−------
929−
930− ++ zm :: collapse unit map
931− |* lum=(map term (unit))
932− ?: (~(rep by lum) | |=([[@ a=(unit)] b=?] |(b ?=(~ a))))
933− ~
934− (some (~(run by lum) need))
935− ::
936−
937−Examples
938−--------
939−
940− ~zod/try=> (zm:jo `(map term (unit ,@u))`(mo a/`4 b/`1 c/`2 ~))
941− [~ {[p=%a q=4] [p=%c q=2] [p=%b q=1]}]
942− ~zod/try=> (zm:jo `(map term (unit ,@u))`(mo a/`4 b/~ c/`2 ~))
943− ~
944− ~zod/try=> (~(run by `(map ,@t ,@u)`(mo a/1 b/2 c/3 ~)) (flit |=(a=@ (lth a 5))))
945− {[p='a' q=[~ u=1]] [p='c' q=[~ u=3]] [p='b' q=[~ u=2]]}
946− ~zod/try=> (zm:jo (~(run by `(map ,@t ,@u)`(mo a/1 b/2 c/3 ~)) (flit |=(a=@ (lth a 5)))))
947− [~ {[p='a' q=1] [p='c' q=3] [p='b' q=2]}]
948− ~zod/try=> (zm:jo (~(run by `(map ,@t ,@u)`(mo a/1 b/7 c/3 ~)) (flit |=(a=@ (lth a 5)))))
949− ~
950− ~zod/try=> (~(run by `(map ,@t ,@u)`(mo a/1 b/7 c/3 ~)) (flit |=(a=@ (lth a 5))))
951− {[p='a' q=[~ u=1]] [p='c' q=[~ u=3]] [p='b' q=~]}
952−
953−
reference/library/zuse/core/poja.udondeleted−720
@@ -1,720 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−### `++poja`
7−
8−JSON parser core
9−
10−JSON parser core: parses a [`++cord`]() `a` to the hoon structure for JSON,
11−a [`++json`]().
12−
13−Accepts
14−-------
15−
16−`a` is [`++cord`]().
17−
18−Produces
19−--------
20−
21−
22−A `(like json)`.
23−
24−Source
25−------
26−
27− ++ poja :: JSON parser core
28− =< |=(a=cord (rush a apex))
29− |%
30−
31−Examples
32−--------
33−
34− ~zod/try=> (poja '[1,2,3]')
35− [~ [%a p=~[[%n p=~.1] [%n p=~.2] [%n p=~.3]]]]
36− ~zod/try=> (poja 'null')
37− [~ ~]
38− ~zod/try=> (poja 'invalid{json')
39− ~
40−
41−### `++tops`
42−
43−Parse object
44−
45−Top level parsing [`++rule`](). Parses either a single JSON object, or an array
46−of JSON objects to a [`++json`](). See also: [`++abox`](), [`++obox`]().
47−
48−Accepts
49−-------
50−
51−A [`++nail`]().
52−
53−Produces
54−--------
55−
56−A `(like json)`.
57−
58−Source
59−------
60−
61− ++ apex ;~(pose abox obox) :: JSON object
62−
63−Examples
64−--------
65−
66− ~zod/try=> (rash '[1,2]' apex:poja)
67− [%a p=~[[%n p=~.1] [%n p=~.2]]]
68− ~zod/try=> (rash '{"sam": "kot"}' apex:poja)
69− [%o p={[p=~.sam q=[%s p=~.kot]]}]
70− ~zod/try=> (rash 'null' apex:poja)
71− ! {1 1}
72− ! exit
73−
74−### `++apex`
75−
76−Parse value
77−
78−Parsing [`++rule`](). Parses JSON values to [`++json`]().
79−
80−Accepts
81−-------
82−
83−A [`++nail`]().
84−
85−Produces
86−--------
87−
88−A `(like json)`.
89−
90−Source
91−------
92−
93− ++ valu :: JSON value
94− %+ knee *json |. ~+
95− ;~ pfix spac
96− ;~ pose
97− (cold ~ (jest 'null'))
98− (jify %b bool)
99− (jify %s stri)
100− (cook |=(s=tape [%n p=(rap 3 s)]) numb)
101− abox
102− obox
103− ==
104− ==
105−
106−Examples
107−--------
108−
109− ~zod/try=> (rash '[1,2]' valu:poja)
110− [%a p=~[[%n p=~.1] [%n p=~.2]]]
111− ~zod/try=> (rash '{"sam": "kot"}' valu:poja)
112− [%o p={[p='sam' q=[%s p=~.kot]]}]
113− ~zod/try=> (rash 'null' valu:poja)
114− ~
115− ~zod/try=> (rash '20' valu:poja)
116− [%n p=~.20]
117− ~zod/try=> (rash '"str"' valu:poja)
118− [%s p=~.str]
119− ~zod/try=> (rash 'true' valu:poja)
120− [%b p=%.y]
121−
122−### `++abox`
123−
124−Parse array
125−
126−Parsing rule. Parses a JSON array with values enclosed within `[]` and
127−delimited by a `,`.
128−
129−Accepts
130−-------
131−
132−A [`++nail`]().
133−
134−Produces
135−--------
136−
137−A `(like json)`.
138−
139−Source
140−------
141−
142− ++ abox (stag %a (ifix [sel (ws ser)] (more (ws com) valu)))
143−
144−Examples
145−--------
146−
147− ~zod/try=> (rash '[1, 2,4]' abox:poja)
148− [[%n p=~.1] ~[[%n p=~.2] [%n p=~.4]]]
149−
150−JSON Objects
151−------------
152−
153−### `++pair`
154−
155−Parse key value pair
156−
157−Parsing rule. Parses a [`++json`]() from a JSON key-value pair of a
158−string and value delimited by `:`.
159−
160−Accepts
161−-------
162−
163−A [`++nail`]().
164−
165−Produces
166−--------
167−
168−A `(like json)`.
169−
170−Source
171−------
172−
173− ++ pair ;~(plug ;~(sfix (ws stri) (ws col)) valu)
174−
175−Examples
176−--------
177−
178− ~zod/try=> (rash '"ham": 2' pair:poja)
179− ['ham' [%n p=~.2]]
180−
181−### `++obje`
182−
183−Parse array of objects
184−
185−Parsing rule. Parses a [`++json`]() from an array of JSON object
186−key-value pairs that are enclosed within `{}` and separated by `,`.
187−
188−Accepts
189−-------
190−
191−A [`++nail`]().
192−
193−Produces
194−--------
195−
196−A `(like ,[%o p=(map ,@t json)])`
197−
198−Source
199−------
200−
201− ++ obje (ifix [(ws kel) (ws ker)] (more (ws com) pair))
202−
203−Examples
204−--------
205−
206− ~zod/try=> (rash '{"ham": 2, "lam":true}' obje:poja)
207− [['ham' [%n p=~.2]] ~[['lam' [%b p=%.y]]]]
208−
209−### `++obox`
210−
211−Parse boxed object
212−
213−Parsing rule. Parses an array of JSON objects to an object of [`++json`](). See also: [`++json`]().
214−
215−Accepts
216−-------
217−
218−A [`++nail`]().
219−
220−Produces
221−--------
222−
223−A `(like ,[%o p=(map ,@t json)])`
224−
225−Source
226−------
227−
228− ++ obox (stag %o (cook mo obje))
229−
230−Examples
231−--------
232−
233− ~zod/try=> (rash '{"ham": 2, "lam":true}' obox:poja)
234− [%o {[p='lam' q=[%b p=%.y]] [p='ham' q=[%n p=~.2]]}]
235−
236−JSON Booleans
237−-------------
238−
239−### `++bool`
240−
241−Parse boolean
242−
243−Parsing rule. Parses a string of either `true` or `false` to a
244−[`++json`]() boolean.
245−
246−
247−Accepts
248−-------
249−
250−A [`++nail`]().
251−
252−Produces
253−--------
254−
255−
256−A `(like ,[%b p=?])`
257−
258−Source
259−------
260−
261− ++ bool ;~(pose (cold & (jest 'true')) (cold | (jest 'false')))
262−
263−Examples
264−--------
265−
266− ~zod/try=> (rash 'true' bool:poja)
267− %.y
268− ~zod/try=> (rash 'false' bool:poja)
269− %.n
270− ~zod/try=> (rash 'null' bool:poja)
271− ! {1 1}
272− ! exit
273−
274−JSON strings
275−------------
276−
277−### `++stri`
278−
279−Parse string
280−
281−Parsing rule. Parse a string to a [`++cord`](). A JSON string is a list
282−of characters enclosed in double quotes along with escaping `\`s, to a
283−[`++cord`](). See also [`++jcha`]().
284−
285−Accepts
286−-------
287−
288−A [`++nail`]().
289−
290−Produces
291−--------
292−
293−A `(like ,[%s p=@t])`.
294−
295−Source
296−------
297−
298− ++ stri
299− (cook crip (ifix [doq doq] (star jcha)))
300−
301−Examples
302−--------
303−
304− ~zod/try=> (rash '"ham"' stri:poja)
305− 'ham'
306− ~zod/try=> (rash '"h\\nam"' stri:poja)
307− 'h
308− am'
309− ~zod/try=> (rash '"This be \\"quoted\\""' stri:poja)
310− 'This be "quoted"'
311−
312−### `++jcha`
313−
314−Parse char from string
315−
316−Parsing rule. Parses either a literal or escaped character from a JSON
317−string to a [`++cord`]().
318−
319−
320−Accepts
321−-------
322−
323−A [`++nail`]().
324−
325−Produces
326−--------
327−
328−A `(like cord)`.
329−
330−Source
331−------
332−
333− ++ jcha ;~(pose ;~(less doq bas prn) esca) :: character in string
334−
335−Examples
336−--------
337−
338− ~zod/try=> (rash 'a' jcha:poja)
339− 'a'.
340− ~zod/try=> (rash '!' jcha:poja)
341− '!'
342− ~zod/try=> (rash '\\"' jcha:poja)
343− '"'
344− ~zod/try=> (rash '\\u00a4' jcha:poja)
345− '¤'
346− ~zod/try=> (rash '\\n' jcha:poja)
347− '
348− '
349−
350−### `++esca`
351−
352−Parse escaped char
353−
354−Parsing rule. Parses a backslash-escaped special character, low ASCII,
355−or UTF16 codepoint, to a [`++cord`]().
356−
357−
358−Accepts
359−-------
360−
361−A [`++nail`]().
362−
363−Produces
364−--------
365−
366−A `(like cord)`.
367−
368−Source
369−------
370−
371− ++ esca :: Escaped character
372− ;~ pfix bas
373− ;~ pose
374− doq fas soq bas
375− (sear ~(get by `(map ,@t ,@)`(mo b/8 t/9 n/10 f/12 r/13 ~)) low)
376− ;~(pfix (just 'u') (cook tuft qix:ab)) :: 4-digit hex to UTF-8
377− ==
378−
379−Examples
380−--------
381−
382− ~zod/try=> (rash 'b' esca:poja)
383− ! {1 1}
384− ! exit
385− ~zod/try=> (rash '\n' esca:poja)
386− ~ <syntax error at [1 9]>
387− ~zod/try=> (rash '\\n' esca:poja)
388− '
389− '
390− ~zod/try=> `@`(rash '\\r' esca:poja)
391− 13
392− ~zod/try=> (rash '\\u00c4' esca:poja)
393− 'Ä'
394− ~zod/try=> (rash '\\u00df' esca:poja)
395− 'ß'
396−
397−JSON numbers
398−------------
399−
400−A JSON numbers are stored as cords internally in lieu of full float
401−support, so ++numb and subarms are really more *validators* than parsers
402−per se.
403−
404−### `++numb`
405−
406−Parse number
407−
408−Parsing rule. Parses decimal numbers with an optional `-`, fractional
409−part, or exponent part, to a [`++tape`]().
410−
411−Accepts
412−-------
413−
414−A [`++nail`]().
415−
416−Produces
417−--------
418−
419−An [`++edge`]() of a [`++tape`]().
420−
421−Source
422−------
423−
424− ++ numb
425− ;~ (comp twel)
426− (mayb (piec hep))
427− ;~ pose
428− (piec (just '0'))
429− ;~(plug (shim '1' '9') digs)
430− ==
431− (mayb frac)
432− (mayb expo)
433− ==
434−
435−Examples
436−--------
437−
438− ~zod/try=> (rash '0' numb:poja)
439− ~[~~0]
440− ~zod/try=> (rash '1' numb:poja)
441− ~[~~1]
442− ~zod/try=> `tape`(rash '1' numb:poja)
443− "1"
444− ~zod/try=> `tape`(rash '12.6' numb:poja)
445− "12.6"
446− ~zod/try=> `tape`(rash '-2e20' numb:poja)
447− "-2e20"
448− ~zod/try=> `tape`(rash '00e20' numb:poja)
449− ! {1 2}
450− ! exit
451−
452−### `++digs`
453−
454−Parse 1-9
455−
456−Parsing rule. Parses digits `0` through `9` to a [`++tape`]().
457−
458−Accepts
459−-------
460−
461−A [`++nail`]().
462−
463−Produces
464−--------
465−
466−The [`++edge`]() of a `++tape`.
467−
468−Source
469−------
470−
471− ++ digs (star (shim '0' '9'))
472−
473−Examples
474−--------
475−
476− ~zod/try=> (rash '' digs:poja)
477− ""
478− ~zod/try=> (rash '25' digs:poja)
479− "25"
480− ~zod/try=> (rash '016' digs:poja)
481− "016"
482− ~zod/try=> (rash '7' digs:poja)
483− "7"
484−
485−### `++expo`
486−
487−Parse exponent part
488−
489−Parsing rule. Parses an exponent to a [`++tape`]() .An exponent is an
490−`e` or 'E', followed by an optional `+` or `-`, and then by digits.
491−
492−Accepts
493−-------
494−
495−A [`++nail`]().
496−
497−Produces
498−--------
499−
500−The [`++edge`]() of a `++tape`.
501−
502−Source
503−------
504−
505− ++ expo :: Exponent part
506− ;~ (comp twel)
507− (piec (mask "eE"))
508− (mayb (piec (mask "+-")))
509− digs
510− ==
511−
512−Examples
513−--------
514−
515− ~zod/try=> `tape`(rash 'e7' expo:poja)
516− "e7"
517− ~zod/try=> `tape`(rash 'E17' expo:poja)
518− "E17"
519− ~zod/try=> `tape`(rash 'E-4' expo:poja)
520− "E-4"
521−
522−### `++frac`
523−
524−Fractional part
525−
526−Parsing rule. Parses a dot followed by digits to a [`++cord`]().
527−
528−Accepts
529−-------
530−
531−A `++nail`.
532−
533−Produces
534−--------
535−
536−The [`++edge`]() of a `++tape`.
537−
538−Source
539−------
540−
541− ++ frac ;~(plug dot digs) :: Fractional part
542−
543−Examples
544−--------
545−
546− ~zod/try=> (rash '.25' frac:poja)
547− [~~~. "25"]
548− ~zod/try=> (rash '.016' frac:poja)
549− [~~~. "016"]
550− ~zod/try=> (rash '.7' frac:poja)
551− [~~~. "7"]
552−
553−whitespace
554−----------
555−
556−### `++spac`
557−
558−Parse whitespace
559−
560−Parsing rule. Parses a whitespace to a [`++tape`]().
561−
562−Accepts
563−-------
564−
565−A [`++nail`]().
566−
567−Produces
568−--------
569−
570−A `(like tape)`.
571−
572−Source
573−------
574−
575− ++ spac (star (mask [`@`9 `@`10 `@`13 ' ' ~]))
576−
577−Examples
578−--------
579−
580− ~zod/try=> (scan "" spac:poja)
581− ""
582− ~zod/try=> (scan " " spac:poja)
583− " "
584− ~zod/try=> `*`(scan `tape`~[' ' ' ' ' ' `@`9 ' ' ' ' `@`13] spac:poja)
585− [32 32 32 9 32 32 13 0]
586− ~zod/try=> (scan " m " spac:poja)
587− ! {1 4}
588− ! exit
589−
590−### `++ws`
591−
592−Allow prefix whitespace
593−
594−Parser modifier. Produces a rule that allows for a whitespace before
595−applying `sef`.
596−
597−Accepts
598−-------
599−
600−`sef` is a [`++rule`]().
601−
602−Produces
603−--------
604−
605−A `++rule`.
606−
607−Source
608−------
609−
610− ++ ws |*(sef=_rule ;~(pfix spac sef))
611−
612−Examples
613−--------
614−
615− ~zod/try=> (rash ' 4' digs:poja)
616− ! {1 1}
617− ! exit
618− ~zod/try=> (rash ' 4' (ws digs):poja)
619− "4"
620− ~zod/try=> (rash '''
621−
622− 4
623− ''' (ws digs):poja)
624− "4"
625−
626−Plumbing
627−--------
628−
629−### `++mayb`
630−
631−Maybe parse
632−
633−Parser modifier. Need to document, an example showing failure.
634−
635−Accepts
636−-------
637−
638−XX
639−
640−Produces
641−--------
642−
643−XX
644−
645−Source
646−------
647−
648− ++ mayb |*(bus=_rule ;~(pose bus (easy "")))
649−
650−Examples
651−--------
652−
653− ~zod/try=> (abox:poja 1^1 "not-an-array")
654− [p=[p=1 q=1] q=~]
655− ~zod/try=> ((mayb abox):poja 1^1 "not-an-array")
656− [p=[p=1 q=1] q=[~ [p="" q=[p=[p=1 q=1] q="not-an-array"]]]]
657−
658−### `++twel`
659−
660−Weld two tapes
661−
662−Concatenates two tapes, `a` and `b`, producing a [`++tape`]().
663−
664−Accepts
665−-------
666−
667−`a` is a [`++tape`]().
668−
669−`b` is a [`++tape`]().
670−
671−Produces
672−--------
673−
674−The [`++edge`]() of a `++tape`.
675−
676−Source
677−------
678−
679− ++ twel |=([a=tape b=tape] (weld a b))
680−
681−Examples
682−--------
683−
684− ~zod/try=> (twel "sam" "hok"):poja
685− ~[~~s ~~a ~~m ~~h ~~o ~~k]
686− ~zod/try=> (twel "kre" ""):poja
687− ~[~~k ~~r ~~e]
688−
689−### `++piec`
690−
691−Parse char to list
692−
693−Parser modifer. Parses an atom with `bus` and then wraps it in a
694−[`++list`]().
695−
696−Accepts
697−-------
698−
699−`bus` is a [`++rule`]().
700−
701−Produces
702−--------
703−
704−A `++rule`.
705−
706−Source
707−------
708−
709− ++ piec
710− |* bus=_rule
711− (cook |=(a=@ [a ~]) bus)
712− ::
713−
714−Examples
715−--------
716−
717− d~zod/try=> (scan "4" (piec:poja dem:ag))
718− [4 ~]
719−
720−
reference/library/zuse/core/poxa.udondeleted−445
@@ -1,445 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−### `++poxa`
7−
8−Parse XML
9−
10−Parses an XML node from a [`++cord`](), producing a [`++unit`]() [`++manx`]().
11−
12−Accepts
13−-------
14−
15−`a` is a [`++cord`]().
16−
17−Produces
18−--------
19−
20−A `(unit manx)`.
21−
22−Source
23−------
24−
25− ++ poxa :: xml parser
26− =< |=(a=cord (rush a apex))
27− |%
28−
29−Examples
30−--------
31−
32− ~zod/try=> (poxa '<div />')
33− [~ [g=[n=%div a=~] c=~]]
34− ~zod/try=> (poxa '<html><head/> <body/></html>')
35− [~ [g=[n=%html a=~] c=~[[g=[n=%head a=~] c=~] [g=[n=%body a=~] c=~]]]]
36− ~zod/try=> (poxa '<script src="/gep/hart.js"/>')
37− [~ [g=[n=%script a=~[[n=%src v="/gep/hart.js"]]] c=~]]
38− ~zod/try=> (poxa '<<<<')
39− ~
40−
41−### `++apex`
42−
43−Top level parser
44−
45−Parses a node of XML, type [`++manx`]().
46−
47−Accepts
48−-------
49−
50−A [`++nail`]().
51−
52−Produces
53−--------
54−
55−A `++manx`.
56−
57−Source
58−------
59−
60− ++ apex
61− =+ spa=;~(pose comt whit)
62− %+ knee *manx |. ~+
63− %+ ifix [(star spa) (star spa)]
64− ;~ pose
65− %+ sear |=([a=marx b=marl c=mane] ?.(=(c n.a) ~ (some [a b])))
66− ;~(plug head (more (star comt) ;~(pose apex chrd)) tail)
67− empt
68− ==
69− ::
70−
71−Examples
72−--------
73−
74− ~zod/try=> (rash '<div />' apex:poxa)
75− [g=[n=%div a=~] c=~]
76− ~zod/try=> (rash '<html><head/> <body/></html>' apex:poxa)
77− [g=[n=%html a=~] c=~[[g=[n=%head a=~] c=~] [g=[n=%body a=~] c=~]]]
78− ~zod/try=> (rash '<script src="/gep/hart.js"/>' apex:poxa)
79− [g=[n=%script a=~[[n=%src v="/gep/hart.js"]]] c=~]
80− ~zod/try=> (rash '<<<<' apex:poxa)
81− ! {1 2}
82− ! exit
83−
84−### `++attr`
85−
86−Parse XML attributes
87−
88−Parses the list of attributes inside the opening XML tag, which is zero
89−or more space-prefixed name to string values.
90−
91−Accepts
92−-------
93−
94−A [`++nail`]().
95−
96−Produces
97−--------
98−
99−A [`++mart`]().
100−
101−Source
102−------
103−
104− ++ attr :: attributes
105− %+ knee *mart |. ~+
106− %- star
107− ;~ plug
108− ;~(sfix name tis)
109− ;~ pose
110− (ifix [doq doq] (star ;~(less doq escp)))
111− (ifix [soq soq] (star ;~(less soq escp)))
112− ==
113− ==
114− ::
115−
116−Examples
117−--------
118−
119− ~zod/try=> (rash '' attr:poxa)
120− ~
121− ~zod/try=> (rash 'sam=""' attr:poxa)
122− ! {1 1}
123− ! exit
124− ~zod/try=> (rash ' sam=""' attr:poxa)
125− ~[[n=%sam v=""]]
126− ~zod/try=> (rash ' sam="hek"' attr:poxa)
127− ~[[n=%sam v="hek"]]
128− ~zod/try=> (rash ' sam="hek" res="actor"' attr:poxa)
129− ~[[n=%sam v="hek"] [n=%res v="actor"]]
130− ~zod/try=> (rash ' sam=\'hek\' res="actor"' attr:poxa)
131− ~[[n=%sam v="hek"] [n=%res v="actor"]]
132− ~zod/try=> (rash ' sam=\'hek" res="actor"' attr:poxa)
133− ! {1 23}
134− ! exit
135−
136−### `++chrd`
137−
138−Parse character data
139−
140−Parsing rule. Parses XML character data.
141−
142−Accepts
143−-------
144−
145−A [`++nail`]().
146−
147−Produces
148−--------
149−
150−A [`++mars`]().
151−
152−Source
153−------
154−
155− ++ chrd :: character data
156− %+ cook |=(a=tape ^-(mars :/(a)))
157− (plus ;~(less soq doq ;~(pose (just `@`10) escp)))
158− ::
159−
160−Examples
161−--------
162−
163− ~zod/try=> (rash 'asa' chrd:poxa)
164− [g=[n=%$ a=~[[n=%$ v="asa"]]] c=~]
165− ~zod/try=> (rash 'asa &gt; are' chrd:poxa)
166− [g=[n=%$ a=~[[n=%$ v="asa > are"]]] c=~]
167− ~zod/try=> (rash 'asa > are' chrd:poxa)
168− ! {1 6}
169− ! exit
170−
171−### `++comt`
172−
173−Parses comments
174−
175−Parsing rule. Parses XML comment blocks.
176−
177−Accepts
178−-------
179−
180−A [`++nail`]().
181−
182−Produces
183−--------
184−
185−A [`++like`]().
186−
187−Source
188−------
189−
190− ++ comt :: comments
191− =- (ifix [(jest '<!--') (jest '-->')] (star -))
192− ;~ pose
193− ;~(less hep prn)
194− whit
195− ;~(less (jest '-->') hep)
196− ==
197− ::
198−A [`++unit`]() of.
199−
200−Examples
201−--------
202−
203− ~zod/try=> (rash '<!-- bye -->' comt:poxa)
204− " bye "
205− ~zod/try=> (rash '<!-- bye ><<<>< - - -->' comt:poxa)
206− " bye ><<<>< - - "
207− ~zod/try=> (rash '<!-- invalid -->-->' comt:poxa)
208− ! {1 18}
209− ! exit
210−
211−### `++escp`
212−
213−Parse (possibly) escaped char
214−
215−Parsing rule. Parses a nonspecial or escaped character. Result type
216−[`++char`]()
217−
218−Accepts
219−-------
220−
221−A [`++nail`]().
222−
223−Produces
224−--------
225−
226−The [`++edge`]() of a [`++cord`]().
227−
228−Source
229−------
230−
231− ++ escp
232− ;~ pose
233− ;~(less gal gar pam prn)
234− (cold '>' (jest '&gt;'))
235− (cold '<' (jest '&lt;'))
236− (cold '&' (jest '&amp;'))
237− (cold '"' (jest '&quot;'))
238− (cold '\'' (jest '&apos;'))
239− ==
240−
241−Examples
242−--------
243−
244− ~zod/try=> (rash 'a' escp:poxa)
245− 'a'
246− ~zod/try=> (rash 'ab' escp:poxa)
247− ! {1 2}
248− ! exit
249− ~zod/try=> (rash '.' escp:poxa)
250− '.'
251− ~zod/try=> (rash '!' escp:poxa)
252− '!'
253− ~zod/try=> (rash '>' escp:poxa)
254− ! {1 2}
255− ! exit
256− ~zod/try=> (rash '&gt;' escp:poxa)
257− '>'
258− ~zod/try=> (rash '&quot;' escp:poxa)
259− '"'
260−
261−### `++empt`
262−
263−Parse self-closing tag
264−
265−Parsing rule. Parses self-closing XML tags that end in `/>`.
266−
267−Accepts
268−-------
269−
270−A [`++nail`]().
271−
272−Produces
273−--------
274−
275−
276−A `(like tape)`.
277−
278−Source
279−------
280−
281− ++ empt :: self-closing tag
282− %+ ifix [gal (jest '/>')]
283− ;~(plug ;~(plug name attr) (cold ~ (star whit)))
284− ::
285−
286−Examples
287−--------
288−
289− ~zod/try=> (rash '<div/>' empt:poxa)
290− [[%div ~] ~]
291− ~zod/try=> (rash '<pre color="#eeffee" />' empt:poxa)
292− [[%pre ~[[n=%color v="#eeffee"]]] ~]
293− ~zod/try=> (rash '<pre color="#eeffee"></pre>' empt:poxa)
294− ! {1 21}
295− ! exit
296−
297−### `++head`
298−
299−Parse opening tag
300−
301−Parsing rule. Parses the opening tag of an XML node. Result type
302−[`++marx`]()
303−
304−Accepts
305−-------
306−
307−A [`++nail`]().
308−
309−Produces
310−--------
311−
312−A `(like marx)`.
313−
314−Source
315−------
316−
317− ++ head :: opening tag
318− (ifix [gal gar] ;~(plug name attr))
319− ::
320−
321−Examples
322−--------
323−
324− ~zod/try=> (rash '<a>' head:poxa)
325− [n=%a a=~]
326− ~zod/try=> (rash '<div mal="tok">' head:poxa)
327− [n=%div a=~[[n=%mal v="tok"]]]
328− ~zod/try=> (rash '<div mal="tok" />' head:poxa)
329− ! {1 16}
330− ! exit
331−
332−### `++name`
333−
334−Parse tag name
335−
336−Parsing rule. Parses the name of an XML tag.
337−
338−Accepts
339−-------
340−
341−A [`++nail`]().
342−
343−Produces
344−--------
345−
346−An [`++edge`]() of a [`++mane`]().
347−
348−Source
349−------
350−
351− ++ name :: tag name
352− %+ knee *mane |. ~+
353− =+ ^= chx
354− %+ cook crip
355− ;~ plug
356− ;~(pose cab alf)
357− (star ;~(pose cab dot alp))
358− ==
359− ;~(pose ;~(plug ;~(sfix chx col) chx) chx)
360− ::
361−
362−Examples
363−--------
364−
365− ~zod/try=> (scan "ham" name:poxa)
366− %ham
367− ~zod/try=> (scan "ham:tor" name:poxa)
368− [%ham %tor]
369− ~zod/try=> (scan "ham-tor" name:poxa)
370− %ham-tor
371− ~zod/try=> (scan "ham tor" name:poxa)
372− ! {1 4}
373− ! exit
374−
375−### `++tail`
376−
377−Parse closing tag
378−
379−Parsing rule. Parses an XML closing tag.
380−
381−Accepts
382−-------
383−
384−A [`++nail`]().
385−
386−Produces
387−--------
388−
389−A `(like tail)`.
390−
391−Source
392−------
393−
394− ++ tail (ifix [(jest '</') gar] name) :: closing tag
395−
396−Examples
397−--------
398−
399− ~zod/try=> (scan "</div>" tail:poxa)
400− %div
401− ~zod/try=> (scan "</a>" tail:poxa)
402− %a
403− ~zod/try=> (scan "</>" tail:poxa)
404− ! {1 3}
405− ! exit
406−
407−### `++whit`
408−
409−Parse whitespace, etc.
410−
411−Parsing rule. Parses newlines, tabs, and spaces.
412−
413−Accepts
414−-------
415−
416−A [`++nail`]().
417−
418−Produces
419−--------
420−
421−A `(like char)`.
422−
423−Source
424−------
425−
426− ++ whit (mask ~[' ' `@`0x9 `@`0xa]) :: whitespace
427− ::
428−
429−Examples
430−--------
431−
432− ~zod/try=> `@`(scan " " whit:poxa)
433− 32
434− ~zod/try=> `@`(scan " " whit:poxa)
435− ! {1 2}
436− ! exit
437− ~zod/try=> `@`(scan "\0a" whit:poxa)
438− 10
439− ~zod/try=> `@`(scan "\09" whit:poxa)
440− 9
441− ~zod/try=> `@`(scan "\08" whit:poxa)
442− ! {1 1}
443− ! exit
444−
445−
reference/library/zuse/core/poxo.udondeleted−260
@@ -1,260 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−### `++poxo`
7−
8−Print XML
9−
10−Renders a `++manx` `a` as a [`++tape`]().
11−
12−Accepts
13−-------
14−
15−`a` is a [`++manx`]().
16−
17−Produces
18−--------
19−
20−A `++tape`.
21−
22−Source
23−------
24−
25− ++ poxo :: node to tape
26− =< |=(a=manx `tape`(apex a ~))
27− |_ unq=? :: unq
28−
29−Examples
30−--------
31−
32− ~zod/try=> (poxo ;div;)
33− "<div></div>"
34− ~zod/try=> (poxo ;div:(p a))
35− "<div><p></p><a></a></div>"
36− ~zod/try=> (poxo ;div:(p:"tree > text" a))
37− "<div><p>tree &gt; text</p><a></a></div>"
38−
39−
40−### `++apex`
41−
42−Inner XML printer
43−
44−Renders a [`++manx`]() as a [`++tape`](), appending a suffix `rez`.
45−
46−XX is `rez/` a typo or is the `/` intentional
47−
48−Accepts
49−-------
50−
51−`rez` is a [`++tape`]().
52−
53−Produces
54−--------
55−
56−A `++tape`.
57−
58−Source
59−------
60−
61− ++ apex :: top level
62− |= [mex=manx rez=tape]
63− ^- tape
64− ?: ?=([%$ [[%$ *] ~]] g.mex)
65− (escp v.i.a.g.mex rez)
66− =+ man=`mane`n.g.mex
67− =. unq |(unq =(%script man) =(%style man))
68− =+ tam=(name man)
69− =. rez :(weld "</" tam ">" rez)
70− =+ att=`mart`a.g.mex
71− :- '<'
72− %+ welp tam
73− =. rez ['>' (many c.mex rez)]
74− ?~(att rez [' ' (attr att rez)])
75− ::
76−
77−Examples
78−--------
79−
80− ~zod/try=> (apex:poxo ;div; "")
81− "<div></div>"
82− ~zod/try=> (apex:poxo ;div:(p a) "").
83− "<div><p></p><a></a></div>"
84− ~zod/try=> (apex:poxo ;div:(p a) "--sfix")
85− "<div><p></p><a></a></div>--sfix"
86− ~zod/try=> (apex:poxo ;div:(p:"tree > text" a) "")
87− "<div><p>tree &gt; text</p><a></a></div>"
88− ~zod/try=> (~(apex poxo &) ;div:(p:"tree > text" a) "")
89− "<div><p>tree > text</p><a></a></div>"
90−
91−### `++attr`
92−
93−Print attributes
94−
95−Render XML attributes as a [`++tape`]().
96−
97−Accepts
98−-------
99−
100−`tat` is a [`++mart`]().
101−
102−`rez` is a `++tape`.
103−
104−Produces
105−--------
106−
107−A `++tape`.
108−
109−Source
110−------
111−
112− ++ attr :: attributes to tape
113− |= [tat=mart rez=tape]
114− ^- tape
115− ?~ tat rez
116− =. rez $(tat t.tat)
117− ;: weld
118− (name n.i.tat)
119− "=\""
120− (escp(unq |) v.i.tat '"' ?~(t.tat rez [' ' rez]))
121− ==
122−
123−Examples
124−--------
125−
126− ~zod/try=> (attr:poxo ~ "")
127− ""
128− ~zod/try=> (crip (attr:poxo ~[sam/"hem" [%tok %ns]^"reptor"] ""))
129− 'sam="hem" tok:ns="reptor"'
130− ~zod/try=> (crip (attr:poxo ~[sam/"hem" [%tok %ns]^"reptor"] "|appen"))
131− 'sam="hem" tok:ns="reptor"|appen'
132−
133−### `++escp`
134−
135−Escape XML
136−
137−Escapes the XML special characters `"`, `&`, `'`, `<`, `>`.
138−
139−Accepts
140−-------
141−
142−`tex`is a [`++tape`]().
143−
144−`rez` is a `++tape`.
145−
146−Produces
147−--------
148−
149−`++tape`.
150−
151−Source
152−------
153−
154− ++ escp :: escape for xml
155− |= [tex=tape rez=tape]
156− ?: unq
157− (weld tex rez)
158− =+ xet=`tape`(flop tex)
159− |- ^- tape
160− ?~ xet rez
161− %= $
162− xet t.xet
163− rez ?- i.xet
164− 34 ['&' 'q' 'u' 'o' 't' ';' rez]
165− 38 ['&' 'a' 'm' 'p' ';' rez]
166− 39 ['&' '#' '3' '9' ';' rez]
167− 60 ['&' 'l' 't' ';' rez]
168− 62 ['&' 'g' 't' ';' rez]
169− * [i.xet rez]
170− ==
171− ==
172− ::
173−
174−Examples
175−--------
176−
177− ~zod/try=> (escp:poxo "astra" ~)
178− ~[~~a ~~s ~~t ~~r ~~a]
179− ~zod/try=> `tape`(escp:poxo "astra" ~)
180− "astra"
181− ~zod/try=> `tape`(escp:poxo "x > y" ~)
182− "x &gt; y"
183− ~zod/try=> `tape`(~(escp poxo &) "x > y" ~)
184− "x > y"
185−
186−### `++name`
187−
188−Print name
189−
190−Renders a [`++mane`]() as a [`++tape`]().
191−
192−Accepts
193−-------
194−
195−`man` is a `++mane`.
196−
197−Produces
198−--------
199−
200−A `++tape`.
201−
202−Source
203−------
204−
205− ++ name :: name to tape
206− |= man=mane ^- tape
207− ?@ man (trip man)
208− (weld (trip -.man) `tape`[':' (trip +.man)])
209− ::
210−
211−Examples
212−--------
213−
214− ~zod/try=> (name:poxo %$)
215− ""
216− ~zod/try=> (name:poxo %ham)
217− "ham"
218− ~zod/try=> (name:poxo %ham^%tor)
219− "ham:tor"
220−
221−### `++many`
222−
223−Print node list
224−
225−Renders multiple XML nodes as a [`++tape`]().
226−
227−Accepts
228−-------
229−
230−`lix` is a [`++list`]() of [`++manx`]().
231−
232−`rez` is a `++tape`.
233−
234−Produces
235−--------
236−
237−A `++tape`.
238−
239−Source
240−------
241−
242− ++ many :: nodelist to tape
243− |= [lix=(list manx) rez=tape]
244− |- ^- tape
245− ?~ lix rez
246− (apex i.lix $(lix t.lix))
247− ::
248−
249−Examples
250−--------
251−
252− ~zod/try=> (many:poxo ~ "")
253− ""
254− ~zod/try=> (many:poxo ;"hare" "")
255− "hare"
256− ~zod/try=> (many:poxo ;"hare;{lep}ton" "")
257− "hare<lep></lep>ton"
258− ~zod/try=> ;"hare;{lep}ton"
259− [[[%~. [%~. "hare"] ~] ~] [[%lep ~] ~] [[%~. [%~. "ton"] ~] ~] ~]
260−
reference/library/zuse/core/yu.udondeleted−217
@@ -1,217 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−### `++yu`
7−
8−UTC format constants
9−
10−Source
11−------
12−
13− ++ yu :: UTC format constants
14− |%
15−
16− ~zod/try=/hom> yu
17− <4.pgn 250.tmw 41.cmo 414.rvm 101.jzo 1.ypj %164>
18−
19−------------------------------------------------------------------------
20−
21−### `++mon`
22−
23−Months
24−
25−Produces a list of [`++tapes`]() containing the 12 months of the year.
26−
27−Produces
28−--------
29−
30−A `++list` of `++tape`s.
31−
32−Source
33−------
34−
35− ++ mon ^- (list tape)
36− :~ "January" "February" "March" "April" "May" "June" "July"
37− "August" "September" "October" "November" "December"
38− ==
39− ::
40−
41−Examples
42−--------
43−
44− ~zod/try=/hom> mon:yu
45− <<
46− "January"
47− "February"
48− "March"
49− "April"
50− "May"
51− "June"
52− "July"
53− "August"
54− "September"
55− "October"
56− "November"
57− "December"
58− >>
59− ~zod/try=/hom> (snag 1 mon:yu)
60− "February"
61−
62−------------------------------------------------------------------------
63−
64−### `++wik`
65−
66−Weeks
67−
68−Produces a list of [tapes]() containing the 7 days of the week,
69−beginning with Sunday.
70−
71−Source
72−------
73−
74− ++ wik ^- (list tape)
75− :~ "Sunday" "Monday" "Tuesday" "Wednesday" "Thursday"
76− "Friday" "Saturday"
77− ==
78− ::
79−
80−Examples
81−--------
82−
83− ~zod/try=/hom> wik:yu
84− <<"Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" "Friday" "Saturday">>
85− ~zod/try=/hom> (snag 2 wik:yu)
86− "Tuesday"
87− ~zod/try=/hom> (snag (daws (yore -<-)) wik:yu)
88− "Tuesday"
89−
90−------------------------------------------------------------------------
91−
92−### `++les`
93−
94−Leap second dates
95−
96−Produces a [`++list`]() of the (absolute) dates ([`@da`]) of the 25 leap seconds.
97−
98−Produces
99−--------
100−
101−A `++list` of atoms of odor `@da`.
102−
103−Source
104−------
105−
106− ++ les ^- (list ,@da)
107− :~ ~2015.7.1 ~2012.7.1 ~2009.1.1 ~2006.1.1 ~1999.1.1 ~1997.7.1
108− ~1996.1.1 ~1994.7.1 ~1993.7.1 ~1992.7.1 ~1991.1.1 ~1990.1.1
109− ~1988.1.1 ~1985.7.1 ~1983.7.1 ~1982.7.1 ~1981.7.1 ~1980.1.1
110− ~1979.1.1 ~1978.1.1 ~1977.1.1 ~1976.1.1 ~1975.1.1 ~1974.1.1
111− ~1973.1.1 ~1972.7.1
112− ==
113−
114−Examples
115−--------
116−
117− ~zod/try=/hom> les:yu
118− ~[
119− ~2015.7.1
120− ~2012.7.1
121− ~2009.1.1
122− ~2006.1.1
123− ~1999.1.1
124− ~1997.7.1
125− ~1996.1.1
126− ~1994.7.1
127− ~1993.7.1
128− ~1992.7.1
129− ~1991.1.1
130− ~1990.1.1
131− ~1988.1.1
132− ~1985.7.1
133− ~1983.7.1
134− ~1982.7.1
135− ~1981.7.1
136− ~1980.1.1
137− ~1979.1.1
138− ~1978.1.1
139− ~1977.1.1
140− ~1976.1.1
141− ~1975.1.1
142− ~1974.1.1
143− ~1973.1.1
144− ~1972.7.1
145− ]
146− ~zod/try=/hom> (snag 2 les:yu)
147− ~2006.1.1
148−
149−------------------------------------------------------------------------
150−
151−### `++lef`
152−
153−Back-shifted leap second dates
154−
155−Produces a [`++list`]() of absolute dates ([`@da`]()s) that represent the Urbit
156−Galactc Time equivalents of the UTC leap second dates in [`++les`](/docs/hoon/library/3bc#++les).
157−
158−Produces
159−--------
160−
161−A `++list` of atoms of odor `@da`.
162−
163−Source
164−------
165−
166− ++ lef ^- (list ,@da)
167− :~ ~2015.6.30..23.59.59 ~2012.6.30..23.59.59
168− ~2008.12.31..23.59.58 ~2005.12.31..23.59.57
169− ~1998.12.31..23.59.56 ~1997.6.30..23.59.55
170− ~1995.12.31..23.59.54 ~1994.6.30..23.59.53
171− ~1993.6.30..23.59.52 ~1992.6.30..23.59.51
172− ~1990.12.31..23.59.50 ~1989.12.31..23.59.49
173− ~1987.12.31..23.59.48 ~1985.6.30..23.59.47
174− ~1983.6.30..23.59.46 ~1982.6.30..23.59.45
175− ~1981.6.30..23.59.44 ~1979.12.31..23.59.43
176− ~1978.12.31..23.59.42 ~1977.12.31..23.59.41
177− ~1976.12.31..23.59.40 ~1975.12.31..23.59.39
178− ~1974.12.31..23.59.38 ~1973.12.31..23.59.37
179− ~1972.12.31..23.59.36 ~1972.6.30..23.59.35
180− ==
181− ::
182−
183−Examples
184−--------
185−
186− ~zod/try=/hom> lef:yu
187− ~[
188− ~2015.6.30..23.59.59
189− ~2012.6.30..23.59.59
190− ~2008.12.31..23.59.58
191− ~2005.12.31..23.59.57
192− ~1998.12.31..23.59.56
193− ~1997.6.30..23.59.55
194− ~1995.12.31..23.59.54
195− ~1994.6.30..23.59.53
196− ~1993.6.30..23.59.52
197− ~1992.6.30..23.59.51
198− ~1990.12.31..23.59.50
199− ~1989.12.31..23.59.49
200− ~1987.12.31..23.59.48
201− ~1985.6.30..23.59.47
202− ~1983.6.30..23.59.46
203− ~1982.6.30..23.59.45
204− ~1981.6.30..23.59.44
205− ~1979.12.31..23.59.43
206− ~1978.12.31..23.59.42
207− ~1977.12.31..23.59.41
208− ~1976.12.31..23.59.40
209− ~1975.12.31..23.59.39
210− ~1974.12.31..23.59.38
211− ~1973.12.31..23.59.37
212− ~1972.12.31..23.59.36
213− ~1972.6.30..23.59.35
214− ]
215− ~zod/try=/hom> (snag 2 lef:yu)
216− ~2005.12.31..23.59.57
217−
reference/library/zuse/diff.udondeleted−815
@@ -1,815 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−2eP diff
7−========
8−
9−A- more or less low priority and/or currently in the wrong section
10−anyway.
11−
12−------------------------------------------------------------------------
13−
14−------------------------------------------------------------------------
15−
16−### `++berk`
17−
18−Invert diff patches
19−
20−Inverts a list of changes `bur`. Skips stay constant and replaces are
21−swapped. Produces a `bur`.
22−
23−Accepts
24−-------
25−
26−`bur` is a [`++urge`]().
27−
28−Produces
29−--------
30−
31−The `++urge` of a noun.
32−
33−Source
34−------
35−
36− ++ berk :: invert diff patch
37− |* bur=(urge)
38− |- ^+ bur
39− ?~ bur ~
40− :_ $(bur t.bur)
41− ?- -.i.bur
42− & i.bur
43− | [%| q.i.bur p.i.bur]
44− ==
45− ::
46−
47−Examples
48−--------
49−
50− ~zod/try=> (berk `(urge)`~[`10 %|^[~[2] ~[3 4]] `5])
51− ~[[%.y p=10] [%.n p=~[3 4] q=~[2]] [%.y p=5]]
52− ~zod/try=> (lurk "somes" `(urge char)`~[`1 [%| "o" "a"] `3])
53− "sames"
54− ~zod/try=> (berk `(urge char)`~[`1 [%| "o" "a"] `3])
55− ~[[%.y p=1] [%.n p="a" q="o"] [%.y p=3]]
56− ~zod/try=> (lurk "sames" (berk `(urge char)`~[`1 [%| "o" "a"] `3]))
57− "somes"
58−
59−------------------------------------------------------------------------
60−
61−### `++diff`
62−
63−Generate patch
64−
65−Produces a patch between two nouns, by change type
66−
67−Accepts
68−-------
69−
70−`pum` is an [`++umph`]().
71−
72−Produces
73−--------
74−
75−An [`++udon`]()
76−
77−Source
78−------
79−
80− ++ diff :: generate patch
81− |= pum=umph
82− |= [old=* new=*] ^- udon
83− :- pum
84− ?+ pum ~|(%unsupported !!)
85− %a [%d (nude old new)]
86− %b =+ [hel=(cue ((hard ,@) old)) hev=(cue ((hard ,@) new))]
87− [%d (nude hel hev)]
88− %c =+ [hel=(lore ((hard ,@) old)) hev=(lore ((hard ,@) new))]
89− [%c (lusk hel hev (loss hel hev))]
90− ==
91− ::
92−
93−Examples
94−--------
95−
96− ~zod/try=> ((diff %a) 20 21)
97− [p=%a q=[%d p=[%1 p=21] q=[%1 p=20]]]
98− ~zod/try=> ((diff %a) [1 2 3] [1 2 4])
99− [ p=%a
100− q
101− [ %d
102− p=[p=[%0 p=2] q=[p=[%0 p=6] q=[%1 p=4]]]
103− q=[p=[%0 p=2] q=[p=[%0 p=6] q=[%1 p=3]]]
104− ]
105− ]
106− ~zod/try=> ~04hh
107− [1 2]
108− ~zod/try=> ~0ph
109− [1 1]
110− ~zod/try=> ((diff %b) 0v4hh 0vph)
111− [p=%b q=[%d p=[p=[%0 p=2] q=[%0 p=2]] q=[p=[%0 p=3] q=[%1 p=2]]]]
112− ~zod/try=> ((diff %c) (role 'sam' 'les' 'les' 'kor' ~) (role 'sam' 'mor' 'kor' ~))
113− [p=%c q=[%c p=~[[%.y p=1] [%.n p=~[7.562.604 7.562.604] q=~[7.499.629]] [%.y p=1]]]]
114− ~[[%.y p=0] [%.y p=0] [%.y p=1] [%.n p=<|les les|> q=<|mor|>] [%.y p=1]]
115− ~zod/try=> (,[%c %c (urge cord)] ((diff %c) (role 'sam' 'les' 'les' 'kor' ~) (role 'sam' 'mor' 'kor' ~)))
116− [%c %c ~[[%.y p=1] [%.n p=<|les les|> q=<|mor|>] [%.y p=1]]]
117−
118−------------------------------------------------------------------------
119−
120−### `++loss`
121−
122−Longest subsequence
123−
124−Finds a subsequence of repeated elements within two [`++list`]()s, using
125−several internal helper arms. Produces a [`++tape`]().
126−
127−Accepts
128−-------
129−
130−`hel` is a [`++list`]() of [nouns]().
131−
132−`hev` is a [++list`]() of nouns.
133−
134−Produces
135−--------
136−
137−XX
138−
139−A [++list`]() of nouns.
140−
141−Source
142−------
143−
144− ++ loss :: longest subsequence
145− ~/ %loss
146− |* [hel=(list) hev=(list)]
147− |- ^+ hev
148− =+ ^= sev
149− =+ [inx=0 sev=*(map ,@t (list ,@ud))]
150− |- ^+ sev
151− ?~ hev sev
152− =+ guy=(~(get by sev) i.hev)
153− $(hev t.hev, inx +(inx), sev (~(put by sev) i.hev [inx ?~(guy ~ u.guy)]))
154− =| gox=[p=@ud q=(map ,@ud ,[p=@ud q=_hev])]
155− =< abet
156− =< main
157− |%
158− ++ abet =.(q.rag ?:(=([& 0] p.rag) q.rag [p.rag q.rag]) (flop q.rag))
159− ++ hink :: extend fits top
160− |= [inx=@ud goy=@ud] ^- ?
161− |(=(p.gox inx) (lth goy p:(need (~(get by q.gox) inx))))
162− ::
163− ++ lonk :: extend fits bottom
164− |= [inx=@ud goy=@ud] ^- ?
165− |(=(0 inx) (gth goy p:(need (~(get by q.gox) (dec inx)))))
166− ::
167− ++ lune :: extend
168− |= [inx=@ud goy=@ud]
169− ^+ +>
170− %_ +>.$
171− gox
172− :- ?:(=(inx p.gox) +(p.gox) p.gox)
173− %+ ~(put by q.gox) inx
174− [goy (snag goy hev) ?:(=(0 inx) ~ q:(need (~(get by q.gox) (dec inx))))]
175− ==
176− ::
177− ++ merg :: merge all matches
178− |= gay=(list ,@ud)
179− ^+ +>
180− =+ ^= zes
181− =+ [inx=0 zes=*(list ,[p=@ud q=@ud])]
182− |- ^+ zes
183− ?: |(?=(~ gay) (gth inx p.gox)) zes
184− ?. (lonk inx i.gay) $(gay t.gay)
185− ?. (hink inx i.gay) $(inx +(inx))
186− $(inx +(inx), gay t.gay, zes [[inx i.gay] zes])
187− |- ^+ +>.^$
188− ?~(zes +>.^$ $(zes t.zes, +>.^$ (lune i.zes)))
189− ::
190− ++ main
191− |- ^+ +
192− ?~ hel
193− ?~ hev
194− ?>(?=(~ lcs) +)
195− $(hev t.hev, rag (done %| ~ [i.hev ~]))
196− ?~ hev
197− $(hel t.hel, rag (done %| [i.hel ~] ~))
198− ?~ lcs
199− +(rag (done %| (flop hel) (flop hev)))
200− ?: =(i.hel i.lcs)
201− ?: =(i.hev i.lcs)
202− $(lcs t.lcs, hel t.hel, hev t.hev, rag (done %& 1))
203− $(hev t.hev, rag (done %| ~ [i.hev ~]))
204− ?: =(i.hev i.lcs)
205− $(hel t.hel, rag (done %| [i.hel ~] ~))
206− $(hel t.hel, hev t.hev, rag (done %| [i.hel ~] [i.hev ~]))
207− --
208−
209−Examples
210−--------
211−
212− ~zod/try=> (loss "sam" "sem")
213− "sm"
214− ~zod/try=> (loss "samo" "semo")
215− "smo"
216− ~zod/try=> (loss "sakmo" "semo")
217− "smo"
218− ~zod/try=> (loss "ferdinham" "ferdilapos
219− ~ <syntax error at [1 30]>
220− ~zod/try=> (loss "ferdinham" "ferdilapos")
221− "ferdia"
222−
223−------------------------------------------------------------------------
224−
225−### `++locz`
226−
227−Find common
228−
229−Finds a subsequence of repeated elements within two
230−[`++list`](/docs/hoon/library/1#++list)s, producing a [\`++tape]().
231−
232−Accepts
233−-------
234−
235−A cell of two `++tape`s, `hel` and `hev`.
236−
237−Produces
238−--------
239−
240−A `++tape`.
241−
242−Source
243−------
244−
245− ++ locz :: trivial algorithm
246− |= [hel=tape hev=tape]
247− ^- tape
248− =+ [leh=(lent hel) veh=(lent hev)]
249− =- (flop q.yun)
250− ^= yun
251− |- ^- [p=@ud q=tape]
252− ~+
253− ?: |(=(0 leh) =(0 veh)) [0 ~]
254− =+ [dis=(snag (dec leh) hel) dat=(snag (dec veh) hev)]
255− ?: =(dis dat)
256− =+ say=$(leh (dec leh), veh (dec veh))
257− [+(p.say) [dis q.say]]
258− =+ [lef=$(leh (dec leh)) rig=$(veh (dec veh))]
259− ?:((gth p.lef p.rig) lef rig)
260− ::
261−
262−Examples
263−--------
264−
265− ~zod/try=> (locz "samukot" "semelkot")
266− "smkot"
267− ~zod/try=> (locz "samukot" "samelkot")
268− "samkot"
269−
270−------------------------------------------------------------------------
271−
272−### `++lore`
273−
274−Split on `\n`
275−
276−Split on newlines, ascii `10`
277−
278−Accepts
279−-------
280−
281−`lub` is an atom.
282−
283−Produces
284−--------
285−
286−XX
287−
288−A `++list` of atoms of odor [`@t`]() ([`++cord`]()).
289−
290−Source
291−------
292− ++ lore :: atom to line list
293− ~/ %lore
294− |= lub=@
295− =| tez=(list ,@t)
296− |- ^+ tez
297− ?: =(0 lub) (flop tez)
298− =+ ^= meg
299− =+ meg=0
300− |- ^- @ud
301− =+ gam=(cut 3 [meg 1] lub)
302− ?:(|(=(10 gam) =(0 gam)) meg $(meg +(meg)))
303− =+ res=(rsh 3 +(meg) lub)
304− ?: &(=(0 (cut 3 [meg 1] lub)) !=(0 res))
305− !!
306− $(lub res, tez [(end 3 meg lub) tez])
307− ::
308−
309−Examples
310−--------
311−
312− ~zod/try=> (lore 'soke\0alas\0amep')
313− <|soke las mep|>
314− ~zod/try=> (lore '|= a=@\0a=+ b=(add a 5)\0a(mix b a)')
315− <||= a=@ =+ b=(add a 5) (mix b a)|>
316− ~zod/try=> `wain`[(fil 3 80 ' ') (lore '|= a=@\0a=+ b=(add a 5)\0a(mix b a)')]
317− <|
318− |= a=@
319− =+ b=(add a 5)
320− (mix b a)
321− |>
322−
323−------------------------------------------------------------------------
324−
325−### `++role`
326−
327−Join with `\n`
328−
329−Join line list with newlines.
330−
331−Accepts
332−-------
333−
334−A `++list` of atoms of [odor]() [`@t`]() ([`++cord`]()).
335−
336−Produces
337−--------
338−
339−XX
340−
341−An atom of [odor]() [`@t`]() ([`++cord`]().
342−
343−Source
344−------
345−
346− ++ role :: line list to atom
347− |= tez=(list ,@t)
348− (rap 3 (turn tez |=(a=@t (cat 3 a 10))))
349− ::
350−
351−Examples
352−--------
353−
354− ~zod/try=> (role 'sep' 'tek' 'lap' ~)
355− 3.230.709.852.558.292.782.985.274.739
356− ~zod/try=> `@t`(role 'sep' 'tek' 'lap' ~)
357− '''
358− sep
359− tek
360− lap
361− '''
362−
363−------------------------------------------------------------------------
364−
365−### `++lump`
366−
367−Change with `++udon`
368−
369−Use [`++udon`]() to change [noun]().
370−
371−Accepts
372−-------
373−
374−A cell of an `++udon`, `don`, and a noun, `src`.
375−
376−Produces
377−--------
378−
379−A noun.
380−
381−Source
382−------
383−
384− ++ lump :: apply patch
385− |= [don=udon src=*]
386− ^- *
387− ?+ p.don ~|(%unsupported !!)
388− %a
389− ?+ -.q.don ~|(%unsupported !!)
390− %a q.q.don
391− %c (lurk ((hard (list)) src) p.q.don)
392− %d (lure src p.q.don)
393− ==
394− ::
395− %c
396− =+ dst=(lore ((hard ,@) src))
397− %- role
398− ?+ -.q.don ~|(%unsupported !!)
399− %a ((hard (list ,@t)) q.q.don)
400− %c (lurk dst p.q.don)
401− ==
402− ==
403− ::
404−
405−Examples
406−--------
407−
408− ~zod/try=> (lump [%a %a 20 25] 20)
409− 25
410− ~zod/try=> (lump [%a %d [[%0 1] [%0 1]] [%0 2]] 20)
411− [20 20]
412− ~zod/try=> (lump [%c %a ~['sa' 'le'] ~['sa' 'lo']] 'sa\0ale')
413− 11.473.670.267.251
414− ~zod/try=> (,@t (lump [%c %a ~['sa' 'le'] ~['sa' 'lo']] 'sa\0ale'))
415− '''
416− sa
417− lo
418− '''
419− ~zod/try=> (,@t (lump [%c %c `1 [%| ~['le'] ~['lo' 'ma']] ~] 'sa\0ale'))
420− '''
421− sa
422− ma
423− lo
424− '''
425−
426−------------------------------------------------------------------------
427−
428−### `++lure`
429−
430−Patch `a`
431−
432−Patch a by references to axis and literal.
433−
434−Accepts
435−-------
436−
437−A cell of a [noun](), `a`, and an [`++upas`](), `b`.
438−
439−Produces
440−--------
441−
442−A noun.
443−
444−Source
445−------
446−
447− ++ lure :: apply tree diff
448− |= [a=* b=upas]
449− ^- *
450− ?^ -.b
451− [$(b -.b) $(b +.b)]
452− ?+ -.b ~|(%unsupported !!)
453− %0 .*(a [0 p.b])
454− %1 .*(a [1 p.b])
455− ==
456−
457−Examples
458−--------
459−
460− ~zod/try=> (lure ~[1 2] [[%0 2] [%1 3] [%0 7]])
461− [1 3 0]
462− ~zod/try=> (lure ~[1 2 4] [[%0 2] [%1 3] [%0 7]])
463− [1 3 4 0]
464−
465−------------------------------------------------------------------------
466−
467−### `++limp`
468−
469−Reverse patch
470−
471−Reverse a patch (preprocessor unchanged)
472−
473−Accepts
474−-------
475−
476−`don` is an [`++udon`]().
477−
478−Produces
479−--------
480−
481−An `++udon`.
482−
483−Source
484−------
485−
486− ++ limp :: invert patch
487− |= don=udon ^- udon
488− :- p.don
489− ?+ -.q.don ~|(%unsupported !!)
490− %a [%a q.q.don p.q.don]
491− %c [%c (berk p.q.don)]
492− %d [%d q.q.don p.q.don]
493− ==
494− ::
495−
496−Examples
497−--------
498−
499− ~zod/try=> (limp [%a %a 20 40])
500− [p=%a q=[%a p=40 q=20]]
501− ~zod/try=> (limp [%c %c ~[`20 [%| ~[52 53] ~[51]] `6]])
502− [p=%c q=[%c p=~[[%.y p=20] [%.n p=~[51] q=~[52 53]] [%.y p=6]]]]
503− ~zod/try=> (limp [%a %d [[%0 1] [%0 1]] [%0 2]])
504− [p=%a q=[%d p=[%0 p=2] q=[p=[%0 p=1] q=[%0 p=1]]]]
505−
506−------------------------------------------------------------------------
507−
508−### `++hump`
509−
510−Prep for diff
511−
512−Prep atom for diff: leave alone, cue, or split by newlines.
513−
514−Accepts
515−-------
516−
517−A cell of an [`++umph`](), `pum`, and a [noun](), `src`.
518−
519−Produces
520−--------
521−
522−A noun.
523−
524−Source
525−------
526−
527− ++ hump :: general prepatch
528− |= [pum=umph src=*] ^- *
529− ?+ pum ~|(%unsupported !!)
530− %a src
531− %b (cue ((hard ,@) src))
532− %c (lore ((hard ,@) src))
533− ==
534− ::
535−
536−Examples
537−--------
538−
539− ~zod/try=> (hump %a ~)
540− 0
541− ~zod/try=> (hump %a 40)
542− 40
543− ~zod/try=> (hump %c 40)
544− [40 0]
545− ~zod/try=> (hump %c 'as')
546− [29.537 0]
547− ~zod/try=> (hump %c 'as\0alok')
548− [29.537 7.040.876 0]
549− ~zod/try=> (hump %b 0vph)
550− [1 1]
551−
552−------------------------------------------------------------------------
553−
554−### `++husk`
555−
556−Atomize post diff
557−
558−Re-atomize after diff: leave alone, jam, or join with newlines.
559−
560−Accepts
561−-------
562−
563−A cell of an [`++umph`](), `pum`, and a [noun](), `dst`.
564−
565−Produces
566−--------
567−
568−A noun.
569−
570−Source
571−------
572−
573− ++ husk :: unprepatch
574− |= [pum=umph dst=*] ^- *
575− ?+ pum ~|(%unsupported !!)
576− %a dst
577− %b (jam dst)
578− %c (role ((hard (list ,@)) dst))
579− ==
580− ::
581−
582−Examples
583−--------
584−
585− ~zod/try=> (husk %a 0)
586− 0
587− ~zod/try=> (husk %a 40)
588− 40
589− ~zod/try=> (husk %c [40 0])
590− 2.600
591− ~zod/try=> (rip 3 (,@ (husk %c [40 0])))
592− ~[40 10]
593− ~zod/try=> (husk %c [%as 0])
594− 684.897
595− ~zod/try=> (husk %c [%as 0])
596− 684.897
597− ~zod/try=> (,@t (husk %c [%as 0]))
598− '''
599− as
600− '''
601− ~zod/try=> (husk %c [%as %lok 0])
602− 2.932.876.065.272.673
603− ~zod/try=> (,@t (husk %c [%as %lok 0]))
604− '''
605− as
606− lok
607− '''
608− ~zod/try=> (husk %b [1 1])
609− 817
610− ~zod/try=> (,@uv (husk %b [1 1]))
611− 0vph
612− ~zod/try=> ~0ph
613− [1 1]
614−
615−------------------------------------------------------------------------
616−
617−### `++lurk`
618−
619−Apply list patch
620−
621−Amend list using an urge: [`++list`]() of `[%& {number skipped}]` and
622−`[%| old new]`
623−
624−
625−Accepts
626−-------
627−
628−A cell of a `++list` of [noun]()s, `hel`, and an [`++urge`]() of a noun, `rug`.
629−
630−Produces
631−--------
632−
633−A `++list` of nouns.
634−
635−Source
636−------
637−
638− ++ lurk :: apply list patch
639− |* [hel=(list) rug=(urge)]
640− ^+ hel
641− =+ war=`_hel`~
642− |- ^+ hel
643− ?~ rug (flop war)
644− ?- -.i.rug
645− &
646− %= $
647− rug t.rug
648− hel (slag p.i.rug hel)
649− war (weld (flop (scag p.i.rug hel)) war)
650− ==
651− ::
652− |
653− %= $
654− rug t.rug
655− hel =+ gur=(flop p.i.rug)
656− |- ^+ hel
657− ?~ gur hel
658− ?>(&(?=(^ hel) =(i.gur i.hel)) $(hel t.hel, gur t.gur))
659− war (weld q.i.rug war)
660− ==
661− ==
662− ::
663−
664−Examples
665−--------
666−
667− ~zod/try=> (lurk "hema" `(urge char)`~[`1 [%| "e" "ru"] `2])
668− "hurma"
669− ~zod/try=> (lurk "koltep" `(urge char)`~[`3 [%| "et" ""] `1])
670− "kolp"
671−
672−------------------------------------------------------------------------
673−
674−### `++lusk`
675−
676−`lcs` to list patch
677−
678−Using a common sequence, generate urge from two [`++list`]()s.
679−
680−
681−Accepts
682−-------
683−
684−A cell of three `++list`s of [noun](), `hel`, `hev`, and `lcs`.
685−
686−Produces
687−--------
688−
689−Source
690−------
691−
692− ++ lusk :: lcs to list patch
693− |* [hel=(list) hev=(list) lcs=(list)]
694− =+ ^= rag
695− ^- $% [& p=@ud]
696− [| p=_lcs q=_lcs]
697− ==
698− [%& 0]
699− => .(rag [p=rag q=*(list ,_rag)])
700− =< abet =< main
701− |%
702− ++ abet =.(q.rag ?:(=([& 0] p.rag) q.rag [p.rag q.rag]) (flop q.rag))
703− ++ done
704− |= new=_p.rag
705− ^+ rag
706− ?- -.p.rag
707− | ?- -.new
708− | [[%| (weld p.new p.p.rag) (weld q.new q.p.rag)] q.rag]
709− & [new [p.rag q.rag]]
710− ==
711− & ?- -.new
712− | [new ?:(=(0 p.p.rag) q.rag [p.rag q.rag])]
713− & [[%& (add p.p.rag p.new)] q.rag]
714− ==
715− ==
716− ::
717− ++ main
718− |- ^+ +
719− ?~ hel
720− ?~ hev
721− ?>(?=(~ lcs) +)
722− $(hev t.hev, rag (done %| ~ [i.hev ~]))
723− ?~ hev
724− $(hel t.hel, rag (done %| [i.hel ~] ~))
725− ?~ lcs
726− +(rag (done %| (flop hel) (flop hev)))
727− ?: =(i.hel i.lcs)
728− ?: =(i.hev i.lcs)
729− $(lcs t.lcs, hel t.hel, hev t.hev, rag (done %& 1))
730− $(hev t.hev, rag (done %| ~ [i.hev ~]))
731− ?: =(i.hev i.lcs)
732− $(hel t.hel, rag (done %| [i.hel ~] ~))
733− $(hel t.hel, hev t.hev, rag (done %| [i.hel ~] [i.hev ~]))
734− --
735−
736−Examples
737−--------
738−
739− ~zod/try=> (lusk "hamok" "hasok" "haok")
740− ~[[%.y p=2] [%.n p="m" q="s"] [%.y p=2]]
741− ~zod/try=> (lusk "hamok" "hasok" "hak")
742− ~[[%.y p=2] [%.n p="om" q="os"] [%.y p=1]]
743− ~zod/try=> (lusk "telroga" "tesomga" "teoga")
744− ~[[%.y p=2] [%.n p="rl" q="s"] [%.y p=1] [%.n p="" q="m"] [%.y p=2]]
745− ~zod/try=> (lurk "telroga" `(urge char)`~[[%.y p=2] [%.n p="rl" q="s"] [%.y p=1] [%.n p="" q="m"] [%.y p=2]])
746− "tesomga"
747−
748−------------------------------------------------------------------------
749−
750−### `++nude`
751−
752−Tree change
753−
754−Generate tree diff from two nouns.
755−
756−Accepts
757−-------
758−
759−A cell of two nouns, `a` and `b`.
760−
761−Produces
762−--------
763−
764−A cell of two [`++upas`](), `p` and `q`.
765−
766−Source
767−------
768−
769− ++ nude :: tree change
770− |= [a=* b=*]
771− ^- [p=upas q=upas]
772− =< [p=(tred a b) q=(tred b a)]
773− |%
774− ++ axes :: locs of nouns
775− |= [a=@ b=*] ^- (map ,* axis)
776− =+ c=*(map ,* axis)
777− |- ^- (map ,* axis)
778− => .(c (~(put by c) b a))
779− ?@ b
780− c
781− %- ~(uni by c)
782− %- ~(uni by $(a (mul 2 a), b -.b))
783− $(a +((mul 2 a)), b +.b)
784− ::
785− ++ tred :: diff a->b
786− |= [a=* b=*] ^- upas
787− =| c=(unit ,*)
788− =+ d=(axes 1 a)
789− |- ^- upas
790− => .(c (~(get by d) b))
791− ?~ c
792− ?@ b
793− [%1 b]
794− =+ e=^-(upas [$(b -.b) $(b +.b)])
795− ?- e
796− [[%1 *] [%1 *]] [%1 [p.p.e p.q.e]]
797− * e
798− ==
799− [%0 u.c]
800− --
801−
802−Examples
803−--------
804−
805− ~zod/try=> (nude 40 20)
806− [p=[%1 p=20] q=[%1 p=40]]
807− ~zod/try=> (nude [5 5] 5)
808− [p=[%0 p=3] q=[p=[%0 p=1] q=[%0 p=1]]]
809− ~zod/try=> (nude "sam" "sal")
810− [ p=[p=[%1 p=115] q=[p=[%1 p=97] q=[p=[%1 p=108] q=[%0 p=15]]]]
811− q=[p=[%1 p=115] q=[p=[%1 p=97] q=[p=[%1 p=109] q=[%0 p=15]]]]
812− ]
813−
814−------------------------------------------------------------------------
815−
reference/library/zuse/gate/clan.udondeleted−45
@@ -1,45 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−### `++clan`
7−
8−Ship class
9−
10−Accepts
11−-------
12−
13−`who` is a [`++ship`]()
14−
15−Produces
16−--------
17−
18−A [`%cube`]().
19−
20−Source
21−------
22−
23− ++ clan :: ship to rank
24− |= who=ship ^- rank
25− =+ wid=(met 3 who)
26− ?: (lte wid 1) %czar
27− ?: =(2 wid) %king
28− ?: (lte wid 4) %duke
29− ?: (lte wid 8) %earl
30− ?> (lte wid 16) %pawn
31− ::
32−
33−Examples
34−--------
35−
36− ~zod/main=> (clan ~zod)
37− %czar
38− ~zod/main=> (clan ~tyr)
39− %czar
40− ~zod/main=> (clan ~doznec)
41− %king
42− ~zod/main=> (clan ~tasfyn-partyv)
43− %duke
44−
45−
reference/library/zuse/gate/dawn.udondeleted−44
@@ -1,44 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−### `++dawn`
7−
8−Weekday of Jan 1
9−
10−Computes which day of the week January 1st falls on for a year `yer`,
11−producing an atom. Weeks are zero-indexed beginning on Sunday.
12−
13−Accepts
14−-------
15−
16−`yer` is an unsigned decimal, [`@ud`]().
17−
18−Produces
19−--------
20−
21−An atom.
22−
23−Source
24−------
25−
26− ++ dawn :: weekday of jan 1
27− |= yer=@ud
28− =+ yet=(sub yer 1)
29− %- mod :_ 7
30− :(add 1 (mul 5 (mod yet 4)) (mul 4 (mod yet 100)) (mul 6 (mod yet 400)))
31− ::
32−
33−Examples
34−--------
35−
36− ~zod/try=> (dawn 2.015)
37− 4
38− ~zod/try=> (dawn 1)
39− 1
40− ~zod/try=> (dawn 0)
41− ! subtract-underflow
42− ! exit
43−
44−
reference/library/zuse/gate/daws.udondeleted−42
@@ -1,42 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−### `++daws`
7−
8−Weekday of date
9−
10−Produces the day of the week of a given date `yed` as an atom. Weeks are
11−zero-indexed beginning on Sunday.
12−
13−Accepts
14−-------
15−
16−`yed` is a [`++date`]().
17−
18−Produces
19−--------
20−
21−An atom.
22−
23−Source
24−------
25−
26− ++ daws :: weekday of date
27− |= yed=date
28− %- mod :_ 7
29− (add (dawn y.yed) (sub (yawn [y.yed m.yed d.t.yed]) (yawn y.yed 1 1)))
30− ::
31−
32−Examples
33−--------
34−
35− ~zod/try=> (daws [[a=%.y y=2.014] m=6 t=[d=6 h=21 m=9 s=15 f=~[0xa16]]])
36− 5
37− ~zod/try=> (daws (yore -<-))
38− 2
39−
40−(second example always returns the current date).
41−
42−
reference/library/zuse/gate/deal.udondeleted−49
@@ -1,49 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−### `++deal`
7−
8−Add leap seconds
9−
10−Produces a [`++date`]() with the 25 leap seconds added.
11−
12−Accepts
13−-------
14−
15−`yer` is an absolute date, [`@da`]().
16−
17−Produces
18−--------
19−
20−A `++date`.
21−
22−Source
23−------
24−
25− ++ deal :: to leap sec time
26− |= yer=@da
27− =+ n=0
28− =+ yud=(yore yer)
29− |- ^- date
30− ?: (gte yer (add (snag n lef:yu) ~s1))
31− (yore (year yud(s.t (add n s.t.yud))))
32− ?: &((gte yer (snag n lef:yu)) (lth yer (add (snag n lef:yu) ~s1)))
33− yud(s.t (add +(n) s.t.yud))
34− ?: =(+(n) (lent lef:yu))
35− (yore (year yud(s.t (add +(n) s.t.yud))))
36− $(n +(n))
37− ::
38−
39−Examples
40−--------
41−
42− ~zod/try=> (yore (bex 127))
43− [[a=%.y y=226] m=12 t=[d=5 h=15 m=30 s=8 f=~]]
44− ~zod/try=> (deal `@da`(bex 127))
45− [[a=%.y y=226] m=12 t=[d=5 h=15 m=30 s=33 f=~]]
46− ~zod/try=> (yore (bex 126))
47− [[a=%.n y=146.138.512.088] m=6 t=[d=19 h=7 m=45 s=4 f=~]]
48−
49−
reference/library/zuse/gate/deft.udondeleted−53
@@ -1,53 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−### `++deft`
7−
8−Import URL path
9−
10−Parse the extension the from last element of url, which is delimited
11−either by a `.` or a `/`.
12−
13−Accepts
14−-------
15−
16−`rax` is a [`++list`]() of [`@t`]().
17−
18−Produces
19−--------
20−
21−A [`++pork`]().
22−
23−Source
24−------
25−
26− ++ deft :: import url path
27− |= rax=(list ,@t)
28− |- ^- pork
29− ?~ rax
30− [~ ~]
31− ?~ t.rax
32− =+ den=(trip i.rax)
33− =+ ^= vex
34− %- %- full
35− ;~(plug sym ;~(pose (stag ~ ;~(pfix dot sym)) (easy ~)))
36− [[1 1] (trip i.rax)]
37− ?~ q.vex
38− [~ [i.rax ~]]
39− [+.p.u.q.vex [-.p.u.q.vex ~]]
40− =+ pok=$(rax t.rax)
41− :- p.pok
42− [i.rax q.pok]
43− ::
44−
45−Examples
46−--------
47−
48− ~zod/try=> (deft /foo/bar/'baz.txt')
49− [p=[~ ~.txt] q=<|foo bar baz|>]
50− ~zod/try=> (deft /foo/bar/baz)
51− [p=~ q=<|foo bar baz|>]
52−
53−
reference/library/zuse/gate/dust.udondeleted−47
@@ -1,47 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−### `++dust`
7−
8−Print UTC format
9−
10−Produces a [`++tape`]() of the date in UTC format.
11−
12−Accepts
13−-------
14−
15−`yed` is a [`++date`]().
16−
17−Produces
18−--------
19−
20−A `++tape`.
21−
22−Source
23−------
24−
25− ++ dust :: print UTC format
26− |= yed=date
27− ^- tape
28− =+ wey=(daws yed)
29− ;: weld
30− `tape`(snag wey (turn wik:yu |=(a=tape (scag 3 a))))
31− ", " ~(rud at d.t.yed) " "
32− `tape`(snag (dec m.yed) (turn mon:yu |=(a=tape (scag 3 a))))
33− " " (scag 1 ~(rud at y.yed)) (slag 2 ~(rud at y.yed)) " "
34− ~(rud at h.t.yed) ":" ~(rud at m.t.yed) ":" ~(rud at s.t.yed)
35− " " "+0000"
36− ==
37− ::
38−
39−Examples
40−--------
41−
42− ~zod/try=> (dust (yore ->-))
43− "Tue, 21 Oct 2014 21:35:12 +0000"
44− ~zod/try=> (dust [[a=%.y y=2.002] m=10 t=[d=11 h=12 m=20 s=55 f=~]])
45− "Fri, 11 Oct 2002 12:20:55 +0000"
46−
47−
reference/library/zuse/gate/earl.udondeleted−45
@@ -1,45 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−### `++earl`
7−
8−Localize purl
9−
10−Prepends a ship name to the spur of a [`++purl`]().
11−
12−Accepts
13−-------
14−
15−`who` is a [`@p`](), a ship name.
16−
17−`pul` is a `++purl`.
18−
19−Produces
20−--------
21−
22−A `++purl`.
23−
24−Source
25−------
26−
27− ++ earl :: localize purl
28− |= [who=@p pul=purl]
29− ^- purl
30− pul(q.q [(rsh 3 1 (scot %p who)) q.q.pul])
31− ::
32−
33−Examples
34−--------
35−
36− ~zod/main=> (need (epur 'http://123.1.1.1/me.ham'))
37− [p=[p=%.n q=~ r=[%.n p=.123.1.1.1]] q=[p=[~ ~.ham] q=<|me|>] r=~]
38− ~zod/main=> (earl ~zod (need (epur 'http://123.1.1.1/me.ham')))
39− [p=[p=%.n q=~ r=[%.n p=.123.1.1.1]] q=[p=[~ ~.ham] q=<|zod me|>] r=~]
40− ~zod/main=> (earl ~pittyp (need (epur 'http://123.1.1.1/me.ham')))
41− [p=[p=%.n q=~ r=[%.n p=.123.1.1.1]] q=[p=[~ ~.ham] q=<|pittyp me|>] r=~]
42− ~zod/main=> (earn (earl ~pittyp (need (epur 'http://123.1.1.1/me.ham'))))
43− "http://123.1.1.1/pittyp/me"
44−
45−
reference/library/zuse/gate/earn.udondeleted−185
@@ -1,185 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−### `++earn`
7−
8−Purl to tape
9−
10−Parses a [`++purl`]() `pul` to a [`++tape`]().
11−
12−Accepts
13−-------
14−
15−`pul` is a `++purl`.
16−
17−Produces
18−--------
19−
20−A `++tape`.
21−
22−Source
23−------
24−
25− ++ earn :: purl to tape
26− |^ |= pul=purl
27− ^- tape
28− :(weld (head p.pul) "/" (body q.pul) (tail r.pul))
29− ::
30−
31−Examples
32−--------
33−
34− ~zod/main=> (earn [| ~ [%| .127.0.0.1]] [~ ~] ~)
35− "http://127.0.0.1/"
36− ~zod/main=> (earn [| ~ `/com/google/www] [~ ~] ~)
37− "http://www.google.com/"
38− ~zod/main=> (earn [& ~ `/com/google/www] [~ ~] ~)
39− "https://www.google.com/"
40− ~zod/main=> (earn [& `200 `/com/google/www] [~ ~] ~)
41− "https://www.google.com:200/"
42− ~zod/main=> (earn [& `200 `/com/google/www] [~ /search] ~)
43− "https://www.google.com:200/search"
44− ~zod/main=> (earn [& ~ `/com/google/www] [`%html /search] ~)
45− "https://www.google.com/search"
46− ~zod/main=> (earn [& ~ `/com/google/www] [~ /search] [%q 'urbit'] ~)
47− "https://www.google.com/search?q=urbit"
48− ~zod/main=> (earn [& ~ `/com/google/www] [~ /search] [%q 'urbit escaping?'] ~)
49− "https://www.google.com/search?q=urbit%20escaping%3F"
50−
51−### `++body`
52−
53−Render URL path
54−
55−Renders URL path `pok` as a [`++tape`]().
56−
57−Accepts
58−-------
59−
60−`pok` is a [`++pork`]().
61−
62−Produces
63−--------
64−
65−A `++tape`.
66−
67−Source
68−------
69−
70− ++ body
71− |= pok=pork ^- tape
72− ?~ q.pok ~
73− |-
74− =+ seg=(trip i.q.pok)
75− ?~ t.q.pok
76− ?~(p.pok seg (welp seg '.' (trip u.p.pok)))
77− (welp seg '/' $(q.pok t.q.pok))
78− ::
79−
80−Examples
81−--------
82−
83− ~zod/main=> (body:earn ~ /foo/mol/lok)
84− "foo/mol/lok"
85− ~zod/main=> (body:earn `%htm /foo/mol/lok)
86− "foo/mol/lok.htm"
87− ~zod/main=> (body:earn `%htm /)
88− ""
89−
90−### `++head`
91−
92−Render URL beginning
93−
94−Renders a `++hart`, usually the beginning of a URL, as the [`++tape`]()
95−of a traditional URL.
96−
97−Accepts
98−-------
99−
100−`har` is a `++heart`.
101−
102−Produces
103−--------
104−
105−A `++tape`.
106−
107−Source
108−------
109−
110− ++ head
111− |= har=hart
112− ^- tape
113− ;: weld
114− ?:(&(p.har !=([& /localhost] r.har)) "https://" "http://")
115− ::
116− ?- -.r.har
117− | (trip (rsh 3 1 (scot %if p.r.har)))
118− & =+ rit=(flop p.r.har)
119− |- ^- tape
120− ?~(rit ~ (weld (trip i.rit) ?~(t.rit "" `tape`['.' $(rit t.rit)])))
121− ==
122− ::
123− ?~(q.har ~ `tape`[':' (trip (rsh 3 2 (scot %ui u.q.har)))])
124− ==
125− ::
126−
127−Examples
128−--------
129−
130− ~zod/main=> (head:earn | ~ %| .127.0.0.1)
131− "http://127.0.0.1"
132− ~zod/main=> (head:earn & ~ %| .127.0.0.1)
133− "https://127.0.0.1"
134− ~zod/main=> (head:earn & [~ 8.080] %| .127.0.0.1)
135− "https://127.0.0.1:8080"
136− ~zod/main=> (head:earn & [~ 8.080] %& /com/google/www)
137− "https://www.google.com:8080"
138−
139−### `++tail`
140−
141−Render query string
142−
143−Renders a [`++quay`](), a query string in hoon, to the [`++tape`]() of a
144−traditional query string.
145−
146−Accepts
147−-------
148−
149−`kay` is a `++quay`.
150−
151−Produces
152−--------
153−
154−A `++tape`.
155−
156−Source
157−------
158−
159− ++ tail
160− |= kay=quay
161− ^- tape
162− ?: =(~ kay) ~
163− :- '?'
164− |- ^- tape
165− ?~ kay ~
166− ;: weld
167− (urle (trip p.i.kay))
168− "="
169− (urle (trip q.i.kay))
170− ?~(t.kay ~ `tape`['&' $(kay t.kay)])
171− ==
172− --
173− ::
174−
175−Examples
176−--------
177−
178− ~zod/main=> (tail:earn ~)
179− ""
180− ~zod/main=> (tail:earn [%ask 'bid'] ~)
181− "?ask=bid"
182− ~zod/main=> (tail:earn [%ask 'bid'] [%make 'well'] ~)
183− "?ask=bid&make=well"
184−
185−
reference/library/zuse/gate/fain.udondeleted−61
@@ -1,61 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−### `++fain`
7−
8−Restructure path
9−
10−Splits a concrete
11−
12−[`++spur`]() out of a full [`++path`](), producing a location [`++beam`]() and
13−a remainder [`++path`]().
14−
15−Accepts
16−-------
17−
18−`hom` is a `++path`
19−
20−Produces
21−--------
22−
23− ([pair]() beam path)
24−
25−Source
26−------
27−
28− ++ fain :: path restructure
29− |= [hom=path raw=path]
30− =+ bem=(need (tome raw))
31− =+ [mer=(flop s.bem) moh=(flop hom)]
32− |- ^- (pair beam path)
33− ?~ moh
34− [bem(s hom) (flop mer)]
35− ?> &(?=(^ mer) =(i.mer i.moh))
36− $(mer t.mer, moh t.moh)
37− ::
38−
39−Examples
40−--------
41−
42− ~zod/try=> (fain / %)
43− [p=[[p=~zod q=%try r=[%da p=~2014.11.1..00.07.17..c835]] s=/] q=/]
44− ~zod/try=> (fain /lok %)
45− ! exit
46− ~zod/try=> (fain / %/mer/lok/tem)
47− [ p=[[p=~zod q=%try r=[%da p=~2014.11.1..00.08.03..bfdf]] s=/]
48− q=/tem/lok/mer
49− ]
50− ~zod/try=> (fain /mer %/mer/lok/tem)
51− [p=[[p=~zod q=%try r=[%da p=~2014.11.1..00.08.15..4da0]] s=/mer] q=/tem/lok]
52− ~zod/try=> (fain /lok/mer %/mer/lok/tem)
53− [p=[[p=~zod q=%try r=[%da p=~2014.11.1..00.08.24..4d9e]] s=/lok/mer] q=/tem]
54− ~zod/try=> (fain /lok/mer %/mer)
55− ! exit
56− ~zod/try=> (fain /hook/hymn/tor %/tor/hymn/hook/'._req_1234__')
57− [ p=[[p=~zod q=%try r=[%da p=~2014.11.1..00.09.25..c321]] s=/hook/hymn/tor]
58− q=/._req_1234__
59− ]
60−
61−
reference/library/zuse/gate/feel.udondeleted−52
@@ -1,52 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−### `++feel`
7−
8−Generate file diff
9−
10−Generates a diff between a file located at `pax` and an input value
11−`val`.
12−
13−Accepts
14−-------
15−
16−`pax` is a [`++path`]().
17−
18−`val` is a value as a [noun]().
19−
20−Produces
21−--------
22−
23−A [`++miso`]().
24−
25−Source
26−------
27−
28− ++ feel :: simple file write
29− |= [pax=path val=*]
30− ^- miso
31− =+ dir=((hard arch) .^(%cy pax))
32− ?~ q.dir [%ins val]
33− :- %mut
34− ^- udon
35− [%a %a .^(%cx pax) val]
36− ::
37−
38−Examples
39−--------
40−
41− ~zod/try=> + %/mel 'test'
42− + /~zod/try/2/mel
43− ~zod/try=> (feel %/mel 'tesh?')
44− [%mut p=[p=%a q=[%a p=44.903.392.628 q=272.335.332.724]]]
45− ~zod/try=> `@t`44.903.392.628
46− '''
47− test
48− '''
49− ~zod/try=> `@t`272.335.332.724
50− 'tesh?'
51−
52−
reference/library/zuse/gate/file.udondeleted−49
@@ -1,49 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−### `++file`
7−
8−Simple file load
9−
10−Reads the value of a file located at `pax` and renders it as a
11−[`++unit`]().
12−
13−Accepts
14−-------
15−
16−`pax` is a [`++path`]().
17−
18−Produces
19−--------
20−
21−The `++unit` of a [`++noun`]().
22−
23−Source
24−------
25−
26− ++ file :: simple file load
27− |= pax=path
28− ^- (unit)
29− =+ dir=((hard arch) .^(%cy pax))
30− ?~(q.dir ~ [~ .^(%cx pax)])
31− ::
32−
33−Examples
34−--------
35−
36− ~zod/try=> %/zak
37− ~zod/try=/zak> :ls %
38− ~zod/try=/zak> + %/mop 20
39− + /~zod/try/3/zak/mop
40− ~zod/try=/zak> :ls %
41− mop
42− ~zod/try=/zak> (file %/mop)
43− [~ 20]
44− ~zod/try=/zak> (file %/lak)
45− ~
46− ~zod/try=/zak> (file /==2%/mop)
47− ~
48−
49−
reference/library/zuse/gate/foal.udondeleted−48
@@ -1,48 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−
7−### `++foal`
8−
9−Write high-level change
10−
11−Produces a [`++toro`](), a change intended for whatever file is located
12−at `pax`. Handled by `%clay`.
13−
14−Accepts
15−-------
16−
17−`pax` is a [`++path`]().
18−
19−`val` is a value as a [noun]().
20−
21−Produces
22−--------
23−
24−A [`++toro`]().
25−
26−Source
27−------
28−
29− ++ foal :: high-level write
30− |= [pax=path val=*]
31− ^- toro
32− ?> ?=([* * * *] pax)
33− [i.t.pax [%& [*cart [[t.t.t.pax (feel pax val)] ~]]]]
34− ::
35−
36−Examples
37−--------
38−
39− ~zod/try=> + %/mek 'a'
40− + /~zod/try/4/mek
41− ~zod/try=> (foal %/mek 'b')
42− [ p=~.try
43− q
44− [%.y q=[p=[p=0v0 q=0v0] q=~[[p=/mek q=[%mut p=[p=%a q=[%a p=97 q=98]]]]]]]
45− ]
46− ~zod/try=> (feel %/mek 'b')
47− [%mut p=[p=%a q=[%a p=97 q=98]]]
48−
reference/library/zuse/gate/fray.udondeleted−43
@@ -1,43 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−
7−### `++fray`
8−
9−High-level delete
10−
11−Produces a deletion [`++toro`]() for a file located at path `pax`.
12−Handled by `%clay`.
13−
14−Accepts
15−-------
16−
17−`pax` is a [`++path`]().
18−
19−Produces
20−--------
21−
22−A `++toro`.
23−
24−Source
25−------
26−
27− ++ fray :: high-level delete
28− |= pax=path
29− ^- toro
30− ?> ?=([* * * *] pax)
31− [i.t.pax [%& [*cart [[t.t.t.pax [%del .^(%cx pax)]] ~]]]]
32− ::
33−
34−Examples
35−--------
36−
37− ~zod/try=> + %/mek 'a'
38− + /~zod/try/4/mek
39− ~zod/try=> (fray %/mek)
40− [p=~.try q=[%.y q=[p=[p=0v0 q=0v0] q=~[[p=/mek q=[%del p=97]]]]]]
41− ~zod/try=> `@t`97
42− 'a'
43−
reference/library/zuse/gate/fuel.udondeleted−82
@@ -1,82 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−### `++fuel`
7−
8−Parse fcgi
9−
10−Retrieieves the %eyre FCGI, producing a [`++epic`](). Used primarily in
11−[`/hook`]() files. See the [`%eyre`]() doc for more detail.
12−
13−Accepts
14−-------
15−
16−`bem` is a [`++beam`]().
17−
18−`but` is a [`++path`]().
19−
20−Produces
21−--------
22−
23−A `++epic`.
24−
25−Source
26−------
27−
28− ++ fuel :: parse fcgi
29− |= [bem=beam but=path]
30− ^- epic
31− ?> ?=([%web @ *] but)
32− =+ dyb=(slay i.t.but)
33− ?> ?& ?=([~ %many *] dyb)
34− ?=([* * *] p.u.dyb)
35− :: ?=([%$ %tas *] i.p.u.dyb)
36− ?=([%many *] i.p.u.dyb)
37− ?=([%blob *] i.t.p.u.dyb)
38− ==
39− =+ ced=((hard cred) p.i.t.p.u.dyb)
40− :: =+ nep=q.p.i.p.u.dyb
41− =+ ^= nyp ^- path
42− %+ turn p.i.p.u.dyb
43− |= a=coin ^- @ta
44− ?> ?=([%$ %ta @] a)
45− ?>(((sane %ta) q.p.a) q.p.a)
46− =+ ^= gut ^- (list ,@t)
47− %+ turn t.t.p.u.dyb
48− |= a=coin ^- @t
49− ?> ?=([%$ %t @] a)
50− ?>(((sane %t) q.p.a) q.p.a)
51− =+ ^= quy
52− |- ^- (list ,[p=@t q=@t])
53− ?~ gut ~
54− ?> ?=(^ t.gut)
55− [[i.gut i.t.gut] $(gut t.t.gut)]
56− :* (~(gas by *(map cord cord)) quy)
57− ced
58− bem
59− t.t.but
60− nyp
61− ==
62− ::
63−
64−Examples
65−--------
66−
67− ~zod/main=> (fuel [[p=~zod q=%try r=[%ud p=2]] s=/psal] /web/'._.~-~~~~.gen~-~-_~~05vg0001v09f0n30fbh7dn6ab2jakmmspdq04nef5h70qbd5lh6atr4c5j2qrbldpp62q1df1in0sr1ding0c3qgt7kclj74qb65lm6atrkc5k2qpr5e1mmispdchin4p3fegmiqrjpdlo62p1dchsn4p39comn8pbcehgmsbbef5p7crrifr3o035dhgfrk2b5__')
68− [ qix={}
69− ced
70− [ hut=[p=%.y q=[~ 8.445] r=[%.n p=.0.0.0.0]]
71− aut={[p=%$ q={'~rovryn-natlet-fidryd-dapmyn--todred-simpeg-hatwel-firfet'}]}
72− orx='laspex-harnum-fadweb-mipbyn'
73− acl=[~ 'en-US,en;q=0.8']
74− cip=[%.y p=.127.0.0.1]
75− cum={}
76− ]
77− bem=[[p=~zod q=%try r=[%ud p=2]] s=/psal]
78− but=/
79− nyp=/gen
80− ]
81−
82−
reference/library/zuse/gate/furl.udondeleted−55
@@ -1,55 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−### `++furl`
7−
8−Unify changes
9−
10−Merge two [`++toro`]()s `one` and `two` that are in the same [`desk`]()
11−and pointed at the same [`++path`]().
12−
13−Accepts
14−-------
15−
16−`one` is a `++toro`.
17−
18−`two` is a `++toro`.
19−
20−Produces
21−--------
22−
23−A `++toro`.
24−
25−Source
26−------
27−
28− ++ furl :: unify changes
29− |= [one=toro two=toro]
30− ^- toro
31− ~| %furl
32− ?> ?& =(p.one p.two) :: same path
33− &(?=(& -.q.one) ?=(& -.q.two)) :: both deltas
34− ==
35− [p.one [%& [*cart (weld q.q.q.one q.q.q.two)]]]
36− ::
37−
38−Examples
39−--------
40−
41− ~zod/try=> %/zak
42− ~zod/try=/zak> :ls %
43− mop
44− ~zod/try=/zak> (furl (fray %/mop) (foal %/mok 'hi'))
45− [ p=~.try
46− q
47− [ %.y
48− q
49− [ p=[p=0v0 q=0v0]
50− q=~[[p=/zak/mop q=[%del p=20]] [p=/zak/mok q=[%ins p=26.984]]]
51− ]
52− ]
53− ]
54−
55−
reference/library/zuse/gate/glam.udondeleted−89
@@ -1,89 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−### `++glam`
7−
8−Galaxy names
9−
10−Retrieves the 'name' of a given Galaxy.
11−
12−Accepts
13−-------
14−
15−`zar` is a `@p` of one byte, the length of a Galaxy name.
16−
17−Source
18−------
19−
20− ++ glam
21− |= zar=@pD ^- tape
22− %+ snag zar
23− ^- (list tape)
24− :~ "Tianming" "Pepin the Short" "Haile Selassie" "Alfred the Great"
25− "Tamerlane" "Pericles" "Talleyrand" "Yongle" "Seleucus"
26− "Uther Pendragon" "Louis XVI" "Ahmad Shāh Durrānī" "Constantine"
27− "Wilhelm I" "Akbar" "Louis XIV" "Nobunaga" "Alexander VI"
28− "Philippe II" "Julius II" "David" "Niall Noígíallach" "Kublai Khan"
29− "Öz Beg Khan" "Ozymandias" "Ögedei Khan" "Jiang Jieshi" "Darius"
30− "Shivaji" "Qianlong" "Bolesław I Chrobry" "Tigranes" "Han Wudi"
31− "Charles X" "Naresuan" "Frederick II" "Simeon" "Kangxi"
32− "Suleiman the Magnificent" "Pedro II" "Genghis Khan" "Laozi"
33− "Porfirio Díaz" "Pakal" "Wu Zetian" "Garibaldi" "Matthias Corvinus"
34− "Leopold II" "Leonidas" "Sitting Bull" "Nebuchadnezzar II"
35− "Rhodes" "Henry VIII" "Attila" "Catherine II" "Chulalongkorn"
36− "Uthmān" "Augustus" "Faustin" "Chongde" "Justinian"
37− "Afonso de Albuquerque" "Antoninus Pius" "Cromwell" "Innocent X"
38− "Fidel" "Frederick the Great" "Canute" "Vytautas" "Amina"
39− "Hammurabi" "Suharto" "Victoria" "Hiawatha" "Paul V" "Shaka"
40− "Lê Thánh Tông" "Ivan Asen II" "Tiridates" "Nefertiti" "Gwangmu"
41− "Ferdinand & Isabella" "Askia" "Xuande" "Boris Godunov" "Gilgamesh"
42− "Maximillian I" "Mao" "Charlemagne" "Narai" "Hanno" "Charles I & V"
43− "Alexander II" "Mansa Musa" "Zoe Porphyrogenita" "Metternich"
44− "Robert the Bruce" "Pachacutec" "Jefferson" "Solomon" "Nicholas I"
45− "Barbarossa" "FDR" "Pius X" "Gwanggaeto" "Abbas I" "Julius Caesar"
46− "Lee Kuan Yew" "Ranavalona I" "Go-Daigo" "Zenobia" "Henry V"
47− "Bảo Đại" "Casimir III" "Cyrus" "Charles the Wise" "Sandrokottos"
48− "Agamemnon" "Clement VII" "Suppiluliuma" "Deng Xiaoping"
49− "Victor Emmanuel" "Ajatasatru" "Jan Sobieski" "Huangdi" "Xuantong"
50− "Narmer" "Cosimo de' Medici" "Möngke Khan" "Stephen Dušan" "Henri IV"
51− "Mehmed Fatih" "Conn Cétchathach" "Francisco Franco" "Leo X"
52− "Kammu" "Krishnadevaraya" "Elizabeth I" "Norton I" "Washington"
53− "Meiji" "Umar" "TR" "Peter the Great" "Agustin I" "Ashoka"
54− "William the Conqueror" "Kongolo Mwamba" "Song Taizu"
55− "Ivan the Terrible" "Yao" "Vercingetorix" "Geronimo" "Rurik"
56− "Urban VIII" "Alexios Komnenos" "Maria I" "Tamar" "Bismarck"
57− "Arthur" "Jimmu" "Gustavus Adolphus" "Suiko" "Basil I" "Montezuma"
58− "Santa Anna" "Xerxes" "Beyazıt Yıldırım" "Samudragupta" "James I"
59− "George III" "Kamehameha" "Francesco Sforza" "Trajan"
60− "Rajendra Chola" "Hideyoshi" "Cleopatra" "Alexander"
61− "Ashurbanipal" "Paul III" "Vespasian" "Tecumseh" "Narasimhavarman"
62− "Suryavarman II" "Bokassa I" "Charles Canning" "Theodosius"
63− "Francis II" "Zhou Wen" "William Jardine" "Ahmad al-Mansur"
64− "Lajos Nagy" "Theodora" "Mussolini" "Samuil" "Osman Gazi"
65− "Kim Il-sung" "Maria Theresa" "Lenin" "Tokugawa" "Marcus Aurelius"
66− "Nzinga Mbande" "Edward III" "Joseph II" "Pulakesi II" "Priam"
67− "Qin Shi Huang" "Shah Jahan" "Sejong" "Sui Wendi" "Otto I"
68− "Napoleon III" "Prester John" "Dido" "Joao I" "Gregory I"
69− "Gajah Mada" "Abd-ar Rahmān III" "Taizong" "Franz Josef I"
70− "Nicholas II" "Gandhi" "Chandragupta II" "Peter III"
71− "Oba Ewuare" "Louis IX" "Napoleon" "Selim Yavuz" "Shun"
72− "Hayam Wuruk" "Jagiełło" "Nicaule" "Sargon" "Saladin" "Charles II"
73− "Brian Boru" "Da Yu" "Antiochus III" "Charles I"
74− "Jan Pieterszoon Coen" "Hongwu" "Mithridates" "Hadrian" "Ptolemy"
75− "Benito Juarez" "Sun Yat-sen" "Raja Raja Chola" "Bolivar" "Pius VII"
76− "Shapur II" "Taksin" "Ram Khamhaeng" "Hatshepsut" "Alī" "Matilda"
77− "Ataturk"
78− ==
79− ::
80−
81−Examples
82−--------
83−
84− ~zod/main=> (glam ~zod)
85− "Tianming"
86− ~zod/main=> (glam ~fyr)
87− "Bolivar"
88−
89−
reference/library/zuse/gate/glon.udondeleted−221
@@ -1,221 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−### `++glon`
7−
8−ISO language code
9−
10−XX
11−
12−Accepts
13−-------
14−
15−`lag` is a [`++lang`]().
16−
17−Source
18−------
19−
20− ++ glon
21− |= lag=lang
22− ^- (unit tape)
23− ?+ lag ~
24− %aa [~ "Afar"]
25− %ab [~ "Abkhazian"]
26− %ae [~ "Avestan"]
27− %af [~ "Afrikaans"]
28− %ak [~ "Akan"]
29− %am [~ "Amharic"]
30− %an [~ "Aragonese"]
31− %ar [~ "Arabic"]
32− %as [~ "Assamese"]
33− %av [~ "Avaric"]
34− %ay [~ "Aymara"]
35− %az [~ "Azerbaijani"]
36− %ba [~ "Bashkir"]
37− %be [~ "Belarusian"]
38− %bg [~ "Bulgarian"]
39− %bh [~ "Bihari"]
40− %bi [~ "Bislama"]
41− %bm [~ "Bambara"]
42− %bn [~ "Bengali"]
43− %bo [~ "Tibetan"]
44− %br [~ "Breton"]
45− %bs [~ "Bosnian"]
46− %ca [~ "Catalan"]
47− %ce [~ "Chechen"]
48− %ch [~ "Chamorro"]
49− %co [~ "Corsican"]
50− %cr [~ "Cree"]
51− %cs [~ "Czech"]
52− %cu [~ "Slavonic"]
53− %cv [~ "Chuvash"]
54− %cy [~ "Welsh"]
55− %da [~ "Danish"]
56− %de [~ "German"]
57− %dv [~ "Maldivian"]
58− %dz [~ "Dzongkha"]
59− %ee [~ "Ewe"]
60− %el [~ "Greek"]
61− %en [~ "English"]
62− %eo [~ "Esperanto"]
63− %es [~ "Spanish"]
64− %et [~ "Estonian"]
65− %eu [~ "Basque"]
66− %fa [~ "Persian"]
67− %ff [~ "Fulah"]
68− %fi [~ "Finnish"]
69− %fj [~ "Fijian"]
70− %fo [~ "Faroese"]
71− %fr [~ "French"]
72− %fy [~ "Frisian"]
73− %ga [~ "Irish Gaelic"]
74− %gd [~ "Scottish Gaelic"]
75− %gl [~ "Galician"]
76− %gn [~ "Guarani"]
77− %gu [~ "Gujarati"]
78− %gv [~ "Manx"]
79− %ha [~ "Hausa"]
80− %he [~ "Hebrew"]
81− %hi [~ "Hindi"]
82− %ho [~ "Hiri Motu"]
83− %hr [~ "Croatian"]
84− %ht [~ "Haitian Creole"]
85− %hu [~ "Hungarian"]
86− %hy [~ "Armenian"]
87− %hz [~ "Herero"]
88− %ia [~ "Interlingua"]
89− %id [~ "Indonesian"]
90− %ie [~ "Occidental"]
91− %ig [~ "Igbo"]
92− %ii [~ "Nuosu"]
93− %ik [~ "Inupiaq"]
94− %io [~ "Ido"]
95− %is [~ "Icelandic"]
96− %it [~ "Italian"]
97− %iu [~ "Inuktitut"]
98− %ja [~ "Japanese"]
99− %jv [~ "Javanese"]
100− %ka [~ "Georgian"]
101− %kg [~ "Kongo"]
102− %ki [~ "Kikuyu"]
103− %kj [~ "Kwanyama"]
104− %kk [~ "Kazakh"]
105− %kl [~ "Kalaallisut"]
106− %km [~ "Central Khmer"]
107− %kn [~ "Kannada"]
108− %ko [~ "Korean"]
109− %kr [~ "Kanuri"]
110− %ks [~ "Kashmiri"]
111− %ku [~ "Kurdish"]
112− %kv [~ "Komi"]
113− %kw [~ "Cornish"]
114− %ky [~ "Kyrgyz"]
115− %la [~ "Latin"]
116− %lb [~ "Luxembourgish"]
117− %lg [~ "Ganda"]
118− %li [~ "Limburgish"]
119− %ln [~ "Lingala"]
120− %lo [~ "Lao"]
121− %lt [~ "Lithuanian"]
122− %lu [~ "Luba-Katanga"]
123− %lv [~ "Latvian"]
124− %mg [~ "Malagasy"]
125− %mh [~ "Marshallese"]
126− %mi [~ "Maori"]
127− %mk [~ "Macedonian"]
128− %ml [~ "Malayalam"]
129− %mn [~ "Mongolian"]
130− %mr [~ "Marathi"]
131− %ms [~ "Malay"]
132− %mt [~ "Maltese"]
133− %my [~ "Burmese"]
134− %na [~ "Nauru"]
135− %nb [~ "Norwegian Bokmål"]
136− %nd [~ "North Ndebele"]
137− %ne [~ "Nepali"]
138− %ng [~ "Ndonga"]
139− %nl [~ "Dutch"]
140− %nn [~ "Norwegian Nynorsk"]
141− %no [~ "Norwegian"]
142− %nr [~ "South Ndebele"]
143− %nv [~ "Navajo"]
144− %ny [~ "Chichewa"]
145− %oc [~ "Occitan"]
146− %oj [~ "Ojibwa"]
147− %om [~ "Oromo"]
148− %or [~ "Oriya"]
149− %os [~ "Ossetian"]
150− %pa [~ "Punjabi"]
151− %pi [~ "Pali"]
152− %pl [~ "Polish"]
153− %ps [~ "Pashto"]
154− %pt [~ "Portuguese"]
155− %qu [~ "Quechua"]
156− %rm [~ "Romansh"]
157− %rn [~ "Rundi"]
158− %ro [~ "Romanian"]
159− %ru [~ "Russian"]
160− %rw [~ "Kinyarwanda"]
161− %sa [~ "Sanskrit"]
162− %sc [~ "Sardinian"]
163− %sd [~ "Sindhi"]
164− %se [~ "Northern Sami"]
165− %sg [~ "Sango"]
166− %si [~ "Sinhala"]
167− %sk [~ "Slovak"]
168− %sl [~ "Slovenian"]
169− %sm [~ "Samoan"]
170− %sn [~ "Shona"]
171− %so [~ "Somali"]
172− %sq [~ "Albanian"]
173− %sr [~ "Serbian"]
174− %ss [~ "Swati"]
175− %st [~ "Sotho"]
176− %su [~ "Sundanese"]
177− %sv [~ "Swedish"]
178− %sw [~ "Swahili"]
179− %ta [~ "Tamil"]
180− %te [~ "Telugu"]
181− %tg [~ "Tajik"]
182− %th [~ "Thai"]
183− %ti [~ "Tigrinya"]
184− %tk [~ "Turkmen"]
185− %tl [~ "Tagalog"]
186− %tn [~ "Tswana"]
187− %to [~ "Tonga"]
188− %tr [~ "Turkish"]
189− %ts [~ "Tsonga"]
190− %tt [~ "Tatar"]
191− %tw [~ "Twi"]
192− %ty [~ "Tahitian"]
193− %ug [~ "Uighur"]
194− %uk [~ "Ukrainian"]
195− %ur [~ "Urdu"]
196− %uz [~ "Uzbek"]
197− %ve [~ "Venda"]
198− %vi [~ "Vietnamese"]
199− %vo [~ "Volapük"]
200− %wa [~ "Walloon"]
201− %wo [~ "Wolof"]
202− %xh [~ "Xhosa"]
203− %yi [~ "Yiddish"]
204− %yo [~ "Yoruba"]
205− %za [~ "Zhuang"]
206− %zh [~ "Chinese"]
207− %zu [~ "Zulu"]
208− ==
209− ::
210−
211−Examples
212−--------
213−
214− ~zod/main=> (glon %cs)
215− [~ "Czech"]
216− ~zod/main=> (glon %en)
217− [~ "English"]
218− ~zod/main=> (glon %mz)
219− ~
220−
221−
reference/library/zuse/gate/gnom.udondeleted−43
@@ -1,43 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−### `++gnom`
7−
8−Display ship name
9−
10−Fetches a ship's display name from %ames.
11−
12−Accepts
13−-------
14−
15−`our` is a [`@p`]().
16−
17−`now` is a [`@da`]().
18−
19−`him` is a [`@p`]().
20−
21−Source
22−------
23−
24− ++ gnom :: ship display name
25− |= [[our=@p now=@da] him=@p] ^- @t
26− =+ yow=(scot %p him)
27− =+ pax=[(scot %p our) %name (scot %da now) yow ~]
28− =+ woy=((hard ,@t) .^(%a pax))
29− ?: =(%$ woy) yow
30− (rap 3 yow ' ' woy ~)
31− ::
32−
33−Examples
34−--------
35−
36− ~zod/main=> (gnom [->-< -<-] ~zod)
37− '~zod |Tianming|'
38− ~zod/main=> (gnom [->-< -<-] ~doznec)
39− '~doznec ~doznec'
40− ~zod/main=> (gnom [->-< -<-] ~tug)
41− '~tug |Go-Daigo|'
42−
43−
reference/library/zuse/gate/jape.udondeleted−43
@@ -1,43 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−### `++jape`
7−
8−`++json` string from tape
9−
10−Produces a [`++json`]() string from a [`++tape`]().
11−
12−Accepts
13−-------
14−
15−A [`++tape`]().
16−
17−Produces
18−--------
19−
20−A `++json`.
21−
22−Source
23−------
24−
25− ++ jape :: string from tape
26− |= a=tape
27− ^- json
28− [%s (crip a)]
29− ::
30−
31−Examples
32−--------
33−
34− ~zod/try=> (jape ~)
35− [%s p=~.]
36− ~zod/try=> (jape "lam")
37− [%s p=~.lam]
38− ~zod/try=> (crip (pojo (jape "lam")))
39− '"lam"'
40− ~zod/try=> (crip (pojo (jape "semtek som? zeplo!")))
41− '"semtek som? zeplo!"'
42−
43−
reference/library/zuse/gate/jesc.udondeleted−46
@@ -1,46 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−### `++jesc`
7−
8−Escape JSON character
9−
10−Produces a [`++tape`]() of an escaped [`++json`](/docs/hoon/library/3bi#++json) character `a`.
11−
12−Accepts
13−-------
14−
15−`a` is an atom of odor [`@tD`](), aka a [`++char`]().
16−
17−Produces
18−--------
19−
20−A [`++tape`]().
21−
22−Source
23−------
24−
25− ++ jesc
26− |= a=@ ^- tape
27− ?+ a [a ~]
28− 10 "\\n"
29− 34 "\\\""
30− 92 "\\\\"
31− ==
32− ::
33−
34−Examples
35−--------
36−
37− ~zod/try=> (jesc 'a')
38− "a"
39− ~zod/try=> (jesc 'c')
40− "c"
41− ~zod/try=> (jesc '\\')
42− "\\"
43− ~zod/try=> (jesc '"')
44− "\""
45−
46−
reference/library/zuse/gate/joba.udondeleted−45
@@ -1,45 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−### `++joba`
7−
8−`++json` from key-value pair
9−
10−Produces a ++json object with one key-value pair.
11−
12−Accepts
13−-------
14−
15−`p` is a `@t` key.
16−
17−`q` is a [`++json`]().
18−
19−Produces
20−--------
21−
22−A [`++json`]().
23−
24−Source
25−------
26−
27− ++ joba :: object from k-v pair
28− |= [p=@t q=json]
29− ^- json
30− [%o [[p q] ~ ~]]
31− ::
32−
33−Examples
34−--------
35−
36− ~zod/try=> (joba %hi %b |)
37− [%o p={[p='hi' q=[%b p=%.n]]}]
38− ~zod/try=> (crip (pojo (joba %hi %b |)))
39− '{"hi":false}'
40− ~zod/try=> (joba %hi (jone 2.130))
41− [%o p={[p='hi' q=[%n p=~.2130]]}]
42− ~zod/try=> (crip (pojo (joba %hi (jone 2.130))))
43− '{"hi":2130}'
44−
45−
reference/library/zuse/gate/jobe.udondeleted−39
@@ -1,39 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−### `++jobe`
7−
8−Object from key-value list
9−
10−Produces a `++json` object from a [`++list`]() `a` of key to `++json` values.
11−
12−Accepts
13−-------
14−
15−`a` is a [`++list`]() of [`++cord`]() to [`++json`]() values.
16−
17−Produces
18−--------
19−
20−A `++json`.
21−
22−Source
23−------
24−
25− ++ jobe :: object from k-v list
26− |= a=(list ,[p=@t q=json])
27− ^- json
28− [%o (~(gas by *(map ,@t json)) a)]
29− ::
30−
31−Examples
32−--------
33−
34− ~zod/try=> (jobe a/n/'20' b/~ c/a/~[s/'mol'] ~)
35− [%o p={[p='a' q=[%n p=~.20]] [p='c' q=[%a p=~[[%s p=~.mol]]]] [p='b' q=~]}]
36− ~zod/try=> (crip (pojo (jobe a/n/'20' b/~ c/a/~[s/'mol'] ~)))
37− '{"b":null,"c":["mol"],"a":20}'
38−
39−
reference/library/zuse/gate/jone.udondeleted−45
@@ -1,45 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−### `++jone`
7−
8−`++json` number from unigned
9−
10−Produces a `++json` number from an unsigned atom.
11−
12−Accepts
13−-------
14−
15−`a` is an atom of odor [`@u`]().
16−
17−Produces
18−--------
19−
20−A [`++json`]().
21−
22−Source
23−------
24−
25− ++ jone :: number from unsigned
26− |= a=@u
27− ^- json
28− :- %n
29− ?: =(0 a) '0'
30− (crip (flop |-(^-(tape ?:(=(0 a) ~ [(add '0' (mod a 10)) $(a (div a 10))])))))
31− ::
32−
33−Examples
34−--------
35−
36− ~zod/try=> (jone 1)
37− [%n p=~.1]
38− ~zod/try=> (pojo (jone 1))
39− "1"
40− ~zod/try=> (jone 1.203.196)
41− [%n p=~.1203196]
42− ~zod/try=> (pojo (jone 1.203.196))
43− "1203196"
44−
45−
reference/library/zuse/gate/lead.udondeleted−53
@@ -1,53 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−### `++lead`
7−
8−Subtract leap seconds
9−
10−Produces an absolute date ([`@ud`]()) with the 25 leap seconds
11−subtracted.
12−
13−Accepts
14−-------
15−
16−`ley` is a [`++date`]().
17−
18−Produces
19−--------
20−
21−An atom of [odor]() [`@da`](), which represents an absolute date.
22−
23−Source
24−------
25−
26− ++ lead :: from leap sec time
27− |= ley=date
28− =+ ler=(year ley)
29− =+ n=0
30− |- ^- @da
31− =+ led=(sub ler (mul n ~s1))
32− ?: (gte ler (add (snag n les:yu) ~s1))
33− led
34− ?: &((gte ler (snag n les:yu)) (lth ler (add (snag n les:yu) ~s1)))
35− ?: =(s.t.ley 60)
36− (sub led ~s1)
37− led
38− ?: =(+(n) (lent les:yu))
39− (sub led ~s1)
40− $(n +(n))
41− ::
42−
43−Examples
44−--------
45−
46− ~zod/try=> (yore `@da`(bex 127))
47− [[a=%.y y=226] m=12 t=[d=5 h=15 m=30 s=8 f=~]]
48− ~zod/try=> (lead (yore `@da`(bex 127)))
49− ~226.12.5..15.29.43
50− ~zod/try=> (lead (yore `@da`(bex 126)))
51− ~146138512088-.6.19..07.44.39
52−
53−
reference/library/zuse/gate/mang.udondeleted−60
@@ -1,60 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−### `++mang`
7−
8−Unit: Slam gate with sample
9−
10−Produces a [`++unit`]() computation result from slamming `gat` with
11−`sam`, using `sky` to compute or block on nock 11 when applicable.
12−Similar to [`++mong`]().
13−
14−Accepts
15−-------
16−
17−`gat` is a [noun]() that is generally a [`gate`]().
18−
19−`sam` is a [`sample`]() noun.
20−
21−`sky` is an [%iron]() gate invoked with [nock operator 11]().
22−
23−Produces
24−--------
25−
26−The `++unit` of a noun.
27−
28−Source
29−------
30−
31− ++ mang
32− |= [[gat=* sam=*] sky=$+(* (unit))]
33− ^- (unit)
34− =+ ton=(mong [[gat sam] sky])
35− ?.(?=([0 *] ton) ~ [~ p.ton])
36− ::
37−
38−Examples
39−--------
40−
41− ~zod/try=> (mang [|=(@ 20) ~] ,~)
42− [~ 20]
43− ~zod/try=> (mang [|=(@ !!) ~] ,~)
44− ~
45− ~zod/try=> (mang [|=(a=@ (add 20 a)) ~] ,~)
46− [~ 20]
47− ~zod/try=> (mang [|=(a=[@ @] (add 20 -.a)) ~] ,~)
48− ~
49− ~zod/try=> (mang [|=(a=[@ @] (add 20 -.a)) [4 6]] ,~)
50− [~ 24]
51− ~zod/try=> (mang [|=(a=@ .^(a)) ~] ,~)
52− ~
53− ~zod/try=> (mang [|=(a=@ .^(a)) ~] ,[~ %42])
54− [~ 42]
55− ~zod/try=> (mang [|=(a=@ .^(a)) ~] |=(a=* [~ a 6]))
56− [~ [0 6]]
57− ~zod/try=> (mang [|=(a=@ .^(a)) 8] |=(a=* [~ a 6]))
58− [~ [8 6]]
59−
60−
reference/library/zuse/gate/meat.udondeleted−53
@@ -1,53 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−### `++meat`
7−
8−Kite to .^ path
9−
10−Converts a type request name to a [`++path`]().
11−
12−Accepts
13−-------
14−
15−`kit` is a [`++kite`]().
16−
17−Produces
18−--------
19−
20−A `++path`.
21−
22−Source
23−------
24−
25− ++ meat :: kite to .^ path
26− |= kit=kite
27− ^- path
28− [(cat 3 'c' p.kit) (scot %p r.kit) s.kit (scot `dime`q.kit) t.kit]
29− ::
30−
31−Examples
32−--------
33−
34− zod/try=/zop> `kite`[%x ud/1 ~zod %main /sur/down/gate/hook]
35− [p=%x q=[%ud p=1] r=~zod s=%main t=/sur/down/gate/hook]
36− ~zod/try=/zop> (meat [%x ud/1 ~zod %main /sur/down/gate/hook])
37− /cx/~zod/main/1/sur/down/gate/hook
38− ~zod/try=/zop> .^((meat [%x ud/1 ~zod %main /sur/down/gate/hook]))
39− 8.024.240.839.827.090.233.853.057.929.619.452.695.436.878.709.611.140.677.
40− 745.908.646.440.925.885.935.296.374.867.974.972.908.054.571.544.099.882.490.
41− 677.391.983.737.511.220.072.391.888.081.664.570
42− ~zod/try=/zop> (,@t .^((meat [%x ud/1 ~zod %main /sur/down/gate/hook])))
43− '''
44− ::
45− :::: /hoon/gate/down/sur
46− ::
47− /? 314
48− /- *markdown
49− down
50−
51− '''
52−
53−
reference/library/zuse/gate/moon.udondeleted−45
@@ -1,45 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−### `++moon`
7−
8−Mime type to `++cord`
9−
10−Renders a [mime](http://en.wikipedia.org/wiki/MIME) type path with infix
11−`/` to a [`++cord`]().
12−Accepts
13−-------
14−
15−`myn` is a ++[`mite`](), a [`++list`]() of [`@ta`]().
16−
17−Produces
18−--------
19−
20−A `++cord`.
21−
22−Source
23−------
24−
25− ++ moon :: mime type to text
26− |= myn=mite
27− %+ rap
28− 3
29− |- ^- tape
30− ?~ myn ~
31− ?: =(~ t.myn) (trip i.myn)
32− (weld (trip i.myn) `tape`['/' $(myn t.myn)])
33− ::
34−
35−Examples
36−--------
37−
38− ~zod/try=> `@t`(moon /image/png)
39− 'image/png'
40− ~zod/try=> `@t`(moon /text/x-hoon)
41− 'text/x-hoon'
42− ~zod/try=> `@t`(moon /application/x-pnacl)
43− 'application/x-pnacl'
44−
45−
reference/library/zuse/gate/mung.udondeleted−60
@@ -1,60 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−### `++mung`
7−
8−Virtualize slamming gate
9−
10−Produces a [`++tone`]() computation result from slamming `gat` with
11−`sam`, using `sky` to compute or block on nock 11 when applicable.
12−
13−Accepts
14−-------
15−
16−`gat` is a [noun]() that is generally a [`gate`]().
17−
18−`sam` is a [`sample`]() noun.
19−
20−`sky` is an [%iron]() gate invoked with [nock operator 11]().
21−
22−Produces
23−--------
24−
25−A `++tone`.
26−
27−Source
28−------
29−
30− ++ mung
31− |= [[gat=* sam=*] sky=$+(* (unit))]
32− ^- tone
33− ?. &(?=(^ gat) ?=(^ +.gat))
34− [%2 ~]
35− (mink [[-.gat [sam +>.gat]] -.gat] sky)
36− ::
37−
38−Examples
39−--------
40−
41− ~zod/try=> (mung [|=(@ 20) ~] ,~)
42− [%0 p=20]
43− ~zod/try=> (mung [|=(@ !!) ~] ,~)
44− [%2 p=~]
45− ~zod/try=> (mung [|=(a=@ (add 20 a)) ~] ,~)
46− [%0 p=20]
47− ~zod/try=> (mung [|=(a=[@ @] (add 20 -.a)) ~] ,~)
48− [%2 p=~]
49− ~zod/try=> (mung [|=(a=[@ @] (add 20 -.a)) [4 6]] ,~)
50− [%0 p=24]
51− ~zod/try=> (mung [|=(a=@ .^(a)) ~] ,~)
52− [%1 p=~[0]]
53− ~zod/try=> (mung [|=(a=@ .^(a)) ~] ,[~ %42])
54− [%0 p=42]
55− ~zod/try=> (mung [|=(a=@ .^(a)) ~] |=(a=* [~ a 6]))
56− [%0 p=[0 6]]
57− ~zod/try=> (mung [|=(a=@ .^(a)) 8] |=(a=* [~ a 6]))
58− [%0 p=[8 6]]
59−
60−
reference/library/zuse/gate/perk.udondeleted−54
@@ -1,54 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−### `++perk`
7−
8−Parse cube with fork
9−
10−Parser generator. Produces a parser that succeeds upon encountering one
11−of the [`++term`]()s in a faceless list `a`.
12−
13−A perk is an arm used to parse one of a finite set of options, formally
14−a choice between [`++term`]()s: if you want to match "true" or "false", and
15−nothing else, (perk \~[%true %false]) produces the relevant parser,
16−whose result type is `?(%true %false)`. For more complicated
17−transformations, a combintation of ++[`++sear`]() and map ++[`++get`]() is recommended,
18−e.g. `(sear ~(get by (mo ~[[%true &] [%false |]]))) sym)` will have a
19−similar effect but produce `?(& |)` , a [boolean](). However, constructions
20−such as `(sear (flit ~(has in (sa %true %false %other ~))) sym)` are
21−needlessly unwieldy.
22−
23−Accepts
24−-------
25−
26−`a` is a [`++pole`](), which is a [`++list`]() without [`%face`]()s.
27−
28−Produces
29−--------
30−
31−XX
32−
33−Source
34−------
35−
36− ++ perk :: parse cube with fork
37− |* a=(pole ,@tas)
38− ?~ a fail
39− ;~ pose
40− (cold -.a (jest -.a))
41− $(a +.a)
42− ==
43− ::
44−
45−Examples
46−--------
47−
48− ~zod/try=> (scan "ham" (perk %sam %ham %lam ~))
49− %ham
50− ~zod/try=> (scan "ram" (perk %sam %ham %lam ~))
51− ! {1 1}
52− ! exit
53−
54−
reference/library/zuse/gate/pojo.udondeleted−83
@@ -1,83 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−### `++pojo`
7−
8−Print JSON
9−
10−Renders a [`++json`]() `val` as a [`++tape`]().
11−
12−Accepts
13−-------
14−
15−`val` is a [`json`]().
16−
17−Produces
18−--------
19−
20−A `++tape`.
21−
22−Source
23−------
24−
25− ++ pojo :: print json
26− |= val=json
27− ^- tape
28− ?~ val "null"
29− ?- -.val
30− %a
31− ;: weld
32− "["
33− =| rez=tape
34− |- ^+ rez
35− ?~ p.val rez
36− $(p.val t.p.val, rez :(weld rez ^$(val i.p.val) ?~(t.p.val ~ ",")))
37− "]"
38− ==
39− ::
40− %b ?:(p.val "true" "false")
41− %n (trip p.val)
42− %s
43− ;: welp
44− "\""
45− %+ reel
46− (turn (trip p.val) jesc)
47− |=([p=tape q=tape] (welp +<))
48− "\""
49− ==
50− %o
51− ;: welp
52− "\{"
53− =+ viz=(~(tap by p.val) ~)
54− =| rez=tape
55− |- ^+ rez
56− ?~ viz rez
57− %= $
58− viz t.viz
59− rez
60− :(welp rez "\"" (trip p.i.viz) "\":" ^$(val q.i.viz) ?~(t.viz ~ ","))
61− ==
62− "}"
63− ==
64− ==
65− ::
66−
67−Examples
68−--------
69−
70− ~zod/try=> (pojo [%n '12.6'])
71− "12.6"
72− ~zod/try=> (crip (pojo %n '12.6'))
73− '12.6'
74− ~zod/try=> (crip (pojo %s 'samtel'))
75− '"samtel"'
76− ~zod/try=> (crip (pojo %a ~[(jone 12) (jape "ha")]))
77− '[12,"ha"]'
78− ~zod/try=> (crip (pojo %a ~[(jone 12) ~ (jape "ha")]))
79− '[12,null,"ha"]'
80− ~zod/try=> (crip (pojo %o (mo sale/(jone 12) same/b/| ~)))
81− '{"same":false,"sale":12}'
82−
83−
reference/library/zuse/gate/saxo.udondeleted−42
@@ -1,42 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−### `++saxo`
7−
8−List ancestors
9−
10−Lists the ancestors of `who`.
11−
12−Accepts
13−-------
14−
15−`who` is a [`++ship`]().
16−
17−Produces
18−--------
19−
20−A [`++list`]() of `++ship`.
21−
22−Source
23−------
24−
25− ++ saxo :: autocanon
26− |= who=ship
27− ^- (list ship)
28− ?: (lth who 256) [who ~]
29− [who $(who (sein who))]
30− ::
31−
32−Examples
33−--------
34−
35− ~zod/main=> (saxo ~pittyp-pittyp)
36− ~[~pittyp-pittyp ~dalnel ~del]
37− ~zod/main=> (saxo ~tasfyn-partyv)
38− ~[~tasfyn-partyv ~doznec ~zod]
39− ~zod/main=> (saxo ~ractul-fodsug-sibryg-modsyl--difrun-mirfun-filrec-patmet)
40− ~[~ractul-fodsug-sibryg-modsyl--difrun-mirfun-filrec-patmet ~zod]
41−
42−
reference/library/zuse/gate/scanf.udondeleted−88
@@ -1,88 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−### `++scanf` XX
7−
8−Formatted scan
9−
10− ++ scanf :: formatted scan
11− |* [tape (pole ,_:/(*$&(_rule tape)))]
12− => .(+< [a b]=+<)
13− (scan a (parsf b))
14−
15−Scan with `;"`-interpolated parsers.
16−
17−A- here there be monsters, monsters of my making. But the basic idea is
18−you use `;"` (which currently is parsed by sail but shouldn't be) to mix
19−literal text and [++rule]s, and apply this to text which is a
20−correspending mixture of aforementioned literals and sections parsable
21−by the relevant rules. ++parsf is the parser form that combines a
22−tape-rule mix into one big ++rule, ++norm being a parsf internal that
23−winnows the `;"` result into a list of discriminate literals and rules,
24−and ++bill doing the actual composing: ++\$:parsf just adds a layer that
25−collapses the result list to a tuple, such that (scanf "foo 1 2 bar"
26−;"foo {dem} {dem} bar") parses [1 2] and not [1 2 \~].
27−
28− ~zod/try=> `[p=@ud q=@ud]`(scanf "Score is 5 to 2" [;"Score is {n} to {n}"]:n=dim:ag)
29− [p=5 q=2]
30−
31− ~zod/try=> =n ;~(pfix (star (just '0')) (cook |=(@ud +<) dim:ag))
32− ~zod/try=> (scanf "2014-08-12T23:10:58.931Z" ;"{n}\-{n}\-{n}T{n}:{n}:{n}.{n}Z")
33− [2.014 8 12 23 10 58 931]
34− ~zod/try=> =dat (scanf "2014-08-12T23:10:58.931Z" ;"{n}\-{n}\-{n}T{n}:{n}:{n}.{n}Z")
35− ~zod/try=> `@da`(year `date`dat(- [%& -.dat], |6 ~[(div (mul |6.dat (bex 16)) 1.000)]))
36− ~2014.8.12..23.10.58..ee56
37−
38−### `++parsf` XX
39−
40− ++ parsf :: make parser from:
41− |^ |* a=(pole ,_:/(*$&(_rule tape))) :: ;"chars{rule}chars"
42− %- cook :_ (bill (norm a))
43− |* (list)
44− ?~ +< ~
45− ?~ t i
46− [i $(+< t)]
47− ::
48−
49−`parsf` generates a `_rule` from a tape with rules embedded in it,
50−literal sections being matched verbatim. The parsed type is a tuple of
51−the embedded rules' results.
52−
53−Two intermediate arms are used:
54−
55−#### ++norm XX
56−
57− :: .= (norm [;"{n}, {n}"]:n=dim:ag) ~[[& dim] [| ", "] [& dim]]:ag
58− ++ norm
59− |* (pole ,_:/(*$&(_rule tape)))
60− ?~ +< ~
61− => .(+< [i=+<- t=+<+])
62− :_ t=$(+< t)
63− =+ rul=->->.i
64− ^= i
65− ?~ rul [%| p=rul]
66− ?~ +.rul [%| p=rul]
67− ?@ &2.rul [%| p=;;(tape rul)]
68− [%& p=rul]
69− ::
70−
71−`norm` converts a `;"` pole of `[[%~. [%~. ?(tape _rule)] ~] ~]` into a
72−more convenient list of discriminated tapes and rules.
73−
74−#### ++bill XX
75−
76− :: .= (bill ~[[& dim] [| ", "] [& dim]]:ag)
77− :: ;~(plug dim ;~(pfix com ace ;~(plug dim (easy)))):ag
78− ++ bill
79− |* (list (each ,_rule tape))
80− ?~ +< (easy ~)
81− ?: ?=(| -.i) ;~(pfix (jest (crip p.i)) $(+< t))
82− %+ cook |*([* *] [i t]=+<)
83− ;~(plug p.i $(+< t))
84− --
85− ::
86−
87−`bill` builds a parser out of rules and tapes, ignoring the literal
88−sections and producing a list of the rules' results.
reference/library/zuse/gate/sein.udondeleted−61
@@ -1,61 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−### `++sein`
7−
8−Direct parent
9−
10−Computes the direct parent of `who`.
11−
12−Accepts
13−-------
14−
15−`who` is a [`++ship`]().
16−
17−Produces
18−--------
19−
20−A `++ship`.
21−
22−Source
23−------
24−
25− ++ sein :: autoboss
26− |= who=ship ^- ship
27− =+ mir=(clan who)
28− ?- mir
29− %czar who
30− %king (end 3 1 who)
31− %duke (end 4 1 who)
32− %earl (end 5 1 who)
33− %pawn `@p`0
34− ==
35−
36−Examples
37−--------
38−
39− ~zod/main=> (sein ~tasfyn-partyv)
40− ~doznec
41− ~zod/main=> (sein ~doznec)
42− ~zod
43− ~zod/main=> (sein ~zod)
44− ~zod
45− ~zod/main=> (sein ~pittyp-pittyp)
46− ~dalnel
47− ~zod/main=> (sein ~dalnel)
48− ~del
49− ~zod/main=> (sein ~ractul-fodsug-sibryg-modsyl--difrun-mirfun-filrec-patmet)
50− ~zod
51−
52− ~zod/main=> (saxo ~rabdec-monfer)
53− ~[~rabdec-monfer ~dalnel ~del]
54− ~zod/main=> `@rd`~rabdec-monfer
55− 0x5fd25
56− [%rlyd 0x5.fd25]
57− 0b1.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000.0000
58− ~zod/main=> `@p`0x5.fd25
59− ~rabdec-monfer
60−
61− For `@rd` and `@p` see the [odors](../reference/odors) reference
reference/library/zuse/gate/sifo.udondeleted−51
@@ -1,51 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−### `++sifo`
7−
8−64-bit encode
9−
10−Encodes an atom to MIME base64, producing a [`++tape`]().
11−
12−Accepts
13−-------
14−
15−`tig` is an atom.
16−
17−Produces
18−--------
19−
20−A `++tape`.
21−
22−Source
23−------
24−
25− ++ sifo :: 64-bit encode
26− |= tig=@
27− ^- tape
28− =+ poc=(~(dif fo 3) 0 (met 3 tig))
29− =+ pad=(lsh 3 poc (swap 3 tig))
30− =+ ^= cha
31− 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
32− =+ ^= sif
33− |- ^- tape
34− ?~ pad
35− ~
36− =+ d=(end 0 6 pad)
37− [(cut 3 [d 1] cha) $(pad (rsh 0 6 pad))]
38− (weld (flop (slag poc sif)) (trip (fil 3 poc '=')))
39− ::
40−
41−Examples
42−--------
43−
44− ~zod/main=> (sifo 'foobar')
45− "Zm9vYmFy"
46− ~zod/main=> (sifo 1)
47− "Q=="
48− ~zod/main=> (sifo (shax %hi))
49− "j0NDRmSPa5bfid2pAcUXaxCm2Dlh3TwayItZstwyeqQ="
50−
51−
reference/library/zuse/gate/stud.udondeleted−63
@@ -1,63 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−### `++stud`
7−
8−Parse UTC format
9−
10−Accepts a [`++tape`]() containing a date in UTC format and produces the
11−[`++unit`]() of a [`++date`]().
12−
13−Accepts
14−-------
15−
16−`cud` is a `++tape`.
17−
18−Produces
19−--------
20−
21−The `++unit` of a `++date`.
22−
23−Source
24−------
25−
26− ++ stud :: parse UTC format
27− |= cud=tape
28− ^- (unit date)
29− =- ?~ tud ~
30− `[[%.y &3.u.tud] &2.u.tud &1.u.tud &4.u.tud &5.u.tud &6.u.tud ~]
31− ^= tud
32− %+ rust cud
33− ;~ plug
34− ;~(pfix (stun [5 5] next) dim:ag)
35− ::
36− %+ cook
37− |= a=tape
38− =+ b=0
39− |- ^- @
40− ?: =(a (snag b (turn mon:yu |=(a=tape (scag 3 a)))))
41− +(b)
42− $(b +(b))
43− (ifix [ace ace] (star alf))
44− ::
45− ;~(sfix dim:ag ace)
46− ;~(sfix dim:ag col)
47− ;~(sfix dim:ag col)
48− dim:ag
49− (cold ~ (star next))
50− ==
51− ::
52−
53−Examples
54−--------
55−
56− ~zod/try=> (stud "Tue, 21 Oct 2014 21:21:55 +0000")
57− [~ [[a=%.y y=2.014] m=10 t=[d=21 h=21 m=21 s=55 f=~]]]
58− ~zod/try=> (stud "Wed, 11 Oct 2002 12:20:55 +0000")
59− [~ [[a=%.y y=2.002] m=10 t=[d=11 h=12 m=20 s=55 f=~]]]
60− ~zod/try=> (stud "Wed, 11 Oct 2002")
61− ~
62−
63−
reference/library/zuse/gate/taco.udondeleted−32
@@ -1,32 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−### `++taco`
7−
8−Converts an atom to an octet stream [`++octs`](), which contains a length, to
9−encode trailing zeroes.
10−
11−Produces
12−--------
13−
14−An `++octs`.
15−
16−Source
17−------
18−
19− ++ taco :: atom to octstream
20− |= tam=@ ^- octs
21− [(met 3 tam) tam]
22− ::
23−
24−Examples
25−--------
26−
27− ~zod/try=> (taco 'abc')
28− [p=3 q=6.513.249]
29− ~zod/try=> `@t`6.513.249
30− 'abc'
31−
32−
reference/library/zuse/gate/tact.udondeleted−39
@@ -1,39 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−### `++tact`
7−
8−tape to octs
9−
10−Converts a `++tape` to an octet stream ([`++octs`](), which contains a length
11−to encode trailing zeroes.
12−
13−Accepts
14−-------
15−
16−A `++tape`.
17−
18−Produces
19−--------
20−
21−An [`++octs`]().
22−
23−Source
24−------
25−
26− ++ tact :: tape to octstream
27− |= tep=tape ^- octs
28− (taco (rap 3 tep))
29− ::
30−
31−Examples
32−--------
33−
34− ~zod/try=> (tact "abc")
35− [p=3 q=6.513.249]
36− ~zod/try=> `@t`6.513.249
37− 'abc'
38−
39−
reference/library/zuse/gate/tame.udondeleted−59
@@ -1,59 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−### `++tame`
7−
8−Parse kite path
9−
10−Parses a clay [.\^]()
11−[`++path` ]()to request details. Produces the [`++unit`]() of a [`++kite`]().
12−
13−Accepts
14−-------
15−
16−`hap` is a [`++path`]().
17−
18−Produces
19−--------
20−
21−A `(unit kite)`.
22−
23−Source
24−------
25−
26− ++ tame :: parse kite path
27− |= hap=path
28− ^- (unit kite)
29− ?. ?=([@ @ @ @ *] hap) ~
30− =+ :* hyr=(slay i.hap)
31− fal=(slay i.t.hap)
32− dyc=(slay i.t.t.hap)
33− ved=(slay i.t.t.t.hap)
34− :: ved=(slay i.t.hap)
35− :: fal=(slay i.t.t.hap)
36− :: dyc=(slay i.t.t.t.hap))
37− tyl=t.t.t.t.hap
38− ==
39− ?. ?=([~ %$ %tas @] hyr) ~
40− ?. ?=([~ %$ %p @] fal) ~
41− ?. ?=([~ %$ %tas @] dyc) ~
42− ?. ?=([~ %$ case] ved) ~
43− =+ his=`@p`q.p.u.fal
44− =+ [dis=(end 3 1 q.p.u.hyr) rem=(rsh 3 1 q.p.u.hyr)]
45− ?. ?&(?=(%c dis) ?=(?(%v %w %x %y %z) rem)) ~
46− [~ rem p.u.ved q.p.u.fal q.p.u.dyc tyl]
47− ::
48−
49−Examples
50−--------
51−
52− ~zod/try=/zop> (tame /cx/~zod/main/1/sur/down/gate/hook)
53− [~ [p=%x q=[%ud p=1] r=~zod s=%main t=/sur/down/gate/hook]]
54− ~zod/try=/zop> (tame /cx/0/main/1/sur/down/gate/hook)
55− ~
56− ~zod/try=/zop> (tame /~zod/main/0x12/sur/down/gate/hook)
57− ~
58−
59−
reference/library/zuse/gate/tell.udondeleted−44
@@ -1,44 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−### `++tell`
7−
8−octs from wall
9−
10−Converts a [`++wall`]() to an octet stream ([`++octs`](), which contains a length
11−to encode trailing zeroes.
12−
13−Accepts
14−-------
15−
16−`wol` is a [`++wall`]().
17−
18−Produces
19−--------
20−
21−An `++octs`.
22−
23−Source
24−------
25−
26− ++ tell :: wall to octstream
27− |= wol=wall ^- octs
28− =+ buf=(rap 3 (turn wol |=(a=tape (crip (weld a `tape`[`@`10 ~])))))
29− [(met 3 buf) buf]
30− ::
31−
32−Examples
33−--------
34−
35− ~zod/try=> (tell ~["abc" "line" "3"])
36− [p=11 q=12.330.290.663.108.538.769.039.969]
37− ~zod/try=> `@t`12.330.290.663.108.538.769.039.969
38− '''
39− abc
40− line
41− 3
42− '''
43−
44−
reference/library/zuse/gate/tome.udondeleted−51
@@ -1,51 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−
7−### `++tome`
8−
9−Parse path to beam
10−
11−Parses a [`++path`]() `pax` to a [`++beam](), a well-typed location.
12−
13−Accepts
14−-------
15−
16−`pax` is a [`++path`]().
17−
18−Produces
19−--------
20−
21−A `(unit beam)`.
22−
23−Source
24−------
25−
26− ++ tome :: parse path to beam
27− |= pax=path
28− ^- (unit beam)
29− ?. ?=([* * * *] pax) ~
30− %+ biff (slaw %p i.pax)
31− |= who=ship
32− %+ biff (slaw %tas i.t.pax)
33− |= dex=desk
34− %+ biff (slay i.t.t.pax)
35− |= cis=coin
36− ?. ?=([%$ case] cis) ~
37− `(unit beam)`[~ [who dex `case`p.cis] (flop t.t.t.pax)]
38− ::
39−
40−Examples
41−--------
42−
43− ~zod/try=/zop> (tome /~fyr/try/2/for/me)
44− [~ [[p=~fyr q=%try r=[%ud p=2]] s=/me/for]]
45− ~zod/try=/zop> (tome /~zod/main/1)
46− [~ [[p=~zod q=%main r=[%ud p=1]] s=/]]
47− ~zod/try=/zop> (tome /0/main/1)
48− ~
49− ~zod/try=/zop> (tome /~zod/main/0x12)
50− ~
51−
reference/library/zuse/gate/tope.udondeleted−35
@@ -1,35 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−### `++tope`
7−
8−Parse beam to path
9−
10−Parses a [`++beam`]() `bem` to a [`++path`]().
11−
12−Accepts
13−-------
14−
15−`bem` is a `++beam`.
16−
17−Produces
18−--------
19−
20−A `++path`.
21−
22− ++tope
23− |= bem=beam
24− ^- path
25− [(scot %p p.bem) q.bem (scot r.bem) (flop s.bem)]
26−
27−Parses a [`++beam`]() to a [`++path`](/docs/hoon/library/1#++path).
28−
29− ~zod/try=/zop> (tope [~zod %main ud/1] /hook/down/sur)
30− /~zod/main/1/sur/down/hook
31− ~zod/try=/zop> (tope [~fyr %try da/~2015.1.1] /txt/test)
32− /~fyr/try/~2015.1.1/test/txt
33− ~zod/try=/zop> (tope [~doznec %try da/-<-] /txt/test)
34− /~doznec/try/~2014.10.30..00.32.48..3ae4/test/txt
35−
reference/library/zuse/gate/txml.udondeleted−37
@@ -1,37 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−### `++txml`
7−
8−Tape to xml CDATA node
9−
10−Converts a [`++tape`]() to an xml CDATA node XX
11−
12−Accepts
13−-------
14−
15−`tep` is a [`++tape`]().
16−
17−Produces
18−--------
19−
20−A [`++manx`]().
21−
22−Source
23−------
24−
25− ++ txml :: string to xml
26− |= tep=tape ^- manx
27− [[%$ [%$ tep] ~] ~]
28− ::
29−
30−Examples
31−--------
32−
33− ~zod/try=> (txml "hi")
34− [g=[n=%$ a=~[[n=%$ v="hi"]]] c=~]
35− ~zod/try=> (txml "larton bestok")
36− [
37−
reference/library/zuse/gate/unt.udondeleted−40
@@ -1,40 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−### `++unt`
7−
8−UGT to UTC time
9−
10−Transforms Urbit Galactic Time to UTC time, producing an atom.
11−
12−Accepts
13−-------
14−
15−An atom of [odor]() [`@da`](), representing an absolute date.
16−
17−Produces
18−--------
19−
20−An atom.
21−
22−Source
23−------
24−
25− ++ unt :: UGT to UTC time
26− |= a=@da
27− (div (sub a ~1970.1.1) (bex 64))
28− ::
29−
30−Examples
31−--------
32−
33− ~zod/try=/hom> (unt -<-)
34− 1.413.927.704
35− ~zod/try=> (unt ~20014.1.1)
36− 569.413.670.400
37− ~zod/try=> (unt ~2014.1.1)
38− 1.388.534.400
39−
40−
reference/library/zuse/gate/urld.udondeleted−53
@@ -1,53 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−### `++urld`
7−
8−Decode URL
9−
10−The inverse of [`++urle`](). Parses a URL escaped [`++tape`]() to the
11−[`++unit`]() of an unescaped `++tape`.
12−
13−Accepts
14−-------
15−
16−`tep` is a `++tape`.
17−
18−Produces
19−--------
20−
21−The [`++unit`]() of a `++tape`.
22−
23−Source
24−------
25−
26− ++ urld :: URL decode
27− |= tep=tape
28− ^- (unit tape)
29− ?~ tep [~ ~]
30− ?: =('%' i.tep)
31− ?. ?=([@ @ *] t.tep) ~
32− =+ nag=(mix i.t.tep (lsh 3 1 i.t.t.tep))
33− =+ val=(rush nag hex:ag)
34− ?~ val ~
35− =+ nex=$(tep t.t.t.tep)
36− ?~(nex ~ [~ [`@`u.val u.nex]])
37− =+ nex=$(tep t.tep)
38− ?~(nex ~ [~ i.tep u.nex])
39− ::
40−
41−Examples
42−--------
43−
44− ~zod/main=> (urld "hello")
45− [~ "hello"]
46− ~zod/main=> (urld "hello%20dear")
47− [~ "hello dear"]
48− ~zod/main=> (urld "hello-my%3F%3Dme%20%20%21")
49− [~ "hello-my?=me !"]
50− ~zod/main=> (urld "hello-my%3F%3Dme%20%2%21")
51− ~
52−
53−
reference/library/zuse/gate/urle.udondeleted−56
@@ -1,56 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−### `++urle`
7−
8−Encode URL
9−
10−The inverse of [`++urld`](). Accepts a tape `tep` and replaces all
11−characters other than alphanumerics and `.`, `-`, `~`, and `_`, with URL
12−escape sequences.
13−
14−Accepts
15−-------
16−
17−`tep` is a [`++tape`]().
18−
19−Produces
20−--------
21−
22−A `++tape`.
23−
24−Source
25−------
26−
27− ++ urle :: URL encode
28− |= tep=tape
29− ^- tape
30− %- zing
31− %+ turn tep
32− |= tap=char
33− =+ xen=|=(tig=@ ?:((gte tig 10) (add tig 55) (add tig '0')))
34− ?: ?| &((gte tap 'a') (lte tap 'z'))
35− &((gte tap 'A') (lte tap 'Z'))
36− &((gte tap '0') (lte tap '9'))
37− =('.' tap)
38− =('-' tap)
39− =('~' tap)
40− =('_' tap)
41− ==
42− [tap ~]
43− ['%' (xen (rsh 0 4 tap)) (xen (end 0 4 tap)) ~]
44− ::
45−
46−Examples
47−--------
48−
49− ~zod/main=> (urle "hello")
50− "hello"
51− ~zod/main=> (urle "hello dear")
52− "hello%20dear"
53− ~zod/main=> (urle "hello-my?=me !")
54− "hello-my%3F%3Dme%20%20%21"
55−
56−
reference/library/zuse/mold/udal.udondeleted−15
@@ -1,15 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−### `++udal`
7−
8−Source
9−------
10−
11− ++ udal :: atomic change (%b)
12−
13−Examples
14−--------
15−
reference/library/zuse/mold/udon.udondeleted−20
@@ -1,20 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−### `++udon`
7−
8− ++ udon :: abstract delta
9− $: p=umph :: preprocessor
10− $= q :: patch
11− $% [%a p=* q=*] :: trivial replace
12− [%b p=udal] :: atomic indel
13− [%c p=(urge)] :: list indel
14− [%d p=upas q=upas] :: tree edit
15− == ::
16− == ::
17−
18−See `%clay` doc
19−
20−
reference/library/zuse/mold/umph.udondeleted−18
@@ -1,18 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−### `++umph`
7−
8− ++ umph :: change filter
9− $| $? %a :: no filter
10− %b :: jamfile
11− %c :: LF text
12− == ::
13− $% [%d p=@ud] :: blocklist
14− == ::
15−
16−See `%clay` doc
17−
18−
reference/library/zuse/mold/unce.udondeleted−13
@@ -1,13 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−### `++unce`
7−
8− ++ unce |* a=_,* :: change part
9− $% [%& p=@ud] :: skip[copy]
10− [%| p=(list a) q=(list a)] :: p -> q[chunk]
11− == ::
12−
13−See `%clay` doc
reference/library/zuse/mold/upas.udondeleted−17
@@ -1,17 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−### `++upas`
7−
8− ++ upas :: tree change (%d)
9− $& [p=upas q=upas] :: cell
10− $% [%0 p=axis] :: copy old
11− [%1 p=*] :: insert new
12− [%2 p=axis q=udon] :: mutate!
13− == ::
14−
15−See `%clay` doc
16−
17−
reference/library/zuse/mold/urge.udondeleted−12
@@ -1,12 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−### `++urge`
7−
8− ++ urge |*(a=_,* (list (unce a))) :: list change
9−
10−See `%clay` doc
11−
12−
reference/library/zuse/rsa.udondeleted−404
@@ -1,404 +0,0 @@
1−---
2−navhome: /docs/
3−---
4−
5−
6−------------------------------------------------------------------------
7−
8−### `++pram`
9−
10−Probable prime
11−
12− ++ pram :: rabin-miller
13− |= a=@ ^- ?
14− ?: ?| =(0 (end 0 1 a))
15− =(1 a)
16− =+ b=1
17− |- ^- ?
18− ?: =(512 b)
19− |
20− ?|(=+(c=+((mul 2 b)) &(!=(a c) =(a (mul c (div a c))))) $(b +(b)))
21− ==
22− |
23− =+ ^= b
24− =+ [s=(dec a) t=0]
25− |- ^- [s=@ t=@]
26− ?: =(0 (end 0 1 s))
27− $(s (rsh 0 1 s), t +(t))
28− [s t]
29− ?> =((mul s.b (bex t.b)) (dec a))
30− =+ c=0
31− |- ^- ?
32− ?: =(c 64)
33− &
34− =+ d=(~(raw og (add c a)) (met 0 a))
35− =+ e=(~(exp fo a) s.b d)
36− ?& ?| =(1 e)
37− =+ f=0
38− |- ^- ?
39− ?: =(e (dec a))
40− &
41− ?: =(f (dec t.b))
42− |
43− $(e (~(pro fo a) e e), f +(f))
44− ==
45− $(c +(c))
46− ==
47− ::
48−
49−Probable prime test
50−
51− ~zod/try=> (pram 31)
52− %.y
53− ~zod/try=> =+(a=2 |-(?:(=(a 31) ~ [i=(mod 31 a) t=$(a +(a))])))
54− ~[1 1 3 1 1 3 7 4 1 9 7 5 3 1 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1]
55− ~zod/try=> =+(a=2 |-(?:(=(a 31) ~ [i=(mod 30 a) t=$(a +(a))])))
56− ~[0 0 2 0 0 2 6 3 0 8 6 4 2 0 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0]
57− ~zod/try=> (pram 256)
58− %.n
59− ~zod/try=> (pram (dec (bex 127)))
60− %.y
61−
62−------------------------------------------------------------------------
63−
64−### `++ramp`
65−
66−`r-m` prime
67−
68− ++ ramp :: make r-m prime
69− |= [a=@ b=(list ,@) c=@] ^- @ux :: [bits snags seed]
70− => .(c (shas %ramp c))
71− =+ d=_@
72− |-
73− ?: =((mul 100 a) d)
74− ~|(%ar-ramp !!)
75− =+ e=(~(raw og c) a)
76− ?: &((levy b |=(f=@ !=(1 (mod e f)))) (pram e))
77− e
78− $(c +(c), d (shax d))
79− ::
80−
81−Random `a` bit prime, which isn't 1 modulo a list of other numbers,
82−using salt `c`.
83−
84− ~zod/try=> (ramp 20 ~ %hamelok)
85− 0xf.1f0d
86− ~zod/try=> (ramp 20 ~ %hameloe)
87− 0x2.d341
88− ~zod/try=> (ramp 5 ~ %kole)
89− 0x1f
90− ~zod/try=> (ramp 7 ~ %kole)
91− 0x4f
92− ~zod/try=> (ramp 7 ~[0x4e] %kole)
93− 0x43
94− ~zod/try=> `@uw`(ramp 128 ~ %late)
95− 0w3y.irKIL.l-pp1.2CkG4.3lsTF
96−
97−------------------------------------------------------------------------
98−
99−### `++fo`
100−
101−Prime engine
102−
103− ++ fo :: modulo prime
104− |_ a=@
105−
106−XX DO NOT RERUN GET.LS, THERE EXIST ARM COLLISIONS
107−
108−Core for performing arithmetic modulo a prime number
109−
110− ~zod/try=> ~(. fo 79)
111− <7.get [@ud <373.jdd 100.kzl 1.ypj %164>]>
112−
113−------------------------------------------------------------------------
114−
115−### `++dif`
116−
117−Difference
118−
119− ++ dif
120− |= [b=@ c=@]
121− (sit (sub (add a b) (sit c)))
122− ::
123−
124−Subtract
125−
126− ~zod/try=> (~(dif fo 79) 10 5)
127− 5
128− ~zod/try=> (~(dif fo 79) 5 10)
129− 74
130−
131−------------------------------------------------------------------------
132−
133−### `++exp`
134−
135−Exponent
136−
137− ++ exp
138− |= [b=@ c=@]
139− ?: =(0 b)
140− 1
141− =+ d=$(b (rsh 0 1 b))
142− =+ e=(pro d d)
143− ?:(=(0 (end 0 1 b)) e (pro c e))
144− ::
145−
146−Exponent
147−
148− ~zod/try=> (~(exp fo 79) 3 5)
149− 46
150−
151−------------------------------------------------------------------------
152−
153−### `++fra`
154−
155−Divide
156−
157− ++ fra
158− |= [b=@ c=@]
159− (pro b (inv c))
160− ::
161−
162−Divide
163−
164− ~zod/try=> (~(fra fo 79) 20 4)
165− 5
166− ~zod/try=> (~(fra fo 79) 7 11)
167− 15
168−
169−------------------------------------------------------------------------
170−
171−### `++inv`
172−
173−Inverse
174−
175− ++ inv
176− |= b=@
177− =+ c=(dul:si u:(egcd b a) a)
178− c
179− ::
180−
181−Multiplicative inverse
182−
183− ~zod/try=> (~(inv fo 79) 12)
184− 33
185− ~zod/try=> (~(pro fo 79) 12 33)
186− 1
187− ~zod/try=> (~(inv fo 79) 0)
188− 0
189−
190−------------------------------------------------------------------------
191−
192−### `++pro`
193−
194−Product
195−
196− ++ pro
197− |= [b=@ c=@]
198− (sit (mul b c))
199− ::
200−
201−Product
202−
203− ~zod/try=> (~(pro fo 79) 5 10)
204− 50
205− ~zod/try=> (~(pro fo 79) 5 20)
206− 21
207−
208−------------------------------------------------------------------------
209−
210−### `++sit`
211−
212−Bounds
213−
214− ++ sit
215− |= b=@
216− (mod b a)
217− ::
218−
219−Bounds check
220−
221− ~zod/try=> (~(sit fo 79) 9)
222− 9
223− ~zod/try=> (~(sit fo 79) 99)
224− 20
225−
226−------------------------------------------------------------------------
227−
228−### `++sum`
229−
230−Sum
231−
232− ++ sum
233− |= [b=@ c=@]
234− (sit (add b c))
235− --
236−
237−Add
238−
239− ~zod/try=> (~(sum fo 79) 9 9)
240− 18
241− ~zod/try=> (~(sum fo 79) 70 9)
242− 0
243−
244−------------------------------------------------------------------------
245−
246−### `++ga`
247−
248− ++ ga :: GF (bex p.a)
249− |= a=[p=@ q=@ r=@] :: dim poly gen
250− =+ si=(bex p.a)
251− =+ ma=(dec si)
252− => |%
253−
254−RSA internals
255−
256−XX document
257−
258−------------------------------------------------------------------------
259−
260−### `++dif`
261−
262− ++ dif :: add and sub
263− |= [b=@ c=@]
264− ~| [%dif-ga a]
265− ?> &((lth b si) (lth c si))
266− (mix b c)
267− ::
268−
269−XX document
270−
271−------------------------------------------------------------------------
272−
273−### `++dub`
274−
275− ++ dub :: mul by x
276− |= b=@
277− ~| [%dub-ga a]
278− ?> (lth b si)
279− ?: =(1 (cut 0 [(dec p.a) 1] b))
280− (dif (sit q.a) (sit (lsh 0 1 b)))
281− (lsh 0 1 b)
282− ::
283−
284−XX document
285−
286−------------------------------------------------------------------------
287−
288−### `++pro`
289−
290− ++ pro :: slow multiply
291− |= [b=@ c=@]
292− ?: =(0 b)
293− 0
294− ?: =(1 (dis 1 b))
295− (dif c $(b (rsh 0 1 b), c (dub c)))
296− $(b (rsh 0 1 b), c (dub c))
297− ::
298−
299−XX document
300−
301−------------------------------------------------------------------------
302−
303−### `++toe`
304−
305− ++ toe :: exp/log tables
306− =+ ^= nu
307− |= [b=@ c=@]
308− ^- (map ,@ ,@)
309− =+ d=*(map ,@ ,@)
310− |-
311− ?: =(0 c)
312− d
313− %= $
314− c (dec c)
315− d (~(put by d) c b)
316− ==
317− =+ [p=(nu 0 (bex p.a)) q=(nu ma ma)]
318− =+ [b=1 c=0]
319− |- ^- [p=(map ,@ ,@) q=(map ,@ ,@)]
320− ?: =(ma c)
321− [(~(put by p) c b) q]
322− %= $
323− b (pro r.a b)
324− c +(c)
325− p (~(put by p) c b)
326− q (~(put by q) b c)
327− ==
328− ::
329−
330−XX document
331−
332−------------------------------------------------------------------------
333−
334−### `++sit`
335−
336− ++ sit :: reduce
337− |= b=@
338− (mod b (bex p.a))
339− --
340−
341−XX document
342−
343−------------------------------------------------------------------------
344−
345−### `++fra`
346−
347− ++ fra :: divide
348− |= [b=@ c=@]
349− (pro b (inv c))
350− ::
351−
352−XX document
353−
354−------------------------------------------------------------------------
355−
356−### `++inv`
357−
358− ++ inv :: invert
359− |= b=@
360− ~| [%inv-ga a]
361− =+ c=(~(get by q) b)
362− ?~ c !!
363− =+ d=(~(get by p) (sub ma u.c))
364− (need d)
365− ::
366−
367−XX document
368−
369−------------------------------------------------------------------------
370−
371−### `++pow`
372−
373− ++ pow :: exponent
374− |= [b=@ c=@]
375− =+ [d=1 e=c f=0]
376− |-
377− ?: =(p.a f)
378− d
379− ?: =(1 (cut 0 [f 1] b))
380− $(d (pro d e), e (pro e e), f +(f))
381− $(e (pro e e), f +(f))
382− ::
383−
384−XX document
385−
386−------------------------------------------------------------------------
387−
388−### `++pro`
389−
390− ++ pro :: multiply
391− |= [b=@ c=@]
392− ~| [%pro-ga a]
393− =+ d=(~(get by q) b)
394− ?~ d 0
395− =+ e=(~(get by q) c)
396− ?~ e 0
397− =+ f=(~(get by p) (mod (add u.d u.e) ma))
398− (need f)
399− --
400−
401−XX document
402−
403−------------------------------------------------------------------------
404−