on master help sign in
Merge branch 'master' of github.com:asgardiator/docs into cleanorg
commit4290670844a71520c6086970a2dab397ee4ab225 authorTobias Merkle <tgamerkle@gmail.com> dateTue 7 Jun 2016, 16:57 (10 years ago) parent308eed0ef8aa43
289 files changed+1895−62
docs.md+2 docs/about.md+1 docs/about/overview.md+1 docs/about/runtime.md+4−3 docs/arvo.md+1 docs/arvo/api.md+1 docs/arvo/basic.md+1 docs/arvo/generators.md+1 docs/arvo/http.md+1 docs/arvo/internals.md+1 docs/arvo/internals/ames.md+1 docs/arvo/internals/ames/commentary.md+5 docs/arvo/internals/behn.md+1 docs/arvo/internals/clay.md+1 docs/arvo/internals/clay/architecture.md+5 docs/arvo/internals/clay/commentary.md+5 docs/arvo/internals/dill.md+1 docs/arvo/internals/eyre.md+1 docs/arvo/internals/eyre/commentary.md+5 docs/arvo/internals/ford.md+1 docs/arvo/internals/ford/commentary.md+5 docs/arvo/internals/gall.md+1 docs/arvo/marks.md+1 docs/arvo/network.md+1 docs/arvo/security-driver.md+1 docs/arvo/state.md+1 docs/arvo/subject.md+1 docs/arvo/subscriptions.md+1 docs/arvo/web-apps.md+1 docs/hoon.md+1 docs/hoon/advanced.md+1 docs/hoon/basic.md+1 docs/hoon/concepts.md+5−4 docs/hoon/demo.md+2−1 docs/hoon/examples.md+1 docs/hoon/exercises.md+1 docs/hoon/exercises/data-structures.md+1 docs/hoon/exercises/fizzbuzz.md+2−1 docs/hoon/exercises/life.md+1 docs/hoon/exercises/lists.md+1 docs/hoon/exercises/math.md+1 docs/hoon/library.md+1 docs/hoon/library/1a.md+5 docs/hoon/library/1b.md+5 docs/hoon/library/1c.md+5 docs/hoon/library/2a.md+5 docs/hoon/library/2b.md+5 docs/hoon/library/2c.md+5 docs/hoon/library/2d.md+5 docs/hoon/library/2e.md+5 docs/hoon/library/2f.md+5 docs/hoon/library/2g.md+5 docs/hoon/library/2h.md+5 docs/hoon/library/2i.md+5 docs/hoon/library/2j.md+5 docs/hoon/library/2k.md+5 docs/hoon/library/2l.md+5 docs/hoon/library/2m.md+5 docs/hoon/library/2n.md+5 docs/hoon/library/2o.md+5 docs/hoon/library/2p.md+5 docs/hoon/library/2q.md+5 docs/hoon/library/3a.md+5 docs/hoon/library/3b.md+5 docs/hoon/library/3c.md+5 docs/hoon/library/3d.md+5 docs/hoon/library/3e.md+5 docs/hoon/library/3f.md+5 docs/hoon/library/3g.md+5 docs/hoon/library/4a.md+5 docs/hoon/library/4b.md+5 docs/hoon/library/4c.md+5 docs/hoon/library/4d.md+5 docs/hoon/library/4e.md+5 docs/hoon/library/4f.md+5 docs/hoon/library/4g.md+5 docs/hoon/library/4h.md+5 docs/hoon/library/4i.md+5 docs/hoon/library/4j.md+5 docs/hoon/library/4k.md+5 docs/hoon/library/4l.md+5 docs/hoon/library/4m.md+5 docs/hoon/library/4n.md+5 docs/hoon/library/4o.md+5 docs/hoon/library/5a.md+5 docs/hoon/library/5b.md+5 docs/hoon/library/5c.md+5 docs/hoon/library/5d.md+5 docs/hoon/library/5e.md+5 docs/hoon/library/5f.md+5 docs/hoon/library/5g.md+5 docs/hoon/library/zuse.md+1 docs/hoon/library/zuse/core/crua.md+5 docs/hoon/library/zuse/core/epur.md+5 docs/hoon/library/zuse/core/fu.md+5 docs/hoon/library/zuse/core/jo.md+5 docs/hoon/library/zuse/core/poja.md+5 docs/hoon/library/zuse/core/poxa.md+5 docs/hoon/library/zuse/core/poxo.md+5 docs/hoon/library/zuse/core/yu.md+5 docs/hoon/library/zuse/diff.md+5 docs/hoon/library/zuse/gate/clan.md+5 docs/hoon/library/zuse/gate/dawn.md+5 docs/hoon/library/zuse/gate/daws.md+5 docs/hoon/library/zuse/gate/deal.md+5 docs/hoon/library/zuse/gate/deft.md+5 docs/hoon/library/zuse/gate/dust.md+5 docs/hoon/library/zuse/gate/earl.md+5 docs/hoon/library/zuse/gate/earn.md+5 docs/hoon/library/zuse/gate/fain.md+5 docs/hoon/library/zuse/gate/feel.md+5 docs/hoon/library/zuse/gate/file.md+5 docs/hoon/library/zuse/gate/foal.md+5 docs/hoon/library/zuse/gate/fray.md+5 docs/hoon/library/zuse/gate/fuel.md+5 docs/hoon/library/zuse/gate/furl.md+5 docs/hoon/library/zuse/gate/glam.md+5 docs/hoon/library/zuse/gate/glon.md+5 docs/hoon/library/zuse/gate/gnom.md+5 docs/hoon/library/zuse/gate/jape.md+5 docs/hoon/library/zuse/gate/jesc.md+5 docs/hoon/library/zuse/gate/joba.md+5 docs/hoon/library/zuse/gate/jobe.md+5 docs/hoon/library/zuse/gate/jone.md+5 docs/hoon/library/zuse/gate/lead.md+5 docs/hoon/library/zuse/gate/mang.md+5 docs/hoon/library/zuse/gate/meat.md+5 docs/hoon/library/zuse/gate/moon.md+5 docs/hoon/library/zuse/gate/mung.md+5 docs/hoon/library/zuse/gate/perk.md+5 docs/hoon/library/zuse/gate/pojo.md+5 docs/hoon/library/zuse/gate/saxo.md+5 docs/hoon/library/zuse/gate/scanf.md+5 docs/hoon/library/zuse/gate/sein.md+5 docs/hoon/library/zuse/gate/sifo.md+5 docs/hoon/library/zuse/gate/stud.md+5 docs/hoon/library/zuse/gate/taco.md+5 docs/hoon/library/zuse/gate/tact.md+5 docs/hoon/library/zuse/gate/tame.md+5 docs/hoon/library/zuse/gate/tell.md+5 docs/hoon/library/zuse/gate/tome.md+5 docs/hoon/library/zuse/gate/tope.md+5 docs/hoon/library/zuse/gate/txml.md+5 docs/hoon/library/zuse/gate/unt.md+5 docs/hoon/library/zuse/gate/urld.md+5 docs/hoon/library/zuse/gate/urle.md+5 docs/hoon/library/zuse/mold/udal.md+5 docs/hoon/library/zuse/mold/udon.md+5 docs/hoon/library/zuse/mold/umph.md+5 docs/hoon/library/zuse/mold/unce.md+5 docs/hoon/library/zuse/mold/upas.md+5 docs/hoon/library/zuse/mold/urge.md+5 docs/hoon/library/zuse/rsa.md+5 docs/hoon/mission.md+1 docs/hoon/reference.md+1 docs/hoon/syntax.md+7−6 docs/hoon/troubleshooting.md+1 docs/hoon/twig.md+1 docs/hoon/twig/atom.md+1 docs/hoon/twig/atom/knit.md+1 docs/hoon/twig/atom/path.md+1 docs/hoon/twig/atom/rock.md+1 docs/hoon/twig/atom/sand.md+1 docs/hoon/twig/bar-core.md+5−4 docs/hoon/twig/bar-core/cab-door.md+1 docs/hoon/twig/bar-core/cen-core.md+1−1 docs/hoon/twig/bar-core/dot-trap.md+1 docs/hoon/twig/bar-core/hep-loop.md+1 docs/hoon/twig/bar-core/tar-gill.md+1 docs/hoon/twig/bar-core/tis-gate.md+1 docs/hoon/twig/buc-mold.md+2−1 docs/hoon/twig/buc-mold/base.md+1 docs/hoon/twig/buc-mold/cab-shoe.md+1 docs/hoon/twig/buc-mold/cen-book.md+2−1 docs/hoon/twig/buc-mold/col-bank.md+1 docs/hoon/twig/buc-mold/hep-lamb.md+1 docs/hoon/twig/buc-mold/ket-bush.md+1 docs/hoon/twig/buc-mold/pat-claw.md+1 docs/hoon/twig/buc-mold/tis-coat.md+1 docs/hoon/twig/buc-mold/wut-pick.md+1 docs/hoon/twig/cen-call.md+1 docs/hoon/twig/cen-call/cab-keep.md+1 docs/hoon/twig/cen-call/dot-lace.md+1 docs/hoon/twig/cen-call/hep-call.md+1 docs/hoon/twig/cen-call/ket-calq.md+1 docs/hoon/twig/cen-call/lus-calt.md+1 docs/hoon/twig/cen-call/sig-open.md+2−1 docs/hoon/twig/cen-call/tis-make.md+3−2 docs/hoon/twig/col-cell.md+1 docs/hoon/twig/col-cell/cab-scon.md+1 docs/hoon/twig/col-cell/hep-cons.md+8−1 docs/hoon/twig/col-cell/ket-conq.md+1 docs/hoon/twig/col-cell/lus-cont.md+1 docs/hoon/twig/col-cell/sig-conl.md+1 docs/hoon/twig/col-cell/tar-conp.md+1 docs/hoon/twig/dot-nock.md+1 docs/hoon/twig/dot-nock/ket-wish.md+1 docs/hoon/twig/dot-nock/lus-bump.md+1 docs/hoon/twig/dot-nock/tar-nock.md+1 docs/hoon/twig/dot-nock/tis-same.md+1 docs/hoon/twig/dot-nock/wut-deep.md+1 docs/hoon/twig/ket-cast.md+1 docs/hoon/twig/ket-cast/bar-iron.md+1 docs/hoon/twig/ket-cast/hep-cast.md+5−2 docs/hoon/twig/ket-cast/lus-like.md+4−3 docs/hoon/twig/ket-cast/sig-burn.md+2−1 docs/hoon/twig/ket-cast/tis-name.md+1 docs/hoon/twig/ket-cast/wut-lead.md+1 docs/hoon/twig/limb.md+1 docs/hoon/twig/limb/limb.md+1 docs/hoon/twig/limb/wing.md+1 docs/hoon/twig/sem-make.md+1 docs/hoon/twig/sem-make/col-wad.md+1 docs/hoon/twig/sem-make/fas-nub.md+1 docs/hoon/twig/sem-make/sem-fry.md+1 docs/hoon/twig/sem-make/sig-dip.md+1 docs/hoon/twig/sig-hint.md+1 docs/hoon/twig/sig-hint/bar-show.md+1 docs/hoon/twig/sig-hint/buc-poll.md+1 docs/hoon/twig/sig-hint/cab-lurk.md+1 docs/hoon/twig/sig-hint/cen-fast.md+2−1 docs/hoon/twig/sig-hint/fas-funk.md+2−1 docs/hoon/twig/sig-hint/gal-thin.md+1 docs/hoon/twig/sig-hint/gar-hint.md+1 docs/hoon/twig/sig-hint/lus-memo.md+1 docs/hoon/twig/sig-hint/pam-dump.md+1 docs/hoon/twig/sig-hint/tis-ddup.md+1 docs/hoon/twig/sig-hint/wut-warn.md+1 docs/hoon/twig/sig-hint/zap-peep.md+1 docs/hoon/twig/tis-flow.md+1 docs/hoon/twig/tis-flow/bar-new.md+1 docs/hoon/twig/tis-flow/col-fix.md+1 docs/hoon/twig/tis-flow/dot-set.md+1 docs/hoon/twig/tis-flow/fas-var.md+2−1 docs/hoon/twig/tis-flow/gal-rap.md+1 docs/hoon/twig/tis-flow/gar-per.md+1 docs/hoon/twig/tis-flow/hep-nip.md+1 docs/hoon/twig/tis-flow/ket-sip.md+1 docs/hoon/twig/tis-flow/lus-pin.md+1 docs/hoon/twig/tis-flow/sem-rev.md+2−1 docs/hoon/twig/tis-flow/tar-aka.md+1 docs/hoon/twig/wut-test.md+1 docs/hoon/twig/wut-test/bar-or.md+1 docs/hoon/twig/wut-test/col-if.md+2−1 docs/hoon/twig/wut-test/dot-lest.md+1 docs/hoon/twig/wut-test/gal-deny.md+1 docs/hoon/twig/wut-test/gar-sure.md+1 docs/hoon/twig/wut-test/hep-case.md+1 docs/hoon/twig/wut-test/ket-ifcl.md+1 docs/hoon/twig/wut-test/lus-deft.md+1 docs/hoon/twig/wut-test/pam-and.md+1 docs/hoon/twig/wut-test/pat-ifat.md+1 docs/hoon/twig/wut-test/sig-ifno.md+1 docs/hoon/twig/wut-test/tis-fits.md+1 docs/hoon/twig/wut-test/zap-not.md+1 docs/hoon/twig/zap-wild.md+1 docs/hoon/twig/zap-wild/gar-wrap.md+1 docs/hoon/twig/zap-wild/tis-code.md+1 docs/hoon/twig/zap-wild/wut-need.md+1 docs/hoon/twig/zap-wild/zap-fail.md+1 docs/nock.md+1 docs/nock/definition.md+2−1 docs/nock/example.md+1 docs/nock/explanation.md+1 docs/nock/implementations.md+1 docs/nock/implementations/c.md+1 docs/nock/implementations/clojure.md+1 docs/nock/implementations/groovy.md+206 docs/nock/implementations/haskell.md+1 docs/nock/implementations/hoon.md+2−1 docs/nock/implementations/javascript.md+365 docs/nock/implementations/python.md+1 docs/nock/implementations/ruby.md+1 docs/nock/implementations/scala.md+1 docs/nock/implementations/scheme.md+128 docs/nock/implementations/swift.md+366 docs/using.md+1 docs/using/admin.md+1 docs/using/filesystem.md+1 docs/using/install.md+2−2 docs/using/layout.md+1 docs/using/messaging.md+1 docs/using/setup.md+26−15 docs/using/shell.md+1 docs/using/web.md+3−2 docs/using/web/blog.md+1 docs/using/web/comments.md+1 docs/using/web/static.md+1 readme.md+11−4
docs.md+2
@@ -1,6 +1,8 @@
11---
22anchor: none
33footer: true
4+title: Develop
5+sort: 4
46---
57
68<div class="lead">
docs/about.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 1
34---
45
docs/about/overview.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23next: true
34sort: 1
45title: Technical overview
docs/about/runtime.md+4−3
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 2
34title: C runtime system
45---
@@ -952,9 +953,9 @@ We might even have changed the semantics of the battery without
952953changing the label - so long as those semantics don't invalidate
953954any attached driver.
954955
955−et tree. For instance, it's normal to have
956−two equivalent Nock batteries at the same time in one pier: one
957−battery compiled with debugging hints, one not.
956+For instance, it's normal to have two equivalent Nock batteries
957+at the same time in one pier: one battery compiled with
958+debugging hints, one not.
958959
959960Rather, the jet tree is a semantic hierarchy. The root of the
960961hierarchy is a constant, by convention the Hoon kernel version
docs/arvo.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 4
34---
45
docs/arvo/api.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23next: true
34sort: 12
45title: API Connectors
docs/arvo/basic.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 1
34next: true
45title: Hoon refresher / crash course
docs/arvo/generators.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23next: true
34sort: 8
45title: Using Generators with Apps
docs/arvo/http.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23next: false
34sort: 9
45title: HTTP Requests and Timers
docs/arvo/internals.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 15
34---
45
docs/arvo/internals/ames.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 1
34---
45
docs/arvo/internals/ames/commentary.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16`%ames` commentary
27==================
38
docs/arvo/internals/behn.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 2
34---
45
docs/arvo/internals/clay.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 3
34---
45
docs/arvo/internals/clay/architecture.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16# clay
27
38## high-level
docs/arvo/internals/clay/commentary.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16`%clay` commentary
27==================
38
docs/arvo/internals/dill.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 4
34---
45
docs/arvo/internals/eyre.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 5
34---
45
docs/arvo/internals/eyre/commentary.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16Eyre: Reference
27===============
38
docs/arvo/internals/ford.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 6
34---
45
docs/arvo/internals/ford/commentary.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16Reference
27=========
38
docs/arvo/internals/gall.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 7
34---
45
docs/arvo/marks.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23next: true
34sort: 6
45title: Marks
docs/arvo/network.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23next: false
34sort: 3
45title: Network messages
docs/arvo/security-driver.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23next: false
34sort: 10
45title: Security Drivers
docs/arvo/state.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23next: true
34sort: 4
45title: State
docs/arvo/subject.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 2
34next: true
45title: The subject
docs/arvo/subscriptions.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23next: true
34sort: 5
45title: Subscriptions
docs/arvo/web-apps.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23next: true
34sort: 7
45title: Web Apps
docs/hoon.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 3
34---
45
docs/hoon/advanced.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 7
34next: true
45title: Advanced types
docs/hoon/basic.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 5
34next: true
45title: Basic types
docs/hoon/concepts.md+5−4
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 3
34next: true
45title: Concepts
@@ -77,7 +78,7 @@ Turing-complete, non-lambda combinator function. The function
7778takes a cell `{subject formula}`, and produces a noun `product`.
7879
7980To program in Hoon, this is all you need to know about Nock. But
80−it's still bfun and useful to [learn more](../../nock).
81+it's still fun and useful to [learn more](../../nock).
8182
8283## Compilation concepts
8384
@@ -120,7 +121,7 @@ contain flat twigs, but not vice versa.
120121
121122Regular forms always start with a *sigil*, which is either a
122123*keyword* or a *rune* at the programmer's choice. A keyword is
123−the stem cord,
124+the stem cord.
124125
125126For most stems, tall regular form has no delimiter or terminator,
126127eliminating the `)))))` problem common in functional languages.
@@ -142,7 +143,7 @@ b
142143```
143144or the tall rune syntax (here on one line, with double spaces):
144145```
145−:- a b
146+%- a b
146147```
147148
148149### `span` (type, as range)
@@ -155,7 +156,7 @@ no syntax for spans; they are always defined by inference (ie, by
155156### `gate` (function)
156157
157158A `gate` is a Hoon function (lambda or closure). Other
158−constructs Urbit are functions in the mathematical sense -- for
159+constructs in Urbit are functions in the mathematical sense -- for
159160instance, a Nock formula is also a function. But a gate is not a
160161formula. The gate's argument is its *sample*; the result is its
161162*product*.
docs/hoon/demo.md+2−1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 1
34next: true
45title: Demo
@@ -57,6 +58,6 @@ The tail of the pair is line 15, which repeats the loop (like
5758Clojure `recur`), with `count` incremented. This list of strings
5859is the rest of the output list.
5960
60−You can test this code by mounting your home desk with `|mount %home`;
61+You can test this code by mounting your home desk with `|mount %`;
6162copying it into `home/gen/fizzbuzz.hoon` in your Urbit pier; then
6263typing `+fizzbuzz 100` in the Urbit dojo (shell).
docs/hoon/examples.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 8
34title: Examples
45next: true
docs/hoon/exercises.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 11
34---
45
docs/hoon/exercises/data-structures.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 4
34comments: true
45---
docs/hoon/exercises/fizzbuzz.md+2−1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 1
34comments: true
45---
@@ -22,7 +23,7 @@ comments: true
2223 "Fizz"
2324 ?: =(0 (mod count 3))
2425 "Buzz"
25− (text !>(count))
26+ (pave !>(count))
2627 $(count (add 1 count))
2728 ```
2829
docs/hoon/exercises/life.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 5
34comments: true
45---
docs/hoon/exercises/lists.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 3
34comments: true
45---
docs/hoon/exercises/math.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 2
34comments: true
45---
docs/hoon/library.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 10
34title: Standard library
45---
docs/hoon/library/1a.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16# 1a: basic arithmetic
27### `++add`
38
docs/hoon/library/1b.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16# 1b: tree addressing
27### `++cap`
38
docs/hoon/library/1c.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16# 1c: molds and mold builders
27
38### `++bloq`
docs/hoon/library/2a.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16# 2a: unit logic
27### `++biff`
38
docs/hoon/library/2b.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16# 2b: list logic
27Reverse
38
docs/hoon/library/2c.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16# 2c: bit arithmetic
27### `++bex`
38
docs/hoon/library/2d.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16# 2d: bit logic
27### `++con`
38
docs/hoon/library/2e.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16# 2e: insecure hashing
27### `++fnv`
38
docs/hoon/library/2f.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16# 2f: noun ordering
27### `++aor`
38
docs/hoon/library/2g.md+5
@@ -1 +1,6 @@
1+---
2+navhome: /docs
3+---
4+
5+
16# 2g: unsigned powers (currently undocumented)
docs/hoon/library/2h.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16# 2h: set logic
27
38### `++in`
docs/hoon/library/2i.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16# 2i: map logic
27### `++by`
38
docs/hoon/library/2j.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16# 2j: jar and jug logic
27### `++ja`
38
docs/hoon/library/2k.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16# 2k: queue logic
27### `++to`
38
docs/hoon/library/2l.md+5
@@ -1 +1,6 @@
1+---
2+navhome: /docs
3+---
4+
5+
16# 2l: container from container
docs/hoon/library/2m.md+5
@@ -1 +1,6 @@
1+---
2+navhome: /docs
3+---
4+
5+
16# 2m: container from noun
docs/hoon/library/2n.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16# 2n: functional hacks
27### `++cork`
38
docs/hoon/library/2o.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16# 2o: normalizing containers
27### `++jar`
38
docs/hoon/library/2p.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16# 2p: serialization
27### `++cue`
38
docs/hoon/library/2q.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16# 2q: molds and mold builders
27### `++char`
38
docs/hoon/library/3a.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16# 3a: signed and modular ints
27### `++fe` :: modulo bloq
38
docs/hoon/library/3b.md+5
@@ -1 +1,6 @@
1+---
2+navhome: /docs
3+---
4+
5+
16# 3b: floating point
docs/hoon/library/3c.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16# 3c: urbit time
27### `++yo`
38
docs/hoon/library/3d.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16# 3d: SHA hash family
27
38### `++og`
docs/hoon/library/3e.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16# 3e: AES encryption
27### `++aesc`
38
docs/hoon/library/3f.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16# 3f: scrambling
27### `++ob`
38
docs/hoon/library/3g.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16# 3g: molds and mold builders
27### `++coin`
38
docs/hoon/library/4a.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16# 4a: exotic bases
27### `++po`
38
docs/hoon/library/4b.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16# 4b: text processing
27### `++at`
38
docs/hoon/library/4c.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16# 4c: tank printer
27### `++re`
38
docs/hoon/library/4d.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16# 4d: parsing (tracing)
27### `++last`
38
docs/hoon/library/4e.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16# 4e: parsing (combinators)
27### `++bend`
38
docs/hoon/library/4f.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16# 4f: parsing (rule builders)
27### `++bass`
38
docs/hoon/library/4g.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16# 4g: parsing (outside caller)
27### `++rash`
38
docs/hoon/library/4h.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16# 4h: parsing (ascii glyphs)
27### `++ace`
38
docs/hoon/library/4i.md+5
@@ -1 +1,6 @@
1+---
2+navhome: /docs
3+---
4+
5+
16# 4i: parsing (useful idioms)
docs/hoon/library/4j.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16# 4j: parsing (bases and base digits)
27### `++ab`
38
docs/hoon/library/4k.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16# 4k: atom printing
27### `++co`
38
docs/hoon/library/4l.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16# 4l: atom parsing
27### `++so`
38
docs/hoon/library/4m.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16# 4m: formatting functions
27### `++scot`
38
docs/hoon/library/4n.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16# 4n: virtualization
27### `++mack`
38
docs/hoon/library/4o.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16# 4o: molds and mold builders
27### `++abel`
38
docs/hoon/library/5a.md+5
@@ -1 +1,6 @@
1+---
2+navhome: /docs
3+---
4+
5+
16# 5a: compiler utilities
docs/hoon/library/5b.md+5
@@ -1 +1,6 @@
1+---
2+navhome: /docs
3+---
4+
5+
16# 5b: macro expansion
docs/hoon/library/5c.md+5
@@ -1 +1,6 @@
1+---
2+navhome: /docs
3+---
4+
5+
16# 5c: compiler backend and prettyprinter
docs/hoon/library/5d.md+5
@@ -1 +1,6 @@
1+---
2+navhome: /docs
3+---
4+
5+
16# 5d: parser
docs/hoon/library/5e.md+5
@@ -1 +1,6 @@
1+---
2+navhome: /docs
3+---
4+
5+
16# 5e: caching compiler
docs/hoon/library/5f.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16# 5f: molds and mold builders
27### `++mane`
38
docs/hoon/library/5g.md+5
@@ -0,0 +1,5 @@
1+---
2+navhome: /docs
3+---
4+
5+
docs/hoon/library/zuse.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 3
34---
45
docs/hoon/library/zuse/core/crua.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16### `++crua`
27
38 ++ crua !: :: cryptosuite A (RSA)
docs/hoon/library/zuse/core/epur.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16### `++epur`
27
38Top-level URL parser
docs/hoon/library/zuse/core/fu.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
163bA lite number theory
27======================
38
docs/hoon/library/zuse/core/jo.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16
27### `++jo`
38
docs/hoon/library/zuse/core/poja.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16### `++poja`
27
38JSON parser core
docs/hoon/library/zuse/core/poxa.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16### `++poxa`
27
38Parse XML
docs/hoon/library/zuse/core/poxo.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16### `++poxo`
27
38Print XML
docs/hoon/library/zuse/core/yu.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16### `++yu`
27
38UTC format constants
docs/hoon/library/zuse/diff.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
162eP diff
27========
38
docs/hoon/library/zuse/gate/clan.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16### `++clan`
27
38Ship class
docs/hoon/library/zuse/gate/dawn.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16### `++dawn`
27
38Weekday of Jan 1
docs/hoon/library/zuse/gate/daws.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16### `++daws`
27
38Weekday of date
docs/hoon/library/zuse/gate/deal.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16### `++deal`
27
38Add leap seconds
docs/hoon/library/zuse/gate/deft.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16### `++deft`
27
38Import URL path
docs/hoon/library/zuse/gate/dust.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16### `++dust`
27
38Print UTC format
docs/hoon/library/zuse/gate/earl.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16### `++earl`
27
38Localize purl
docs/hoon/library/zuse/gate/earn.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16### `++earn`
27
38Purl to tape
docs/hoon/library/zuse/gate/fain.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16### `++fain`
27
38Restructure path
docs/hoon/library/zuse/gate/feel.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16### `++feel`
27
38Generate file diff
docs/hoon/library/zuse/gate/file.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16### `++file`
27
38Simple file load
docs/hoon/library/zuse/gate/foal.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16
27### `++foal`
38
docs/hoon/library/zuse/gate/fray.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16
27### `++fray`
38
docs/hoon/library/zuse/gate/fuel.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16### `++fuel`
27
38Parse fcgi
docs/hoon/library/zuse/gate/furl.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16### `++furl`
27
38Unify changes
docs/hoon/library/zuse/gate/glam.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16### `++glam`
27
38Galaxy names
docs/hoon/library/zuse/gate/glon.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16### `++glon`
27
38ISO language code
docs/hoon/library/zuse/gate/gnom.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16### `++gnom`
27
38Display ship name
docs/hoon/library/zuse/gate/jape.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16### `++jape`
27
38`++json` string from tape
docs/hoon/library/zuse/gate/jesc.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16### `++jesc`
27
38Escape JSON character
docs/hoon/library/zuse/gate/joba.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16### `++joba`
27
38`++json` from key-value pair
docs/hoon/library/zuse/gate/jobe.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16### `++jobe`
27
38Object from key-value list
docs/hoon/library/zuse/gate/jone.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16### `++jone`
27
38`++json` number from unigned
docs/hoon/library/zuse/gate/lead.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16### `++lead`
27
38Subtract leap seconds
docs/hoon/library/zuse/gate/mang.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16### `++mang`
27
38Unit: Slam gate with sample
docs/hoon/library/zuse/gate/meat.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16### `++meat`
27
38Kite to .^ path
docs/hoon/library/zuse/gate/moon.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16### `++moon`
27
38Mime type to `++cord`
docs/hoon/library/zuse/gate/mung.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16### `++mung`
27
38Virtualize slamming gate
docs/hoon/library/zuse/gate/perk.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16### `++perk`
27
38Parse cube with fork
docs/hoon/library/zuse/gate/pojo.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16### `++pojo`
27
38Print JSON
docs/hoon/library/zuse/gate/saxo.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16### `++saxo`
27
38List ancestors
docs/hoon/library/zuse/gate/scanf.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16### `++scanf` XX
27
38Formatted scan
docs/hoon/library/zuse/gate/sein.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16### `++sein`
27
38Direct parent
docs/hoon/library/zuse/gate/sifo.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16### `++sifo`
27
3864-bit encode
docs/hoon/library/zuse/gate/stud.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16### `++stud`
27
38Parse UTC format
docs/hoon/library/zuse/gate/taco.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16### `++taco`
27
38Converts an atom to an octet stream [`++octs`](), which contains a length, to
docs/hoon/library/zuse/gate/tact.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16### `++tact`
27
38tape to octs
docs/hoon/library/zuse/gate/tame.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16### `++tame`
27
38Parse kite path
docs/hoon/library/zuse/gate/tell.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16### `++tell`
27
38octs from wall
docs/hoon/library/zuse/gate/tome.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16
27### `++tome`
38
docs/hoon/library/zuse/gate/tope.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16### `++tope`
27
38Parse beam to path
docs/hoon/library/zuse/gate/txml.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16### `++txml`
27
38Tape to xml CDATA node
docs/hoon/library/zuse/gate/unt.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16### `++unt`
27
38UGT to UTC time
docs/hoon/library/zuse/gate/urld.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16### `++urld`
27
38Decode URL
docs/hoon/library/zuse/gate/urle.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16### `++urle`
27
38Encode URL
docs/hoon/library/zuse/mold/udal.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16### `++udal`
27
38Source
docs/hoon/library/zuse/mold/udon.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16### `++udon`
27
38 ++ udon :: abstract delta
docs/hoon/library/zuse/mold/umph.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16### `++umph`
27
38 ++ umph :: change filter
docs/hoon/library/zuse/mold/unce.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16### `++unce`
27
38 ++ unce |* a=_,* :: change part
docs/hoon/library/zuse/mold/upas.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16### `++upas`
27
38 ++ upas :: tree change (%d)
docs/hoon/library/zuse/mold/urge.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16### `++urge`
27
38 ++ urge |*(a=_,* (list (unce a))) :: list change
docs/hoon/library/zuse/rsa.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
16------------------------------------------------------------------------
27
38### `++pram`
docs/hoon/mission.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 2
34next: true
45title: Mission
docs/hoon/reference.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 9
34title: Twig reference
45---
docs/hoon/syntax.md+7−6
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 4
34next: true
45title: Syntax
@@ -53,7 +54,7 @@ the eye to tell whether a token on the screen is a feature of the
5354language, or a label in the program. For example, in Lisp a
5455special form has the same syntax as a function call.
5556
56−The worst-case result of FLC is "DSL cancer". Every source file
57+The worst-case result of FLC is "DSL cancer." Every source file
5758is effectively written in its own domain-specific language. To
5859read a new file is to learn a new language -- "write-only code."
5960
@@ -138,10 +139,10 @@ Some twigs (simple leafy ones) have *only* irregular forms.
138139A regular form starts with a *sigil*, which is either a
139140*keyword* or a *rune* -- at the programmer's choice.
140141
141−A *keyword* is `:` and then the stem label - eg, `:cons`.
142+A *keyword* is `:` and then the stem label - e.g., `:cons`.
142143
143−A *rune* is a pair of ASCII punctuation marks (a digraph) - eg,
144−`:-`. The first glyph in the rune indicates the category - eg,
144+A *rune* is a pair of ASCII punctuation marks (a digraph) - e.g.,
145+`:-`. The first glyph in the rune indicates the category - e.g.,
145146`:` runes make cells. Runes can be pronounced by their glyphs or
146147by their stem -- for `:-`, you can say either "colhep" or "cons".
147148
@@ -152,7 +153,7 @@ with keywords and move to runes; start with runes and stick
152153with runes; or start with keywords and stick with keywords.
153154
154155Here's the FizzBuzz demo code, in idiomatic rune syntax. Compare
155−with the [original](../../demo).
156+with the [original](../demo).
156157
157158```
158159 |= end/atom
@@ -195,7 +196,7 @@ both tall/flat mode switches and well-shaped gaps. (Hoon layout
195196could probably be done automatically with reasonable quality.
196197But it would at least take machine learning, not a rule engine.)
197198
198−There only two real *rules* in Hoon whitespace design: don't
199+There are only two real *rules* in Hoon whitespace design: don't
199200go past 80 characters, and don't use (completely) blank lines.
200201Otherwise, if it looks good and is easy to read, it's good. But
201202the best way to learn the art is to do everything by convention
docs/hoon/troubleshooting.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 12
34title: Troubleshooting
45next: true
docs/hoon/twig.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 6
34next: true
45title: Expressions
docs/hoon/twig/atom.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 1
34
45---
docs/hoon/twig/atom/knit.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 3
34
45---
docs/hoon/twig/atom/path.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 4
34---
45
docs/hoon/twig/atom/rock.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 2
34
45---
docs/hoon/twig/atom/sand.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 1
34
45---
docs/hoon/twig/bar-core.md+5−4
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 5
34
45---
@@ -8,10 +9,10 @@ sort: 5
89Core twigs are flow twigs. The compiler essentially pins a Nock
910formula, or battery of formulas, to the subject.
1011
11−All `|` twigs are macros around `$core`. (See the `$core`
12−section in [`span`](../span) above.) `$core` uses the subject as
13−the payload of a battery, whose arms are compiled with the core
14−itself as the subject.
12+All `|` twigs are macros around `$core`. (See the `$core`
13+section in [`span`](../../basic#-core-p-span-q-map-term-span) above.)
14+`$core` uses the subject as the payload of a battery, whose arms are
15+compiled with the core itself as the subject.
1516
1617## Stems
1718
docs/hoon/twig/bar-core/cab-door.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 5
34
45---
docs/hoon/twig/bar-core/cen-core.md+1−1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 1
34
45---
@@ -20,7 +21,6 @@ Regular: *battery*.
2021A core is like an "object" in a conventional language, but its
2122attributes (*arms*) are functions on the core, not the core and
2223an argument. A "method" on a core is an arm producing a gate.
23−gate.
2424
2525## Examples
2626
docs/hoon/twig/bar-core/dot-trap.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 3
34
45---
docs/hoon/twig/bar-core/hep-loop.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 4
34
45---
docs/hoon/twig/bar-core/tar-gill.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 6
34---
45
docs/hoon/twig/bar-core/tis-gate.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 2
34
45---
docs/hoon/twig/buc-mold.md+2−1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 7
34
45---
@@ -44,7 +45,7 @@ In any case, since molds are just functions, we can use
4445functional programming to assemble interesting molds. For
4546instance, `(map foo bar)` is a table from mold `foo` to mold
4647`bar`. `map` is not a mold; it's a function that makes a mold.
47−Molds and mold builder sare generally described together.
48+Molds and mold builders are generally described together.
4849
4950## Stems
5051
docs/hoon/twig/buc-mold/base.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 1
34
45---
docs/hoon/twig/buc-mold/cab-shoe.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 9
34---
45
docs/hoon/twig/buc-mold/cen-book.md+2−1
@@ -1,9 +1,10 @@
11---
2+navhome: /docs
23sort: 4
34
45---
56
6−# `:book $% "buctis"`
7+# `:book $% "buccen"`
78
89`{$book p/(list {{aura @} moss})}`: mold which recognizes a union tagged by head atom.
910
docs/hoon/twig/buc-mold/col-bank.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 2
34
45---
docs/hoon/twig/buc-mold/hep-lamb.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 8
34
45---
docs/hoon/twig/buc-mold/ket-bush.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 6
34
45---
docs/hoon/twig/buc-mold/pat-claw.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 5
34
45---
docs/hoon/twig/buc-mold/tis-coat.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 3
34
45---
docs/hoon/twig/buc-mold/wut-pick.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 7
34
45---
docs/hoon/twig/cen-call.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 6
34
45---
docs/hoon/twig/cen-call/cab-keep.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 2
34
45---
docs/hoon/twig/cen-call/dot-lace.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 5
34---
45
docs/hoon/twig/cen-call/hep-call.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 4
34---
45
docs/hoon/twig/cen-call/ket-calq.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 7
34---
45
docs/hoon/twig/cen-call/lus-calt.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 6
34---
45
docs/hoon/twig/cen-call/sig-open.md+2−1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 3
34---
45
@@ -30,5 +31,5 @@ learn to step outside your linear, Western way of thinking."
3031
3132## Examples
3233
33−See [`:door`](../bar-core/cab-door).
34+See [`:door`](../../bar-core/cab-door).
3435
docs/hoon/twig/cen-call/tis-make.md+3−2
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 1
34---
45
@@ -25,9 +26,9 @@ Irregular: `foo(x 1, y 2, z 3)` is `:make(foo x 1, y 2, z 3)`.
2526Note that `p` is a wing, not a twig. Knowing that a function
2627call `(foo bar)` involves making `foo`, replacing its sample
2728at slot `+6` with `bar`, and taking the `$` limb, you might think
28−`(foo bar)` would mean `:(make foo +6 bar)`.
29+`(foo bar)` would mean `:make(foo +6 bar)`.
2930
30−But it's actually `:pin(foo :(make $ +2 +6 bar))`. Even if `foo`
31+But it's actually `:pin(foo :make($ +2 +6 bar))`. Even if `foo`
3132is a wing, we would just be mutating `+6` within the core that
3233defines the `foo` arm. Instead we want to modify the *product*
3334of `foo` -- the gate -- so we have to pin it into the subject.
docs/hoon/twig/col-cell.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 3
34
45---
docs/hoon/twig/col-cell/cab-scon.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 6
34---
45
docs/hoon/twig/col-cell/hep-cons.md+8−1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 1
34---
45
@@ -22,7 +23,7 @@ Irregular: `a^b^c` is `[a b c]`.
2223
2324Irregular: `a+b` is `[%a b]`.
2425
25−Irregular: `\`a` is `[~ a]`.
26+Irregular: `` `a`` is `[~ a]`.
2627
2728Irregular: `~[a b]` is `[a b ~]`.
2829
@@ -39,4 +40,10 @@ compiler does), `[a b]` is the same as `[%cons a b]`.
3940```
4041~zod:dojo> :-(1 2)
4142[1 2]
43+~zod:dojo> 1^2
44+[1 2]
45+~zod:dojo> 1+2
46+[%1 2]
47+~zod:dojo> `1
48+[~ 1]
4249```
docs/hoon/twig/col-cell/ket-conq.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 3
34---
45
docs/hoon/twig/col-cell/lus-cont.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 2
34---
45
docs/hoon/twig/col-cell/sig-conl.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 5
34---
45
docs/hoon/twig/col-cell/tar-conp.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 4
34---
45
docs/hoon/twig/dot-nock.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 10
34
45---
docs/hoon/twig/dot-nock/ket-wish.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 5
34---
45
docs/hoon/twig/dot-nock/lus-bump.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 3
34---
45
docs/hoon/twig/dot-nock/tar-nock.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 1
34---
45
docs/hoon/twig/dot-nock/tis-same.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 4
34---
45
docs/hoon/twig/dot-nock/wut-deep.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 2
34---
45
docs/hoon/twig/ket-cast.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 9
34
45---
docs/hoon/twig/ket-cast/bar-iron.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 5
34---
45
docs/hoon/twig/ket-cast/hep-cast.md+5−2
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 2
34---
45
@@ -14,7 +15,9 @@ sort: 2
1415
1516## Syntax
1617
17−Regular: *2-fixed*
18+Regular: *2-fixed*.
19+
20+Irregular: `` `foo`bar`` is `:cast(foo bar)`.
1821
1922## Discussion
2023
@@ -26,7 +29,7 @@ infinite loop in the compiler).
2629
2730## Examples
2831
29−``
32+```
3033~zod:dojo> (add 90 7)
313497
3235~zod:dojo> `@t`(add 90 7)
docs/hoon/twig/ket-cast/lus-like.md+4−3
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 1
34---
45
@@ -15,11 +16,11 @@ within the span of `q`. Otherwise, `nest-fail`.
1516
1617Regular: *2-fixed*.
1718
18−Irregular: `\`_foo\`bar` is `:like(foo bar)`.
19−
2019## Examples
2120
2221```
23−~zod:dojo> :like('text' 97)
22+~zod:dojo> :like('text' %a)
2423'a'
2524```
25+
26+
docs/hoon/twig/ket-cast/sig-burn.md+2−1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 6
34---
45
@@ -8,7 +9,7 @@ sort: 6
89
910## Produces
1011
11−`p`, folded as a constqnt if possible.
12+`p`, folded as a constant if possible.
1213
1314## Syntax
1415
docs/hoon/twig/ket-cast/tis-name.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 3
34---
45
docs/hoon/twig/ket-cast/wut-lead.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 4
34---
45
docs/hoon/twig/limb.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 2
34---
45
docs/hoon/twig/limb/limb.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 1
34
45---
docs/hoon/twig/limb/wing.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 2
34---
45
docs/hoon/twig/sem-make.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 11
34
45---
docs/hoon/twig/sem-make/col-wad.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 3
34---
45
docs/hoon/twig/sem-make/fas-nub.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 4
34---
45
docs/hoon/twig/sem-make/sem-fry.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 1
34---
45
docs/hoon/twig/sem-make/sig-dip.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 2
34---
45
docs/hoon/twig/sig-hint.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 12
34
45---
docs/hoon/twig/sig-hint/bar-show.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 2
34---
45
docs/hoon/twig/sig-hint/buc-poll.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 12
34---
45
docs/hoon/twig/sig-hint/cab-lurk.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 3
34---
45
docs/hoon/twig/sig-hint/cen-fast.md+2−1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 10
34---
45
@@ -26,7 +27,7 @@ between opening and closing `==`.
2627formal identity to the interpreter, which may or may not be able
2728to recognize and/or accelerate it.
2829
29−Registered cores are are organized in a containment hierarchy.
30+Registered cores are organized in a containment hierarchy.
3031The parent core is at any leg within the child core. When we
3132register a core, we state the leg to its parent, in the form of
3233wing `q`. We assume the parent is already registered -- as it
docs/hoon/twig/sig-hint/fas-funk.md+2−1
@@ -1,5 +1,6 @@
11---
2−sort: 1
2+navhome: /docs
3+sort: 11
34---
45
56# `:funk ~/ "sigfas"`
docs/hoon/twig/sig-hint/gal-thin.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 6
34---
45
docs/hoon/twig/sig-hint/gar-hint.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 5
34---
45
docs/hoon/twig/sig-hint/lus-memo.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 7
34---
45
docs/hoon/twig/sig-hint/pam-dump.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 1
34---
45
docs/hoon/twig/sig-hint/tis-ddup.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 8
34---
45
docs/hoon/twig/sig-hint/wut-warn.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 4
34---
45
docs/hoon/twig/sig-hint/zap-peep.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 9
34---
45
docs/hoon/twig/tis-flow.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 4
34
45---
docs/hoon/twig/tis-flow/bar-new.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 5
34---
45
docs/hoon/twig/tis-flow/col-fix.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 9
34---
45
docs/hoon/twig/tis-flow/dot-set.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 8
34---
45
docs/hoon/twig/tis-flow/fas-var.md+2−1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 6
34---
45
@@ -10,7 +11,7 @@ noun with the subject.
1011## Expands to
1112
1213```
13−?@(p :pin(:name(p q) r) :pin(:cast(:(coat p) q) r)
14+?@(p :pin(:name(p q) r) :pin(:cast(:coat(p q) r)
1415```
1516
1617## Syntax
docs/hoon/twig/tis-flow/gal-rap.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 2
34---
45
docs/hoon/twig/tis-flow/gar-per.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 1
34---
45
docs/hoon/twig/tis-flow/hep-nip.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 4
34---
45
docs/hoon/twig/tis-flow/ket-sip.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 10
34---
45
docs/hoon/twig/tis-flow/lus-pin.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 3
34---
45
docs/hoon/twig/tis-flow/sem-rev.md+2−1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 7
34---
45
@@ -10,7 +11,7 @@ subject, inverted.
1011## Expands to
1112
1213```
13−?@(p :pin(:name(p r) q) :pin(:cast(:(coat p) r) q)
14+?@(p :pin(:name(p r) q) :pin(:cast(:coat(p r) q)
1415```
1516
1617## Syntax
docs/hoon/twig/tis-flow/tar-aka.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 11
34---
45
docs/hoon/twig/wut-test.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 8
34---
45
docs/hoon/twig/wut-test/bar-or.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 9
34---
45
docs/hoon/twig/wut-test/col-if.md+2−1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 1
34---
45
@@ -29,7 +30,7 @@ Regular: *3-fixed*.
2930
3031Short-circuiting in boolean tests works as you'd expect
3132and includes the expected inference. For instance,
32−if you write `:(and a b)`, `b` is only executed if `a` is
33+if you write `:and(a b)`, `b` is only executed if `a` is
3334positive, and compiled with that assumption.
3435
3536Note also that all other branching twigs reduce to `:if`.
docs/hoon/twig/wut-test/dot-lest.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 2
34---
45
docs/hoon/twig/wut-test/gal-deny.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 10
34---
45
docs/hoon/twig/wut-test/gar-sure.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 11
34---
45
docs/hoon/twig/wut-test/hep-case.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 12
34---
45
docs/hoon/twig/wut-test/ket-ifcl.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 5
34---
45
docs/hoon/twig/wut-test/lus-deft.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 13
34---
45
docs/hoon/twig/wut-test/pam-and.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 8
34---
45
docs/hoon/twig/wut-test/pat-ifat.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 4
34---
45
docs/hoon/twig/wut-test/sig-ifno.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 3
34---
45
docs/hoon/twig/wut-test/tis-fits.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 6
34---
45
docs/hoon/twig/wut-test/zap-not.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 7
34---
45
docs/hoon/twig/zap-wild.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 13
34
45---
docs/hoon/twig/zap-wild/gar-wrap.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 2
34---
45
docs/hoon/twig/zap-wild/tis-code.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 3
34---
45
docs/hoon/twig/zap-wild/wut-need.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 4
34---
45
docs/hoon/twig/zap-wild/zap-fail.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 1
34---
45
docs/nock.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 5
34title: Nock
45---
docs/nock/definition.md+2−1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 1
34next: true
45title: Definition
@@ -108,7 +109,7 @@ in the subject.
108109
109110A formula `[1 b]` produces the constant noun `b`.
110111
111−A formula `[2 b c]` treats `b` and `c` is formulas, resolves each
112+A formula `[2 b c]` treats `b` and `c` as formulas, resolves each
112113against the subject, then computes Nock again with the product of
113114`b` as the subject, `c` as the formula.
114115
docs/nock/example.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 3
34next: true
45title: Example
docs/nock/explanation.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 2
34next: true
45title: Explanation
docs/nock/implementations.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 4
34title: Implementations
45---
docs/nock/implementations/c.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23title: C
34sort: 6
45next: true
docs/nock/implementations/clojure.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23title: Clojure
34sort: 5
45next: true
docs/nock/implementations/groovy.mdnew file+206
@@ -0,0 +1,206 @@
1+---
2+navhome: /docs
3+title: Groovy
4+sort: 7
5+next: true
6+---
7+
8+# Groovy
9+
10+From [Kohányi Róbert](https://github.com/kohanyirobert/gnock/blob/master/gnock.groovy):
11+
12+```
13+@Memoized
14+def i(def a) {
15+ a.class in [
16+ byte, Byte,
17+ char, Character,
18+ short, Short,
19+ int, Integer,
20+ long, Long,
21+ BigInteger
22+ ] && a >= 0
23+}
24+
25+@Memoized
26+def n(def a) {
27+ def r
28+ n(a, { r = it })
29+ r
30+}
31+
32+@TailRecursive
33+def n(def a, def r) {
34+ if (a in List) {
35+ if (a.size() == 1) {
36+ r(a[0])
37+ } else if (a.size() >= 2) {
38+ n(a[0], { t ->
39+ n(a.size() == 2 ? a[1] : a.tail(), { h ->
40+ r([t, h])
41+ })
42+ })
43+ } else {
44+ throw new IllegalStateException()
45+ }
46+ } else if (i(a)) {
47+ r((BigInteger) a)
48+ } else {
49+ throw new IllegalStateException()
50+ }
51+}
52+
53+@Memoized
54+def wut(def a) {
55+ i(a) ? 1 : 0
56+}
57+
58+@Memoized
59+def lus(def a) {
60+ if (wut(a) == 0) {
61+ throw new IllegalStateException()
62+ }
63+ 1 + a
64+}
65+
66+@Memoized
67+def tis(def a) {
68+ if (wut(a) == 1) {
69+ throw new IllegalStateException()
70+ }
71+ a[0] == a[1] ? 0 : 1
72+}
73+
74+@Memoized
75+def fas(def a) {
76+ def r
77+ fas(a, { r = it })
78+ r
79+}
80+
81+@TailRecursive
82+def fas(def a, def r) {
83+ if (wut(a) == 1) {
84+ throw new IllegalStateException()
85+ }
86+ def h = a[0]
87+ if (!i(h)) {
88+ throw new IllegalStateException()
89+ }
90+ def t = a[1]
91+ if (h == 0) {
92+ throw new IllegalStateException()
93+ } else if (h == 1) {
94+ r(t)
95+ } else {
96+ if (i(t)) {
97+ throw new IllegalStateException()
98+ }
99+ if (h == 2) {
100+ r(t[0])
101+ } else if (h == 3) {
102+ r(t[1])
103+ } else {
104+ fas([h.intdiv(2), t], { p ->
105+ fas([2 + h.mod(2), p], { q ->
106+ r(q)
107+ })
108+ })
109+ }
110+ }
111+}
112+
113+@Memoized
114+def tar(def a) {
115+ def r
116+ tar(a, { r = it})
117+ r
118+}
119+
120+@TailRecursive
121+def tar(def a, def r) {
122+ if (wut(a) == 1) {
123+ throw new IllegalStateException()
124+ }
125+ def s = a[0]
126+ def f = a[1]
127+ if (wut(f) == 1) {
128+ throw new IllegalStateException()
129+ }
130+ def o = f[0]
131+ def v = f[1]
132+ if (wut(o) == 0) {
133+ tar([s, o], { p ->
134+ tar([s, v], { q ->
135+ r([p, q])
136+ })
137+ })
138+ } else {
139+ if (o == 0) {
140+ r(fas([v, s]))
141+ } else if (o == 1) {
142+ r(v)
143+ } else if (o == 3) {
144+ tar([s, v], {
145+ r(wut(it))
146+ })
147+ } else if (o == 4) {
148+ tar([s, v], {
149+ r(lus(it))
150+ })
151+ } else if (o == 5) {
152+ tar([s, v], {
153+ r(tis(it))
154+ })
155+ } else {
156+ if (wut(v) == 1) {
157+ throw new IllegalStateException()
158+ }
159+ def x = v[0]
160+ def y = v[1]
161+ if (o == 2) {
162+ tar([s, x], { p ->
163+ tar([s, y], { q ->
164+ tar([p, q], {
165+ r(it)
166+ })
167+ })
168+ })
169+ } else if (o == 7) {
170+ tar(n([s, 2, x, 1, y]), {
171+ r(it)
172+ })
173+ } else if (o == 8) {
174+ tar(n([s, 7, [[7, [0, 1], x], 0, 1], y]), {
175+ r(it)
176+ })
177+ } else if (o == 9) {
178+ tar(n([s, 7, y, 2, [0, 1], 0, x]), {
179+ r(it)
180+ })
181+ } else if (o == 10) {
182+ if (wut(x) == 1) {
183+ tar([s, y], {
184+ r(it)
185+ })
186+ } else {
187+ tar(n([s, 8, x[1], 7, [0, 3], y]), {
188+ r(it)
189+ })
190+ }
191+ } else {
192+ if (wut(y) == 1) {
193+ throw new IllegalStateException()
194+ }
195+ if (o == 6) {
196+ tar(n([s, 2, [0, 1], 2, [1, y[0], y[1]], [1, 0], 2, [1, 2, 3], [1, 0], 4, 4, x]), {
197+ r(it)
198+ })
199+ } else {
200+ throw new IllegalStateException()
201+ }
202+ }
203+ }
204+ }
205+}
206+```
docs/nock/implementations/haskell.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23title: Haskell
34sort: 3
45next: true
docs/nock/implementations/hoon.md+2−1
@@ -1,6 +1,7 @@
11---
2+navhome: /docs
23title: Hoon
3−sort: 7
4+sort: 11
45---
56
67# Hoon
docs/nock/implementations/javascript.mdnew file+365
@@ -0,0 +1,365 @@
1+---
2+navhome: /docs
3+title: Javascript
4+sort: 9
5+next: true
6+---
7+
8+# Javascript
9+
10+From [Joe Bryan](https://github.com/joemfb/nock.js/blob/master/nock.js):
11+
12+```js
13+(function (self, factory) {
14+ 'use strict'
15+
16+ if (typeof define === 'function' && define.amd) {
17+ define([], factory)
18+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
19+ module.exports = factory()
20+ } else {
21+ self.nock = factory()
22+ }
23+}(this, function () {
24+ 'use strict'
25+
26+ /**
27+ * Nock is a combinator interpreter on nouns. A noun is an atom or a cell.
28+ * An atom is an unsigned integer of any size; a cell is an ordered pair of nouns.
29+ *
30+ * @see http://urbit.org/docs/nock/definition/
31+ * @see http://media.urbit.org/whitepaper.pdf
32+ */
33+
34+ var useMacros = false
35+
36+ /*
37+ * code conventions:
38+ *
39+ * `n` is a noun,
40+ * `s` is a subject noun,
41+ * `f` is a formula (or cell of formulas)
42+ */
43+
44+ /* operators */
45+
46+ /**
47+ * wut (?): test for atom (1) or cell (0)
48+ *
49+ * ?[a b] 0
50+ * ?a 1
51+ */
52+ function wut (n) {
53+ return typeof n === 'number' ? 1 : 0
54+ }
55+
56+ /**
57+ * lus (+): increment an atom
58+ *
59+ * +[a b] +[a b]
60+ * +a 1 + a
61+ */
62+ function lus (n) {
63+ if (wut(n) === 0) throw new Error('lus cell')
64+ return 1 + n
65+ }
66+
67+ /**
68+ * tis (=): test equality
69+ *
70+ * =[a a] 0
71+ * =[a b] 1
72+ * =a =a
73+ */
74+ function tis (n) {
75+ if (wut(n) === 1) throw new Error('tis atom')
76+ return deepEqual(n[0], n[1]) ? 0 : 1
77+ }
78+
79+ /**
80+ * fas (/): resolve a tree address
81+ *
82+ * /[1 a] a
83+ * /[2 a b] a
84+ * /[3 a b] b
85+ * /[(a + a) b] /[2 /[a b]]
86+ * /[(a + a + 1) b] /[3 /[a b]]
87+ * /a /a
88+ */
89+ function fas (addr, n) {
90+ if (n === undefined) throw new Error('invalid fas noun')
91+ if (addr === 0) throw new Error('invalid fas addr: 0')
92+
93+ if (addr === 1) return n
94+ if (addr === 2) return n[0]
95+ if (addr === 3) return n[1]
96+
97+ return fas(2 + (addr % 2), fas((addr / 2) | 0, n))
98+ }
99+
100+ /* formulas */
101+
102+ /**
103+ * slot (0): resolve a tree address
104+ *
105+ * *[a 0 b] /[b a]
106+ */
107+ function slot (s, f) {
108+ var p = fas(f, s)
109+
110+ if (p === undefined) throw new Error('invalid fas addr: ' + f)
111+
112+ return p
113+ }
114+
115+ /**
116+ * constant (1): return the formula regardless of subject
117+ *
118+ * *[a 1 b] b
119+ */
120+ function constant (s, f) {
121+ return f
122+ }
123+
124+ /**
125+ * evaluate (2): evaluate the product of second formula against the product of the first
126+ *
127+ * *[a 2 b c] *[*[a b] *[a c]]
128+ */
129+ function evaluate (s, f) {
130+ return nock(nock(s, f[0]), nock(s, f[1]))
131+ }
132+
133+ /**
134+ * cell (3): test if the product is a cell
135+ *
136+ * *[a 3 b] ?*[a b]
137+ */
138+ function cell (s, f) {
139+ return wut(nock(s, f))
140+ }
141+
142+ /**
143+ * incr (4): increment the product
144+ *
145+ * *[a 4 b] +*[a b]
146+ */
147+ function incr (s, f) {
148+ return lus(nock(s, f))
149+ }
150+
151+ /**
152+ * eq (5): test for equality between nouns in the product
153+ *
154+ * *[a 5 b] =*[a b]
155+ */
156+ function eq (s, f) {
157+ return tis(nock(s, f))
158+ }
159+
160+ /* macro-formulas */
161+
162+ /**
163+ * ife (6): if/then/else
164+ *
165+ * *[a 6 b c d] *[a 2 [0 1] 2 [1 c d] [1 0] 2 [1 2 3] [1 0] 4 4 b]
166+ */
167+ function macroIfe (s, f) {
168+ return nock(s, [2, [[0, 1], [2, [[1, [f[1][0], f[1][1]]], [[1, 0], [2, [[1, [2, 3]], [[1, 0], [4, [4, f[0]]]]]]]]]]])
169+ }
170+
171+ function ife (s, f) {
172+ var cond = nock(s, f[0])
173+
174+ if (cond === 0) return nock(s, f[1][0])
175+ if (cond === 1) return nock(s, f[1][1])
176+
177+ throw new Error('invalid ife conditional')
178+ }
179+
180+ /**
181+ * compose (7): evaluate formulas composed left-to-right
182+ *
183+ * *[a 7 b c] *[a 2 b 1 c]
184+ */
185+ function macroCompose (s, f) {
186+ return nock(s, [2, [f[0], [1, f[1]]]])
187+ }
188+
189+ function compose (s, f) {
190+ // alternate form:
191+ // return nock(nock(s, f[0]), constant(s, f[1]))
192+ return nock(nock(s, f[0]), f[1])
193+ }
194+
195+ /**
196+ * extend (8): evaluate the second formula against [product of first, subject]
197+ *
198+ * *[a 8 b c] *[a 7 [[7 [0 1] b] 0 1] c]
199+ */
200+ function macroExtend (s, f) {
201+ return nock(s, [7, [[[7, [[0, 1], f[0]]], [0, 1]], f[1]]])
202+ }
203+
204+ function extend (s, f) {
205+ // alternate form:
206+ // return nock([compose(s, [[0, 1], f[0]]), s], f[1])
207+ return nock([nock(s, f[0]), s], f[1])
208+ }
209+
210+ /**
211+ * invoke (9): construct a core and evaluate one of it's arms against it
212+ *
213+ * *[a 9 b c] *[a 7 c 2 [0 1] 0 b]
214+ */
215+ function macroInvoke (s, f) {
216+ return nock(s, [7, [f[1], [2, [[0, 1], [0, f[0]]]]]])
217+ }
218+
219+ function invoke (s, f) {
220+ var prod = nock(s, f[1])
221+ return nock(prod, slot(prod, f[0]))
222+ }
223+
224+ /**
225+ * hint (10): skip first formula, evaluate second
226+ *
227+ * *[a 10 [b c] d] *[a 8 c 7 [0 3] d]
228+ * *[a 10 b c] *[a c]
229+ */
230+ function macroHint (s, f) {
231+ if (wut(f[0]) === 0) return nock(s, [8, [f[0][1], [7, [[0, 3], f[1]]]]])
232+ return nock(s, f[1])
233+ }
234+
235+ function hint (s, f) {
236+ if (wut(f[0]) === 0) {
237+ if (wut(f[0][1]) === 1) throw new Error('invalid hint')
238+ nock(s, f[0][1])
239+ }
240+ return nock(s, f[1])
241+ }
242+
243+ /* indexed formula functions */
244+ var macroFormulas = [slot, constant, evaluate, cell, incr, eq, macroIfe, macroCompose, macroExtend, macroInvoke, macroHint]
245+ var formulas = [slot, constant, evaluate, cell, incr, eq, ife, compose, extend, invoke, hint]
246+
247+ /**
248+ * nock (*)
249+ *
250+ * the nock function
251+ *
252+ * *[a [b c] d] [*[a b c] *[a d]]
253+ * *a *a
254+ */
255+ function nock (s, f) {
256+ if (wut(f[0]) === 0) return [nock(s, f[0]), nock(s, f[1])]
257+
258+ var idx = f[0]
259+
260+ if (idx > 10) throw new Error('invalid formula: ' + idx)
261+
262+ if (useMacros) return macroFormulas[idx](s, f[1])
263+
264+ return formulas[idx](s, f[1])
265+ }
266+
267+ /* construct a JS noun (group an array into pairs, associating right) */
268+ function assoc (x) {
269+ if (!x.length) return x
270+
271+ if (x.length === 1) return assoc(x[0])
272+
273+ return [assoc(x[0]), assoc(x.slice(1))]
274+ }
275+
276+ /* deep equality for arrays or primitives */
277+ function deepEqual (a, b) {
278+ if (a === b) return true
279+
280+ if (!(Array.isArray(a) && Array.isArray(b))) return false
281+ if (a.length !== b.length) return false
282+
283+ for (var i = 0; i < a.length; i++) {
284+ if (!deepEqual(a[i], b[i])) return false
285+ }
286+
287+ return true
288+ }
289+
290+ /* parse a hoon-serialized nock formula and construct a JS noun */
291+ function parseNoun (x) {
292+ if (Array.isArray(x)) return assoc(x)
293+
294+ if (typeof x === 'string') {
295+ var str = x.replace(/[\."']/g, '').split(' ').join(',')
296+ return assoc(JSON.parse(str))
297+ }
298+
299+ return x
300+ }
301+
302+ function nockInterface () {
303+ var args = [].slice.call(arguments)
304+ var subject, formula, noun
305+
306+ if (args.length === 1) {
307+ formula = parseNoun(args[0])
308+ } else if (args.length === 2) {
309+ subject = parseNoun(args[0])
310+ formula = parseNoun(args[1])
311+ } else {
312+ noun = assoc(args)
313+ subject = noun[0]
314+ formula = noun[1]
315+ }
316+
317+ if (!formula) throw new Error('formula required')
318+
319+ if (!subject) {
320+ // !=(~)
321+ subject = [1, 0]
322+ }
323+
324+ return nock(subject, formula)
325+ }
326+
327+ return {
328+ nock: nockInterface,
329+ _nock: nock,
330+ useMacros: function (arg) {
331+ useMacros = arg === undefined || arg
332+ return this
333+ },
334+ util: {
335+ assoc: assoc,
336+ parseNoun: parseNoun,
337+ deepEqual: deepEqual
338+ },
339+ operators: {
340+ wut: wut,
341+ lus: lus,
342+ tis: tis,
343+ fas: fas
344+ },
345+ formulas: {
346+ slot: slot,
347+ constant: constant,
348+ evaluate: evaluate,
349+ cell: cell,
350+ incr: incr,
351+ eq: eq,
352+ macroIfe: macroIfe,
353+ ife: ife,
354+ macroCompose: macroCompose,
355+ compose: compose,
356+ macroExtend: macroExtend,
357+ extend: extend,
358+ macroInvoke: macroInvoke,
359+ invoke: invoke,
360+ macroHint: macroHint,
361+ hint: hint
362+ }
363+ }
364+}))
365+```
docs/nock/implementations/python.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23title: Python
34sort: 1
45next: true
docs/nock/implementations/ruby.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23title: Ruby
34sort: 2
45next: true
docs/nock/implementations/scala.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23title: Scala
34sort: 4
45next: true
docs/nock/implementations/scheme.mdnew file+128
@@ -0,0 +1,128 @@
1+---
2+navhome: /docs
3+title: Scheme
4+sort: 8
5+next: true
6+---
7+
8+# Scheme
9+
10+From [Kohányi Róbert](https://github.com/kohanyirobert/snock/blob/master/snock.ss):
11+
12+```
13+(import (rnrs (6)))
14+
15+(define (i a) a)
16+
17+(define (n a r)
18+ (cond
19+ ((list? a)
20+ (let ((l (length a)))
21+ (cond
22+ ((equal? l 0) (raise 1))
23+ ((equal? l 1) (r (car a)))
24+ (else
25+ (let ((t (cond
26+ ((equal? l 2) (cadr a))
27+ (else (cdr a)))))
28+ (n (car a)
29+ (lambda (p) (n t
30+ (lambda (q) (r (cons p q)))))))))))
31+ ((fixnum? a) (r a))
32+ (else (raise 2))))
33+
34+(define (wut a)
35+ (cond
36+ ((fixnum? a) 1)
37+ (else 0)))
38+
39+(define (lus a)
40+ (cond
41+ ((equal? (wut a) 0) (raise 3))
42+ (else (+ 1 a))))
43+
44+(define (tis a)
45+ (cond
46+ ((equal? (wut a) 1) (raise 4))
47+ ((equal? (car a) (cdr a)) 0)
48+ (else 1)))
49+
50+(define (fas a r)
51+ (cond
52+ ((equal? (wut a) 1) (raise 5))
53+ (else
54+ (let ((h (car a))
55+ (t (cdr a)))
56+ (cond
57+ ((not (fixnum? h)) (raise 6))
58+ ((equal? h 0) (raise 7))
59+ ((equal? h 1) (r t))
60+ ((fixnum? t) (raise 8))
61+ ((equal? h 2) (r (car t)))
62+ ((equal? h 3) (r (cdr t)))
63+ (else
64+ (fas (cons (div h 2) t)
65+ (lambda (p) (fas (cons (+ 2 (mod h 2)) p)
66+ (lambda (q) (r q)))))))))))
67+
68+(define (tar a r)
69+ (cond
70+ ((equal? (wut a) 1) (raise 9))
71+ (else
72+ (let ((s (car a))
73+ (f (cdr a)))
74+ (cond
75+ ((equal? (wut f) 1) (raise 10))
76+ (else
77+ (let ((o (car f))
78+ (v (cdr f)))
79+ (cond
80+ ((equal? (wut o) 0) (tar (cons s o)
81+ (lambda (p) (tar (cons s v)
82+ (lambda (q) (r (cons p q)))))))
83+ ((equal? o 0) (r (fas (cons v s) i)))
84+ ((equal? o 1) (r v))
85+ ((equal? o 3) (tar (cons s v)
86+ (lambda (p) (r (wut p)))))
87+ ((equal? o 4) (tar (cons s v)
88+ (lambda (p) (r (lus p)))))
89+ ((equal? o 5) (tar (cons s v)
90+ (lambda (p) (r (tis p)))))
91+ ((equal? (wut v) 1) (raise 11))
92+ (else
93+ (let ((x (car v))
94+ (y (cdr v)))
95+ (cond
96+ ((equal? o 2) (tar (cons s x)
97+ (lambda (p) (tar (cons s y)
98+ (lambda (q) (tar (cons p q)
99+ (lambda (u) (r u))))))))
100+ ((equal? o 7) (tar (n (list (list s) 2 (list x) 1 (list y)) i)
101+ (lambda (p) (r p))))
102+ ((equal? o 8) (tar (n (list (list s) 7 (list (list 7 (list 0 1) (list x)) 0 1) (list y)) i)
103+ (lambda (p) (r p))))
104+ ((equal? o 9) (tar (n (list (list s) 7 (list y) 2 (list 0 1) 0 (list x)) i)
105+ (lambda (p) (r p))))
106+ ((equal? o 10) (cond
107+ ((equal? (wut x) 1) (tar (cons s y)
108+ (lambda (p) (r p))))
109+ (else (tar (n (list (list s) 8 (list (cdr x)) 7 (list 0 3) (list y)) i)
110+ (lambda (p) (r p))))))
111+ ((equal? (wut y) 1) (raise 12))
112+ ((equal? o 6) (tar (n (list
113+ (list s)
114+ 2
115+ (list 0 1)
116+ 2
117+ (list 1 (list (car y)) (list (cdr y)))
118+ (list 1 0)
119+ 2
120+ (list 1 2 3)
121+ (list 1 0)
122+ 4
123+ 4
124+ (list x))
125+ i)
126+ (lambda (p) (r p))))
127+ (else (raise 13)))))))))))))
128+```
docs/nock/implementations/swift.mdnew file+366
@@ -0,0 +1,366 @@
1+---
2+navhome: /docs
3+title: Swift
4+sort: 10
5+next: true
6+---
7+
8+# Swift
9+
10+```swift
11+import Foundation
12+// 1 :: A noun is an atom or a cell.
13+// 2 :: An atom is a natural number.
14+// 3 :: A cell is an ordered pair of nouns.
15+// 4
16+// 5 :: nock(a) *a
17+// 6 :: [a b c] [a [b c]]
18+// 7
19+// 8 :: ?[a b] 0
20+// 9 :: ?a 1
21+// 10 :: +[a b] +[a b]
22+// 11 :: +a 1 + a
23+// 12 :: =[a a] 0
24+// 13 :: =[a b] 1
25+// 14 :: =a =a
26+// 15
27+// 16 :: /[1 a] a
28+// 17 :: /[2 a b] a
29+// 18 :: /[3 a b] b
30+// 19 :: /[(a + a) b] /[2 /[a b]]
31+// 20 :: /[(a + a + 1) b] /[3 /[a b]]
32+// 21 :: /a /a
33+// 22
34+// 23 :: *[a [b c] d] [*[a b c] *[a d]]
35+// 24
36+// 25 :: *[a 0 b] /[b a]
37+// 26 :: *[a 1 b] b
38+// 27 :: *[a 2 b c] *[*[a b] *[a c]]
39+// 28 :: *[a 3 b] ?*[a b]
40+// 29 :: *[a 4 b] +*[a b]
41+// 30 :: *[a 5 b] =*[a b]
42+// 31
43+// 32 :: *[a 6 b c d] *[a 2 [0 1] 2 [1 c d] [1 0] 2 [1 2 3] [1 0] 4 4 b]
44+// 33 :: *[a 7 b c] *[a 2 b 1 c]
45+// 34 :: *[a 8 b c] *[a 7 [[7 [0 1] b] 0 1] c]
46+// 35 :: *[a 9 b c] *[a 7 c 2 [0 1] 0 b]
47+// 36 :: *[a 10 [b c] d] *[a 8 c 7 [0 3] d]
48+// 37 :: *[a 10 b c] *[a c]
49+// 38
50+// 39 :: *a *a
51+
52+// 1 :: A noun is an atom or a cell.
53+public indirect enum Noun: IntegerLiteralConvertible, ArrayLiteralConvertible, Equatable, Hashable, CustomStringConvertible
54+{
55+ // 2 :: An atom is a natural number.
56+ public typealias ATOM = UIntMax
57+
58+ case Atom(ATOM)
59+ // 3 :: A cell is an ordered pair of nouns.
60+ case Cell(Noun, Noun)
61+ case Invalid
62+
63+ public static var YES: Noun { return .Atom(0) }
64+ public static var NO: Noun { return .Atom(1) }
65+
66+ public init(_ noun: Noun) { self = noun }
67+
68+ // 6 :: [a b c] [a [b c]]
69+ public init(_ nouns: [Noun]) {
70+ self = .Invalid
71+ if nouns.count > 0 {
72+ var reverse = nouns.reverse().generate()
73+ self = reverse.next()!
74+ while let n = reverse.next() {
75+ self = .Cell(n, self)
76+ }
77+ }
78+ }
79+
80+ // protocol IntegerLiteralConvertible
81+ public typealias IntegerLiteralType = ATOM
82+ public init(integerLiteral value: IntegerLiteralType) {
83+ self = .Atom(value)
84+ }
85+
86+ // protocol ArrayLiteralConvertible
87+ public typealias Element = Noun
88+ public init(arrayLiteral elements: Element...) {
89+ self = Noun(elements)
90+ }
91+
92+ // Array subscript
93+ public subscript(axis: ATOM) -> Noun {
94+ return fas(.Cell(.Atom(axis), self))
95+ }
96+
97+ // protocol Hashable
98+ public var hashValue: Int {
99+ //return self.description.hashValue
100+ switch self {
101+ case let .Atom(a):
102+ return a.hashValue
103+ case let .Cell(a, b):
104+ return (5381 + 31 &* a.hashValue) &+ b.hashValue
105+ default:
106+ abort()
107+ }
108+ }
109+
110+ // protocol CustomStringConvertible
111+ public var description: String {
112+ return describe()
113+ }
114+
115+ private func describe(depth: Int = 0) -> String {
116+ var sub = ""
117+ let next = depth+1
118+ switch self {
119+ case .Invalid:
120+ return "[%INVALID%]"
121+ case let .Atom(atom):
122+ return "\(atom)"
123+ case let .Cell(.Cell(a, b), c):
124+ sub = "[\(a.describe(next)) \(b.describe(next))] \(c.describe(next))"
125+ case let .Cell(a, b):
126+ sub = "\(a.describe(next)) \(b.describe(next))"
127+ }
128+ return depth == 0 ? "[\(sub)]" : sub
129+ }
130+}
131+
132+// protocol Equatable
133+public func == (left: Noun, right: Noun) -> Bool
134+{
135+ switch (left, right) {
136+ case let (.Atom(lhs), .Atom(rhs)): return lhs == rhs
137+ case let (.Cell(lp, lq), .Cell(rp, rq)): return lp == rp && lq == rq
138+ case (.Invalid, .Invalid): return true
139+ default: return false
140+ }
141+}
142+
143+public func wut(noun: Noun) -> Noun
144+{
145+ switch noun {
146+ // 8 :: ?[a b] 0
147+ case .Cell:
148+ return Noun.YES
149+ case .Atom:
150+ // 9 :: ?a 1
151+ return Noun.NO
152+ default:
153+ //return wut(noun)
154+ abort()
155+ }
156+}
157+
158+public func lus(noun: Noun) -> Noun
159+{
160+ if case let .Atom(a) = noun {
161+ // 11 :: +a 1 + a
162+ return .Atom(1+a)
163+ }
164+ // 10 :: +[a b] +[a b]
165+ //return lus(noun)
166+ abort()
167+}
168+
169+public func tis(noun: Noun) -> Noun
170+{
171+ if case let .Cell(a, b) = noun {
172+ // 12 :: =[a a] 0
173+ // 13 :: =[a b] 1
174+ return (a == b) ? Noun.YES : Noun.NO
175+ }
176+ // 14 :: =a =a
177+ //return tis(noun)
178+ abort()
179+}
180+
181+public func fas(noun: Noun) -> Noun
182+{
183+ switch noun {
184+ // 16 :: /[1 a] a
185+ case let .Cell(1, a):
186+ return a
187+ // 17 :: /[2 a b] a
188+ case let .Cell(2, .Cell(a, _)):
189+ return a
190+ // 18 :: /[3 a b] b
191+ case let .Cell(3, .Cell(_, b)):
192+ return b
193+ // 19 :: /[(a + a) b] /[2 /[a b]]
194+ // 20 :: /[(a + a + 1) b] /[3 /[a b]]
195+ case let .Cell(.Atom(axis), tree):
196+ let inner = Noun.Atom(axis / 2)
197+ let outer = Noun.Atom(2 + (axis % 2))
198+ return fas(.Cell(outer, fas(.Cell(inner, tree))))
199+ default:
200+ // 21 :: /a /a
201+ //return fas(noun)
202+ abort()
203+ }
204+}
205+
206+public func tar(noun: Noun) -> Noun
207+{
208+ switch noun {
209+ case let .Cell(a, formula):
210+ switch formula {
211+ // 23 :: *[a [b c] d] [*[a b c] *[a d]]
212+ case let .Cell(.Cell(b, c), d):
213+ return .Cell(tar([a, b, c]), tar([a, d]))
214+
215+ // 25 :: *[a 0 b] /[b a]
216+ case let .Cell(0, b):
217+ return fas([b, a])
218+
219+ // 26 :: *[a 1 b] b
220+ case let .Cell(1, b):
221+ return b
222+
223+ // 27 :: *[a 2 b c] *[*[a b] *[a c]]
224+ case let .Cell(2, .Cell(b, c)):
225+ return tar([tar([a, b]), tar([a, c])])
226+
227+ // 28 :: *[a 3 b] ?*[a b]
228+ case let .Cell(3, b):
229+ return wut(tar([a, b]))
230+
231+ // 29 :: *[a 4 b] +*[a b]
232+ case let .Cell(4, b):
233+ return lus(tar([a, b]))
234+
235+ // 30 :: *[a 5 b] =*[a b]
236+ case let .Cell(5, b):
237+ return tis(tar([a, b]))
238+
239+ // 32 :: *[a 6 b c d] *[a 2 [0 1] 2 [1 c d] [1 0] 2 [1 2 3] [1 0] 4 4 b]
240+ case let .Cell(6, .Cell(b, .Cell(c, d))):
241+ return tar([a, 2, [0, 1], 2, [1, c, d], [1, 0], 2, [1, 2, 3], [1, 0], 4, 4, b])
242+
243+ // 33 :: *[a 7 b c] *[a 2 b 1 c]
244+ case let .Cell(7, .Cell(b, c)):
245+ return tar([a, 2, b, 1, c])
246+
247+ // 34 :: *[a 8 b c] *[a 7 [[7 [0 1] b] 0 1] c]
248+ case let .Cell(8, .Cell(b, c)):
249+ return tar([a, 7, [[7, [0, 1], b], 0, 1], c])
250+
251+ // 35 :: *[a 9 b c] *[a 7 c 2 [0 1] 0 b]
252+ case let .Cell(9, .Cell(b, c)):
253+ return tar([a, 7, c, 2, [0, 1], 0, b])
254+
255+ // 36 :: *[a 10 [b c] d] *[a 8 c 7 [0 3] d]
256+ case let .Cell(10, .Cell(.Cell(_, c), d)):
257+ return tar([a, 8, c, 7, [0, 3], d])
258+
259+ // 37 :: *[a 10 b c] *[a c]
260+ case let .Cell(10, .Cell(_, c)):
261+ return tar([a, c]);
262+
263+ default:
264+ //return tar(noun)
265+ abort()
266+ }
267+ default:
268+ //return tar(noun)
269+ abort()
270+ }
271+}
272+
273+
274+public var nock_functions = Dictionary<Noun, Noun -> Noun>()
275+
276+public func dao(formula: Noun) -> Noun->Noun
277+{
278+ if let cached = nock_functions[formula] {
279+ return cached
280+ }
281+
282+ let compiler = { () -> Noun -> Noun in
283+ switch formula {
284+ case let .Cell(.Cell(b, c), d): // Distribution
285+ let (p, q) = (dao(.Cell(b, c)), dao(d))
286+ return { a in .Cell(p(a), q(a)) }
287+
288+ case let .Cell(0, b): // Axis
289+ return { a in fas(.Cell(b, a)) }
290+
291+ case let .Cell(1, b): // Just
292+ return { _ in b }
293+
294+ case let .Cell(2, .Cell(b, c)): // Fire
295+ let (f, g) = (dao(b), dao(c))
296+ return { a in dao(g(a))(f(a)) }
297+
298+ case let .Cell(3, b): // Depth
299+ let f = dao(b)
300+ return { a in wut(f(a)) }
301+
302+ case let .Cell(4, b): // Bump
303+ let f = dao(b)
304+ return { a in lus(f(a)) }
305+
306+ case let .Cell(5, b): // Same
307+ let f = dao(b)
308+ return { a in tis(f(a)) }
309+
310+ case let .Cell(6, .Cell(b, .Cell(c, d))): // If
311+ let (p, q, r) = (dao(b), dao(c), dao(d))
312+ return { a in
313+ switch p(a) {
314+ case Noun.self.YES:
315+ return q(a)
316+ case Noun.self.NO:
317+ return r(a)
318+ default:
319+ return tar(.Cell(a, formula))
320+ }
321+ }
322+
323+ case let .Cell(7, .Cell(b, c)): // Compose
324+ let (f, g) = (dao(b), dao(c))
325+ return { a in g(f(a)) }
326+
327+ case let .Cell(8, .Cell(b, c)): // Push
328+ let (f, g) = (dao(b), dao(c))
329+ return { a in g(.Cell(f(a), a)) }
330+
331+ case let .Cell(9, .Cell(b, c)): // Call
332+ let f = dao(c)
333+ return { a in
334+ let core = f(a)
335+ let arm = dao(fas(.Cell(b, core)))
336+ return arm(core)
337+ }
338+
339+ case let .Cell(10, .Cell(.Cell(_, c), d)): // Hint
340+ let ignore = dao(c)
341+ let f = dao(d)
342+ return { a in ignore(a); return f(a) }
343+
344+ case let .Cell(10, .Cell(_, c)): // Hint
345+ let f = dao(c)
346+ return { a in f(a) }
347+
348+ default:
349+ return { a in tar(.Cell(a, formula)) }
350+ }
351+ }
352+
353+ let r = compiler()
354+ nock_functions[formula] = r
355+ return r
356+}
357+
358+public func nock(n: Noun) -> Noun
359+{
360+ if case let .Cell(a, b) = n {
361+ let f = dao(b)
362+ return f(a)
363+ }
364+ return nock(n)
365+}
366+```
docs/using.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 2
34---
45
docs/using/admin.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23next: true
34sort: 3
45title: Basic operation
docs/using/filesystem.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23next: true
34sort: 6
45title: Filesystem
docs/using/install.md+2−2
@@ -1,8 +1,8 @@
11---
2+navhome: /docs
23next: true
34sort: 1
45title: Install
5−navhome: /main
66---
77
88# Install
@@ -48,7 +48,7 @@ Which can usually be installed with the following one-liners:
4848 sudo dnf install gcc gcc-c++ git gmp-devel openssl-devel openssl ncurses-devel libsigsegv-devel ctags automake autoconf libtool ragel cmake re2c
4949
5050 # FreeBSD
51− pkg install git gmake gmp libsigsegv openssl automake autoconf ragel cmake re2c libtool
51+ pkg install git gmake gmp libsigsegv curl python automake autoconf ragel cmake re2c libtool
5252
5353 # Arch
5454 pacman -S gcc gmp libsigsegv openssl automake autoconf ragel cmake re2c libtool ncurses
docs/using/layout.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 8
34title: Source layout
45---
docs/using/messaging.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23next: true
34sort: 4
45title: Messaging (:talk)
docs/using/setup.md+26−15
@@ -1,8 +1,8 @@
11---
2+navhome: /docs
23next: true
34sort: 2
45title: Setup
5−navhome: /docs
66---
77
88# Getting started
@@ -11,19 +11,28 @@ On disk your urbit is an append-only log and a checkpoint. Or, in simpler terms
1111
1212## Initialize
1313
14−To create an urbit, we must make a pier and assign it an identity. An urbit with an identity is a 'planet', if it was generated by a 'star' (an urbit that makes more urbits. Accordingly, a 'galaxy' is an urbit that makes stars).
14+To create an urbit, we need an identity, called a "ship." A ship
15+is both a network address and a memorable name.
16+
17+You are probably creating one of two kinds of ship, a 32-bit
18+"planet" or a 128-bit "comet."
1519
16−To make a planet, you need a ticket from a star. If you have a ticket, like `~fortyv-tombyt-tabsen-sonres`, start your planet `~fintud-macrep` like so:
20+If you have an Urbit invitation, you'll have a planet like
21+`~fintud-macrep` and `~fortyv-tombyt-tabsen-sonres`. To create
22+your pier:
1723
1824 $ bin/urbit -w fintud-macrep -t fortyv-tombyt-tabsen-sonres
1925
20−This will create a directory `fintud-macrep/` and begin building your urbit. Assembling a planet may take a few minutes.
26+This will create a directory `fintud-macrep/` and begin building
27+your urbit. This may take a few minutes.
2128
22−If you do not have a ticket, you can still make a 'comet', a parentless urbit drifting thorugh cyberspace. You can specify any name you like.
29+If you do not have a ticket, you can still make a 'comet', a wild
30+urbit drifting through cyberspace. Pick your own directory name,
31+it doesn't matter:
2332
24− $ bin/urbit -c comet
33+ $ bin/urbit -c mycomet
2534
26−This will create the directory `comet/` and generate a 64-bit identity for your urbit.
35+This will create the directory `mycomet/` and generate a 128-bit identity for your urbit.
2736
2837## Orientation
2938
@@ -50,7 +59,9 @@ Use `^X` (ctrl-x) to change your prompt. Let's join the main Urbit chat channel
5059
5160 ~fitund-macrep:talk() ;join ~doznec/urbit-meta
5261
53−`:talk` is stateful, so your urbit will download a backlog. `/urbit-meta` is the place to ask questions, get help and talk about anything Urbit-related.
62+`:talk` is stateful, so your urbit will download a backlog.
63+`/urbit-meta` is the place to ask questions, get help and talk
64+about anything Urbit-related.
5465
5566### Web — `:tree`
5667
@@ -58,7 +69,11 @@ Urbit is also accessible through the web. Try opening:
5869
5970 http://localhost:8080/
6071
61−in your favorite browser. You'll be prompted to use `+code`. This page was generated by `:tree`, the basic Urbit web interface. You can also access your urbit through `http://fintud-macrep.urbit.org` (where `fintud-macrep` is your planet name).
72+in your favorite browser. You'll be prompted to use `+code`.
73+This page was generated by `:tree`, the basic Urbit web
74+interface. You can also access your urbit through
75+`http://fintud-macrep.urbit.org` (where `fintud-macrep` is your
76+planet name).
6277
6378### Filesystem — `%clay`
6479
@@ -77,10 +92,6 @@ which indicates the command was processed.
7792
7893## Learn more
7994
80−We go into much greater detail about using each of these components in our walkthroughs:
81−
82−<list src="."></list>
83−
84−With your urbit up and running, you know enough to start learning to program:
95+If you're eager to get started programming you're ready to head over to <a href="../../hoon/demo">the Hoon demo</a>.
8596
86−<list src="../hoon/"></list>
97+To learn more about using the system, let's keep going:
docs/using/shell.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23next: true
34sort: 5
45title: Shell (:dojo)
docs/using/web.md+3−2
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23next: true
34sort: 7
45title: Web
@@ -45,7 +46,7 @@ Now modify `/home/web/test.md` to list the children using the `<list/>` JSX:
4546
4647 This is a simple markdown file.
4748
48− <div><list /><div/>
49+ <div><list /></div>
4950
5051To view your file as raw `md`:
5152
@@ -87,7 +88,7 @@ Let's quickly step through the default contents of `web/`:
8788- `lib/js/urb.js` - Base Urbit JS library. Handles AJAX and polling.
8889- `static.md` - Sample static file
8990- `talk/` - Talk compiled JS / CSS
90−- `talk.hoon` - Page body that loads the `dojo` React module.
91+- `talk.hoon` - Page body that loads the `talk` React module.
9192- `tree/` - Tree compiled JS / CSS
9293- `tree.hoon` - Page body that loads the `tree` React module.
9394
docs/using/web/blog.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 1
34title: A simple blog
45next: true
docs/using/web/comments.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 2
34title: Blog comments
45next: true
docs/using/web/static.md+1
@@ -1,4 +1,5 @@
11---
2+navhome: /docs
23sort: 3
34title: A static site
45---
readme.md+11−4
@@ -1,7 +1,14 @@
1−# Urbit docs
1+Urbit docs
2+==========
23
3−These are the urbit docs as they appear on urbit.org.
4+These are the urbit docs as they appear on [urbit.org](urbit.org/docs).
45
5−We're currently in the process of factoring this repo out of the [urbit core](http://github.com/urbit/urbit) (as of 1/28/2015).
6+If you'd like to serve the contents from your Urbit just copy `docs/` and `docs.md` into `web/` inside your urbit.
67
7−This readme will get updated when that process is complete.
8+
9+Contributing
10+============
11+
12+PRs are more than welcome: both corrections and suggestions.
13+
14+We're almost always available on `:talk`, but you can also email [`urbit@urbit.org`](mailto:urbit@urbit.org) or post to [`urbit-dev`](https://groups.google.com/forum/#!forum/urbit-dev) if you have questions.