on master help sign in
Merge remote-tracking branch 'upstream/master'
b67a378Joseph E.S. Cieslik
docs.md+1−1
@@ -15,7 +15,7 @@ architecture description. To install and run Urbit, read forward from the
15[installation guide](using/install).
15[installation guide](using/install).
16
16
17Most programmers start by [learning Hoon](hoon). Some maniacs can skim the
17Most programmers start by [learning Hoon](hoon). Some maniacs can skim the
18−Hoon doc, then go straight to [Arvo systems programming](arvo/system). All
18+Hoon doc, then go straight to [Arvo systems programming](arvo). All
19registered aspies are required to start with [Nock](nock).
19registered aspies are required to start with [Nock](nock).
20
20
21<br/>
21<br/>
docs/hoon/syntax.md+1−1
@@ -153,7 +153,7 @@ with keywords and move to runes; start with runes and stick
153with runes; or start with keywords and stick with keywords.
153with runes; or start with keywords and stick with keywords.
154
154
155Here's the FizzBuzz demo code, in idiomatic rune syntax. Compare
155Here's the FizzBuzz demo code, in idiomatic rune syntax. Compare
156−with the [original](../../demo).
156+with the [original](../demo).
157
157
158```
158```
159 |= end/atom
159 |= end/atom
docs/nock/implementations/groovy.md+85−32
@@ -10,6 +10,7 @@ next: true
10From [Kohányi Róbert](https://github.com/kohanyirobert/gnock/blob/master/gnock.groovy):
10From [Kohányi Róbert](https://github.com/kohanyirobert/gnock/blob/master/gnock.groovy):
11
11
12```
12```
13+@Memoized
13def i(def a) {
14def i(def a) {
14 a.class in [
15 a.class in [
15 byte, Byte,
16 byte, Byte,
@@ -21,28 +22,40 @@ def i(def a) {
21 ] && a >= 0
22 ] && a >= 0
22}
23}
23
24
25+@Memoized
24def n(def a) {
26def n(def a) {
27+ def r
28+ n(a, { r = it })
29+ r
30+}
31+
32+@TailRecursive
33+def n(def a, def r) {
25 if (a in List) {
34 if (a in List) {
26 if (a.size() == 1) {
35 if (a.size() == 1) {
27− n(a[0])
36+ r(a[0])
28− } else if (a.size() == 2) {
37+ } else if (a.size() >= 2) {
29− [n(a[0]), n(a[1])]
38+ n(a[0], { t ->
30− } else if (a.size() > 2) {
31− [n(a[0]), n(a.tail())]
39+ n(a.size() == 2 ? a[1] : a.tail(), { h ->
40+ r([t, h])
41+ })
42+ })
32 } else {
43 } else {
33 throw new IllegalStateException()
44 throw new IllegalStateException()
34 }
45 }
35 } else if (i(a)) {
46 } else if (i(a)) {
36− (BigInteger) a
47+ r((BigInteger) a)
37 } else {
48 } else {
38 throw new IllegalStateException()
49 throw new IllegalStateException()
39 }
50 }
40}
51}
41
52
53+@Memoized
42def wut(def a) {
54def wut(def a) {
43 i(a) ? 1 : 0
55 i(a) ? 1 : 0
44}
56}
45
57
58+@Memoized
46def lus(def a) {
59def lus(def a) {
47 if (wut(a) == 0) {
60 if (wut(a) == 0) {
48 throw new IllegalStateException()
61 throw new IllegalStateException()
@@ -50,6 +63,7 @@ def lus(def a) {
50 1 + a
63 1 + a
51}
64}
52
65
66+@Memoized
53def tis(def a) {
67def tis(def a) {
54 if (wut(a) == 1) {
68 if (wut(a) == 1) {
55 throw new IllegalStateException()
69 throw new IllegalStateException()
@@ -57,7 +71,15 @@ def tis(def a) {
57 a[0] == a[1] ? 0 : 1
71 a[0] == a[1] ? 0 : 1
58}
72}
59
73
74+@Memoized
60def fas(def a) {
75def fas(def a) {
76+ def r
77+ fas(a, { r = it })
78+ r
79+}
80+
81+@TailRecursive
82+def fas(def a, def r) {
61 if (wut(a) == 1) {
83 if (wut(a) == 1) {
62 throw new IllegalStateException()
84 throw new IllegalStateException()
63 }
85 }
@@ -69,27 +91,34 @@ def fas(def a) {
69 if (h == 0) {
91 if (h == 0) {
70 throw new IllegalStateException()
92 throw new IllegalStateException()
71 } else if (h == 1) {
93 } else if (h == 1) {
72− t
94+ r(t)
73 } else {
95 } else {
74 if (i(t)) {
96 if (i(t)) {
75 throw new IllegalStateException()
97 throw new IllegalStateException()
76 }
98 }
77 if (h == 2) {
99 if (h == 2) {
78− t[0]
100+ r(t[0])
79 } else if (h == 3) {
101 } else if (h == 3) {
80− t[1]
102+ r(t[1])
81 } else {
103 } else {
82− def x = h.intdiv(2)
104+ fas([h.intdiv(2), t], { p ->
83− if (h.mod(2) == 0) {
105+ fas([2 + h.mod(2), p], { q ->
84− fas([2, fas([x, t])])
106+ r(q)
85− } else {
107+ })
86− fas([3, fas([x, t])])
87− }
108+ })
88 }
109 }
89 }
110 }
90}
111}
91
112
113+@Memoized
92def tar(def a) {
114def tar(def a) {
115+ def r
116+ tar(a, { r = it})
117+ r
118+}
119+
120+@TailRecursive
121+def tar(def a, def r) {
93 if (wut(a) == 1) {
122 if (wut(a) == 1) {
94 throw new IllegalStateException()
123 throw new IllegalStateException()
95 }
124 }
@@ -101,18 +130,28 @@ def tar(def a) {
101 def o = f[0]
130 def o = f[0]
102 def v = f[1]
131 def v = f[1]
103 if (wut(o) == 0) {
132 if (wut(o) == 0) {
104− [tar([s, o]), tar([s, v])]
133+ tar([s, o], { p ->
134+ tar([s, v], { q ->
135+ r([p, q])
136+ })
137+ })
105 } else {
138 } else {
106 if (o == 0) {
139 if (o == 0) {
107− fas([v, s])
140+ r(fas([v, s]))
108 } else if (o == 1) {
141 } else if (o == 1) {
109− v
142+ r(v)
110 } else if (o == 3) {
143 } else if (o == 3) {
111− wut(tar([s, v]))
144+ tar([s, v], {
145+ r(wut(it))
146+ })
112 } else if (o == 4) {
147 } else if (o == 4) {
113− lus(tar([s, v]))
148+ tar([s, v], {
149+ r(lus(it))
150+ })
114 } else if (o == 5) {
151 } else if (o == 5) {
115− tis(tar([s, v]))
152+ tar([s, v], {
153+ r(tis(it))
154+ })
116 } else {
155 } else {
117 if (wut(v) == 1) {
156 if (wut(v) == 1) {
118 throw new IllegalStateException()
157 throw new IllegalStateException()
@@ -120,29 +159,43 @@ def tar(def a) {
120 def x = v[0]
159 def x = v[0]
121 def y = v[1]
160 def y = v[1]
122 if (o == 2) {
161 if (o == 2) {
123− tar([tar([s, x]), tar([s, y])])
162+ tar([s, x], { p ->
163+ tar([s, y], { q ->
164+ tar([p, q], {
165+ r(it)
166+ })
167+ })
168+ })
124 } else if (o == 7) {
169 } else if (o == 7) {
125− tar(n([s, 2, x, 1, y]))
170+ tar(n([s, 2, x, 1, y]), {
171+ r(it)
172+ })
126 } else if (o == 8) {
173 } else if (o == 8) {
127− tar(n([s, 7, [[7, [0, 1], x], 0, 1], y]))
174+ tar(n([s, 7, [[7, [0, 1], x], 0, 1], y]), {
175+ r(it)
176+ })
128 } else if (o == 9) {
177 } else if (o == 9) {
129− tar(n([s, 7, y, 2, [0, 1], 0, x]))
178+ tar(n([s, 7, y, 2, [0, 1], 0, x]), {
179+ r(it)
180+ })
130 } else if (o == 10) {
181 } else if (o == 10) {
131 if (wut(x) == 1) {
182 if (wut(x) == 1) {
132− tar([s, y])
183+ tar([s, y], {
184+ r(it)
185+ })
133 } else {
186 } else {
134− def r = x[0]
135− def t = x[1]
136− tar(n([s, 8, t, 7, [0, 3], y]))
187+ tar(n([s, 8, x[1], 7, [0, 3], y]), {
188+ r(it)
189+ })
137 }
190 }
138 } else {
191 } else {
139 if (wut(y) == 1) {
192 if (wut(y) == 1) {
140 throw new IllegalStateException()
193 throw new IllegalStateException()
141 }
194 }
142− def p = y[0]
143− def q = y[1]
144 if (o == 6) {
195 if (o == 6) {
145− tar(n([s, 2, [0, 1], 2, [1, p, q], [1, 0], 2, [1, 2, 3], [1, 0], 4, 4, x]))
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+ })
146 } else {
199 } else {
147 throw new IllegalStateException()
200 throw new IllegalStateException()
148 }
201 }
docs/nock/implementations/hoon.md+1−1
@@ -1,7 +1,7 @@
1---
1---
2navhome: /docs
2navhome: /docs
3title: Hoon
3title: Hoon
4−sort: 8
4+sort: 10
5---
5---
6
6
7# Hoon
7# 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/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/user/install.mddeleted−119
@@ -1,119 +0,0 @@
1−---
2−next: true
3−sort: 2
4−title: Install
5−---
6−
7−# Installation guide
8−
9−Urbit can be installed on most Unix systems. There is no Windows
10−port. Windows is a wonderful OS, we just haven't gotten to it yet.
11−Use a VM.
12−
13−## Configure the OS
14−
15−Urbit wants to map 2GB of memory when it boots up. We won't
16−necessarily use all this memory, we just want to see it. On a
17−normal modern PC or Mac, this is not an issue. On some small
18−cloud virtual machines (Amazon or Digital Ocean), the default
19−memory configuration is smaller than this, and you need to
20−manually configure a swapfile.
21−
22−To add swap to a DO droplet:
23−
24−https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04
25−
26−To add swap on an Amazon instance:
27−
28−http://stackoverflow.com/questions/17173972/how-do-you-add-swap-to-an-ec2-instance
29−
30−To add swap on a BSD instance:
31−
32− https://www.freebsd.org/doc/handbook/adding-swap-space.htm
33−
34−Don't spend a lot of time tweaking these settings; the simplest
35−thing is fine.
36−
37−## Install as a package
38−
39−### OS X - Homebrew
40−
41− brew install --HEAD homebrew/head-only/urbit
42−
43−### Ubuntu or Debian
44−
45−Third-party packages are available, at:
46−
47− https://github.com/yebyen/urbit-deb
48−
49−Urbit is only supported on Jessie onward (but outbound HTTPS
50−requests only work on Stretch; I wish we knew why; help us!)
51−
52−## Hand-build from source
53−
54−First, install all external dependencies. Then, make.
55−
56−### Dependencies
57−
58−urbit depends on:
59−
60− gcc (or clang)
61− gmp
62− libsigsegv
63− openssl
64− automake
65− autoconf
66− ragel
67− cmake
68− re2c
69− libtool
70− libssl-dev (Linux only)
71− ncurses (Linux only)
72−
73−#### Ubuntu or Debian
74−
75− sudo apt-get install libgmp3-dev libsigsegv-dev openssl libssl-dev libncurses5-dev git make exuberant-ctags automake autoconf libtool g++ ragel cmake re2c
76−
77−#### Fedora
78−
79− sudo dnf install gcc gcc-c++ git gmp-devel openssl-devel openssl ncurses-devel libsigsegv-devel ctags automake autoconf libtool ragel cmake re2c
80−
81−#### AWS
82−
83− sudo yum --enablerepo epel install gcc gcc-c++ git gmp-devel openssl-devel ncurses-devel libsigsegv-devel ctags automake autoconf libtool cmake re2c
84−
85−#### OS X - Homebrew
86−
87− brew install git gmp libsigsegv openssl libtool autoconf automake cmake
88−
89−#### OS X - Macports
90−
91− sudo port install git gmp libsigsegv openssl autoconf automake cmake
92−
93−Although `automake`/`autoconf`/`libtool` are generally installed by
94−default, some have reported needing to uninstall and reinstall those
95−three packages, at least with Homebrew. Your mileage may vary.
96−
97−#### FreeBSD
98−
99− pkg install git gmake gmp libsigsegv curl python automake autoconf ragel cmake re2c libtool
100−
101−#### Archlinux
102−
103− pacman -S gcc gmp libsigsegv openssl automake autoconf ragel cmake re2c libtool ncurses
104−
105−### Download and make
106−
107−Clone the repo:
108−
109− git clone git://github.com/urbit/urbit.git
110−
111−`cd` to the directory you just created:
112−
113− cd urbit
114−
115−Run `make`:
116−
117− make
118−
119−(On FreeBSD, use `gmake` instead.)
docs/using/install.md+2−2
@@ -48,7 +48,7 @@ Which can usually be installed with the following one-liners:
48 sudo dnf install gcc gcc-c++ git gmp-devel openssl-devel openssl ncurses-devel libsigsegv-devel ctags automake autoconf libtool ragel cmake re2c
48 sudo dnf install gcc gcc-c++ git gmp-devel openssl-devel openssl ncurses-devel libsigsegv-devel ctags automake autoconf libtool ragel cmake re2c
49
49
50 # FreeBSD
50 # 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
52
52
53 # Arch
53 # Arch
54 pacman -S gcc gmp libsigsegv openssl automake autoconf ragel cmake re2c libtool ncurses
54 pacman -S gcc gmp libsigsegv openssl automake autoconf ragel cmake re2c libtool ncurses
@@ -77,6 +77,6 @@ Once your dependencies are installed the rest is easy:
77 git clone https://github.com/urbit/urbit
77 git clone https://github.com/urbit/urbit
78 cd urbit
78 cd urbit
79 make
79 make
80− curl -o urbit.pill http://bootstrap.urbit.org/latest.pill
80+ curl -o urbit.pill https://bootstrap.urbit.org/latest.pill
81
81
82After running `make`, your Urbit executable lives at `bin/urbit`. The `.pill` file is a compiled binary of Arvo that Urbit uses to bootstrap itself.
82After running `make`, your Urbit executable lives at `bin/urbit`. The `.pill` file is a compiled binary of Arvo that Urbit uses to bootstrap itself.
docs/using/setup.md+1−1
@@ -29,7 +29,7 @@ Without a planet anyone can create a comet:
29
29
30 bin/urbit -c comet
30 bin/urbit -c comet
31
31
32−This will create a directory `comet/` and start up a random 64-bit comet. You can specify any name you like.
32+This will create a directory `comet/` and start up a random 128-bit comet. You can specify any name you like.
33
33
34## Orientation
34## Orientation
35
35