From 3a1ef5e648ee32aae2a9152609eb40d1da20154d Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Thu, 7 Aug 2014 15:02:31 -0700 Subject: [PATCH 01/34] Remove "community" link. --- main/pub/src/site/res/sidebar.html | 3 --- 1 file changed, 3 deletions(-) diff --git a/main/pub/src/site/res/sidebar.html b/main/pub/src/site/res/sidebar.html index c303a645e6..7c73f09ebd 100644 --- a/main/pub/src/site/res/sidebar.html +++ b/main/pub/src/site/res/sidebar.html @@ -10,9 +10,6 @@ - From 1079fcf76c6fdadef6541bb66aef1d6a3680db14 Mon Sep 17 00:00:00 2001 From: ault011 Date: Fri, 8 Aug 2014 14:34:49 -0700 Subject: [PATCH 02/34] more markdown updates --- main/pub/src/doc/ref/vol2.md | 586 ++++++++++++++++++----------------- 1 file changed, 304 insertions(+), 282 deletions(-) diff --git a/main/pub/src/doc/ref/vol2.md b/main/pub/src/doc/ref/vol2.md index 26124b862a..efbec53f91 100644 --- a/main/pub/src/doc/ref/vol2.md +++ b/main/pub/src/doc/ref/vol2.md @@ -966,14 +966,14 @@ list of the elements of 'a' sorted according to 'b'. ##++swag - A range in a list - Produces the values in list 'c' starting at index 'a' and spanning 'b' elements - more than that. +A range in a list - Produces the values in list 'c' starting at index 'a' and spanning 'b' elements +more than that. ####Summary - Build wet %gold gate with cell sample that accepts a cell of atoms, `a` and `b`, and a list `c`. - The last `a` elements in `c` are slammed to slag. - Scag is slammed with the atom `b`and the list just produced by slag. +Build wet %gold gate with cell sample that accepts a cell of atoms, `a` and `b`, and a list `c`. +The last `a` elements in `c` are slammed to slag. +Scag is slammed with the atom `b`and the list just produced by slag. ####Examples: @@ -988,16 +988,16 @@ list of the elements of 'a' sorted according to 'b'. ##++turn - Accepts a list and a gate. Produces the list with the gate applied to each element of the original list. +Accepts a list `a` and a gate `b`. Produces the list with the gate applied to each element of the original list. ####Summary Activate jet. - Build wet %gold gate that accepts a list and a gate. - Creates and kicks a dry %gold trap. - Builds an if-then-else statement on "a is an atom." - If so, produce null. - Else, produce the tuple with head (b i.a) and tail that is turn applied recursively to the tail of 'a'. + Build wet %gold gate with samples of list `a` and gate `b`. + Kicks a dry %gold trap. + If: `a` is an atom, + Then: produce null. + Else: produce the tuple with head (b i.a) and the toss of `a` for `t.a`. ####Examples @@ -1014,61 +1014,70 @@ list of the elements of 'a' sorted according to 'b'. Build wet %gold gate that accepts two lists, `a` and `b`. Homogenizes both lists and makes them the subject of the following code. Kick dry %gold trap. - Cast the resulting list to the type of list `b`. - on "a is null." If so, produce 'b'. - Else, produce the tuple [i.a $(a t.a)]. 'i.a' is the head of 'a', $(a t.a) the recursive call of weld - with 'a' replaced by the tail of a. - Examples: + Cast the resulting list to the type of list `b`. + If: a is null, + Then: produce `b`. + Else: produce the tuple where `i.a` is the head, and the toss of `a` for `i.a` is the tail. + +####Examples: + ~palryp-hocsyt/try=> (weld (limo [1 2 3 ~]) (limo [4 5 6 ~])) ~[1 2 3 4 5 6] ~palryp-hocsyt/try=> (weld "foo" "bar") ~[~~f ~~o ~~o ~~b ~~a ~~r] -++ welp - perfect weld - Description: - Concatenates two lists without losing their type information to homogenization. - Produces a tape when passed two tapes. - --- - XXX DON'T WORRY ABOUT HOW THIS WORKS, IT IS A PERPETUAL MIYSTERY TO US ALL. XXX - Examples: + +##++welp + +Concatenates two lists without losing their type information to homogenization. +Produces a tape when passed two tapes. + +####Summary + Identical to the internals of `++weld`, except it does not implement the list homogenization. + +####Examples: + ~palryp-hocsyt/try=> (welp "foo" "bar") "foobar" -++ wild - concatenate - Description: - Concatenates two lists without casting the product back to a list. - --- - Creates a wet %gold gate with a sample which accepts two lists. - Homogenizes both lists and makes them the subject of the following code. - A dry %gold gate is created and kicked. - Builds an if-then-else statement on "a is null." If so, produce 'b'. - Else, produce the tuple with head (b i.a) and tail that is turn applied recursively to the tail of 'a'. - Examples: + +##++wild + +Concatenates two lists without casting the product back to a list. + + Build wet %gold gate with two list sample, labeled `a`, `b`, respectively. + Homogenize both lists and make them the subject of the following code. + Build dry %gold gate. + If `a` is null, + Then: produce `b`. + Else: produce the tuple where `i.a` is the head, and the toss of `a` for `i.a` is the tail. + +####Examples: + ~palryp-hocsyt/try=> =norm (limo [1 2 3 4 5 ~]) ~palryp-hocsyt/try=> =norm2 (limo [6 7 8 ~]) ~palryp-hocsyt/try=> (wild norm norm2) ~[1 2 3 4 5 6 7 8] - --- ~palryp-hocsyt/try=> (wild "foo" "bar") ~[~~f ~~o ~~o ~~b ~~a ~~r] - --- ~palryp-hocsyt/try=> (homo (weld "foo" "bar")) ~[~~f ~~o ~~o ~~b ~~a ~~r] ~palryp-hocsyt/try=> (homo (wild "foo" "bar")) ! -find-limb.t ! find-fork ! exit -++ zing - promote - Description: - Turns a list of lists into a single list by promoting the elements of each sublist into the higher. - --- +##++zing + +Turns a list of lists into a single list by promoting the elements of each sublist into the higher. + +####Summary + Creates a wet %gold gate with a sample that accepts a list of lists. Casts the result to the type the homogenized list head, asserting that 'a' is at least a cell. A dry %gold trap is created and kicked. Builds an if-then-else statement on "a is null." If so, produce null. Else, weld together the head of a with the recrusive call of zing on the tail of a. - Examples: + +####Examples: + ~palryp-hocsyt/try=> (zing (limo [(limo ['a' 'b' 'c' ~]) (limo ['e' 'f' 'g' ~]) (limo ['h' 'i' 'j' ~]) ~])) ~['a' 'b' 'c' 'e' 'f' 'g' 'h' 'i' 'j'] ~palryp-hocsyt/try=> (zing (limo [(limo [1 'a' 2 'b' ~]) (limo [3 'c' 4 'd' ~]) ~])) @@ -1099,74 +1108,74 @@ Produces 2 to the nth power for some atom `n`. 1.048.576 ~palryp-hocsyt/try=> (bex 0) 1 -++ xeb - binary logarithm +##++xeb + +Takes the base-2 logarithm of an atom. - Takes the base-2 logarithm of an atom. - --- - Creates a dry %gold gate with a sample which accepts an atom. + Build dry %gold gate with sample atom `a` Casts the result to an atom. - Evaluates the logarithm by counting the number of bits the number in question occupies. - Examples: + Evaluates the logarithm by using `++met` to count the number of bits the number in question occupies. + +####Examples: + ~palryp-hocsyt/try=> (xeb 31) 5 - -- ~palryp-hocsyt/try=> (xeb 32) 6 - -- ~palryp-hocsyt/try=> (xeb 49) 6 - -- ~palryp-hocsyt/try=> (xeb 0) 0 - -- ~palryp-hocsyt/try=> (xeb 1) 1 - -- ~palryp-hocsyt/try=> (xeb 2) 2 -++ can - assemble - Description: - Assembles a - --- + +##++can + +Assembles a + +####Summary + Activate jet. - Creates a dry %gold gate with a sample which accepts a bloq size (an atom) and - a list of atomic tuples. - Casts the result to an atom. - Builds an if-then-else statement on "b is null." - If so, produce 0. - Else, - Examples: + Build dry %gold gate with a sample with bloq (atom) size `a`, and a list of cells of two atoms, `b`. + Yield an atom. + If: `b` is null. + Then: produce 0. + Else: call `++mix` with both the product of `++end` slammed with `a`, `p.i.b`, and + `q.i.b`, and the product of `++lsh` slammed with `a`, `p.i.b`, and the toss of + `b` for `t.b`. + +####Examples: + ~ronrem-lonsem/try=> `@ub`(can 3 ~[[1 1]]) 0b1 - --- ~ronrem-lonsem/try=> `@ub`(can 0 ~[[1 255]]) 0b1 - --- ~ronrem-lonsem/try=> `@ub`(can 1 ~[[1 2]]) 0b10 - --- ~ronrem-lonsem/try=> `@ub`(can 1 ~[[1 3]]) 0b11 - --- ~ronrem-lonsem/try=> `@ub`(can 1 ~[[1 4]]) 0b0 - --- ~ronrem-lonsem/try=> `@ub`(can 1 ~[[2 4]]) 0b100 -++ cat - concatenate - Description: - Concatenates two atoms, obeying the given block size. - --- + +##++cat + +Concatenates two atoms, obeying the given block size. + +####Summary + Activate jet. - Creates a dry %gold gate with a sample which accepts a bloq size (an atom) and - two atoms. - Measures the number of blocks of size 'a' are in 'b'. - Left shifts 'c' that many times the bock size of 'a'. - Sums the result of the left shift with 'b'. - Examples: + Build dry %gold gate with sample which accepts a bloq (atom) size `a` and + two atoms, `b` and `c`. + Use `++met` to measure the number of blocks of size `a` in `b`. + Left shift `c` by the number of blocks measured above, using block size `a`. + Sums the result of the left shift above with `b`. + +####Examples: + ~ronrem-lonsem/try=> `@ub`(cat 1 1 0) 0b1 ~ronrem-lonsem/try=> `@ub`(cat 2 1 0) @@ -1189,17 +1198,21 @@ Produces 2 to the nth power for some atom `n`. 0b1111.1111.0001.0000.0000 ~ronrem-lonsem/try=> (cat 3 256 255) 16.711.936 -++ cut - slice - Description: - Accepts a block size 'a', a cell of two atoms 'b' and 'c' and another atom 'd'. - Produces the tail of 'd' that is 'c' blocks long after right-shifting 'd' 'b'-blocks. - --- +##++cut + +Accepts a block size 'a', a cell of two atoms 'b' and 'c' and another atom 'd'. +Produces the tail of 'd' that is 'c' blocks long after right-shifting 'd' 'b'-blocks. + +####Summary + Activate jet. - Creates a dry %gold gate with a sample which accepts a block size (an atom), - a cell of two atoms, and another atom which will be "cut." - Right-shifts 'd' by 'b' blocks. Then produces the 'c' block long tail of this right-shift. - Examples: + Build dry %gold gate with sample that accepts a block (atom) size `a`, + a cell of two atoms, `b` and `c`, and an atom `d`. + Right-shifts `d` by `b` blocks. + Slams `++end` with `a`, `c`, and the result of the right-shift above. + +####Examples: + ~ronrem-lonsem/try=> (cut 0 [1 1] 2) 1 ~ronrem-lonsem/try=> (cut 0 [2 1] 4) @@ -1212,99 +1225,113 @@ Produces 2 to the nth power for some atom `n`. 3 ~ronrem-lonsem/try=> (cut 1 [1 2] 255) 15 -++ end - tail - Description: - Accepts a block 'a' and two atoms, 'b' and 'c'. - Produces the 'b' blocks of length 'a' on the end of 'c'. - --- + +##++end + + ++end takes a bloq `a`, and atoms `c` and `d`. It returns the tail of `c`, whose l ength is determined by the number of bloqs `b`, of size `a` + +####Summary + + Build dry %gold gate that accepts a block `a`, and two atoms, `b` and `c`. + Produces the `b` blocks of length `a` on the end of `c`. Activate jet. - Creates a dry %gold gate with a sample which accepts a block (an atom) and - two atoms. - Multiplies the binary exponent of 'a' (2^a) with 'b', then takes the binary exponent + Build dry %gold gate with sample that accepts a block (an atom) `a` and + two atoms, `b` and `c`. + Multiplies the binary exponent of `a` (2^a) with `b`, then takes the binary exponent of that (2^((2^a)*b)) to finally produce the modulus of 'c' and the ensuing product. - Examples: + +####Examples: + ~ronrem-lonsem/try=> `@ub`12 0b1100 - --- ~ronrem-lonsem/try=> `@ub`(end 0 3 12) 0b100 - --- ~ronrem-lonsem/try=> (end 0 3 12) 4 - --- ~ronrem-lonsem/try=> `@ub`(end 1 3 12) 0b1100 - --- ~ronrem-lonsem/try=> (end 1 3 12) 12 - --- ~ronrem-lonsem/try=> (end 3 1 256) 0 - --- ~ronrem-lonsem/try=> (end 3 1 255) 255 ++ fil - fill bloqstream - Description: - --- - Creates a dry %gold gate with a sample which accepts a block size (an atom) and - two other atoms. - Let 'n' be 0. - Let 'd' be 'c'. - Creates and kicks a dry %gold trap whose result is cast to a atom. - Builds an if-then-else statement on n=b. - If so, produce the right-shift of 'd' by one block. - Else, recursively call the trap with 'd' replaced by the sum of 'c' and the one block - left-shift of 'b', n replaced by the increment of n. - Examples: +fill bloqstream + +####Summary -++ lsh - left shift - Description: - Accepts a block size 'a' and two atoms 'b' and 'c'. Produces 'c' left-shifted - 'b' times by the block size. - --- + Creates a dry %gold gate with a sample which accepts a block (atom) size `a a nd two other atoms, `b` and `c`. + Push `n` is 0. + Push `d` is `c`. + Kick a dry %gold trap. + Yield an atom. + If: n=b. + Then: produce the right-shift of 'd' by one block. + Else: recursively call the trap with `d` replaced by the sum of `c` and the one block + left-shift of `b`, `n` replaced by the increment of `n`. + +####Examples: + + ~sivtyv-barnel/try=> `@t`(end 3 2 %abc) + 'ab' + ~sivtyv-barnel/try=> `@t`(fil 3 5 %a) + 'aaaaa' + ~sivtyv-barnel/try=> `@t`(fil 5 10 %babe) + 'babebabebabebabebabebabebabebabebabebabe' + ~sivtyv-barnel/try=> `@tas`(fil 5 10 %babe) + %babebabebabebabebabebabebabebabebabebabe + ~sivtyv-barnel/try=> `@tas`(fil 4 10 %babe) + %ĆĆĆĆĆĆĆĆĆĆbe + ~sivtyv-barnel/try=> `@tas`(fil 4 10 %bf) + %bfbfbfbfbfbfbfbfbfbf + +##++lsh + +Accepts a block size `a` and two atoms `b` and `c`. Produces `c` left-shifted +`b` times by the block size. + +####Summary + Activate jet. - Creates a dry %gold gate with a sample which accepts a block (an atom) and - two atoms. - Multiplies 'c' times the binary exponent of the binary exponent of 'a' times 'b', - that is ((2^((2^a)*b))*c), this producing the desired left-shift on 'c'. - Examples: + Build dry %gold gate with a sample that accepts a block (atom) size and + two atoms, `b` and `c`. + Multiplies `c` times the binary exponent of the binary exponent of `a` times `b` this producing the desired left-shift on 'c'. + +####Examples: + ~ronrem-lonsem/try=> `@ub`1 0b1 - --- ~ronrem-lonsem/try=> `@ub`(lsh 0 1 1) 0b10 - --- ~ronrem-lonsem/try=> (lsh 0 1 1) 2 - --- ~ronrem-lonsem/try=> `@ub`255 0b1111.1111 - --- ~ronrem-lonsem/try=> `@ub`(lsh 3 1 255) 0b1111.1111.0000.0000 - --- ~ronrem-lonsem/try=> (lsh 3 1 255) 65.280 -++ met - measure - Description: - Measures the number of blocks of size 'a' are in 'b'. - --- + +##++met + +Measures the number of blocks of size `a` in `b`. + +####Summary + Activate jet. - Creates a dry %gold gate with a sample which accepts a block size (an atom) and - an atom. + Build dry %gold gate with sample that accepts a block (atom) size `a` and + an atom `b`. Casts the result to an atom. Let 'c' be 0. Creates and kicks a dry %gold trap. - Builds an if-then-else statement on b=0. - If so, produce c. - Else, recursively call the trap, with - 'b' replaced by the single-block right-shift of 'b' and 'c' by the increment of 'c'. - Examples: + If: b=0, + Then: produce c. + Else: toss `b` replaced by the single-block right-shift of `b` and `c` by the increment of `c`. + +####Examples: + ~ronrem-lonsem/try=> (met 0 1) 1 ~ronrem-lonsem/try=> (met 0 2) @@ -1313,16 +1340,21 @@ Produces 2 to the nth power for some atom `n`. 1 ~ronrem-lonsem/try=> (met 3 256) 2 -++ rap - Concatenate a list of atoms while obeying a given blocksize. - --- +##++rap + +Concatenate a list of atoms while obeying a given blocksize. + +####Summary + Activate jet. Build a dry %gold gate with sample bloq `a`, list of atoms `b` Yield atom If: `b` is null, Then: Produce 0. Else: Produce cat slammed with `a`, the head of `b`, and the toss of `b` for the tail of `b` - --- + +####Examples: + ~palryp-hocsyt/try=> (rap 2 (limo [1 2 3 4 ~])) 17.185 ~palryp-hocsyt/try=> (rap 1 (limo [1 2 3 4 ~])) @@ -1331,10 +1363,9 @@ Produces 2 to the nth power for some atom `n`. 0 ~palryp-hocsyt/try=> (rap 0 (limo [0 0 1 ~])) 1 -++ rep - Assembles - --- +##++rep + Activate jet. Creates a dry %gold gate with a sample which accepts a block size (an atom) and a list of atoms. @@ -1347,33 +1378,32 @@ Produces 2 to the nth power for some atom `n`. of the head of 'b' and the recursive call of the trap with: 'c' replaced by the increment of 'c'. 'b' replaced by the tail of 'b'. - Examples: + +####Examples: + ~palryp-hocsyt/try=> (rep 0 (limo [1 2 3 4 ~])) 5 - --- ~palryp-hocsyt/try=> (rep 1 (limo [1 2 3 4 ~])) 57 - --- ~palryp-hocsyt/try=> (rep 0 (limo [1 0 0 ~])) 1 - --- ~palryp-hocsyt/try=> (rep 0 (limo [1 0 0 0 ~])) 1 - --- ~palryp-hocsyt/try=> (rep 0 (limo [0 1 0 0 ~])) 2 - --- ~palryp-hocsyt/try=> (rep 0 (limo [0 1 0 1 ~])) 10 - --- ~palryp-hocsyt/try=> (rep 0 (limo [0 1 0 1 0 1 ~])) 42 -++ rip - disassemble - Description: - Produces a list of the bits of an atom, in little endian order, according to - block size. - --- + +##++rip + +Produces a list of the bits of an atom, in little endian order, according to +block size. + + +####Summary + Activate jet. Creates a dry %gold gate with a sample which accepts a block size (an atom) and any number. @@ -1383,111 +1413,99 @@ Produces 2 to the nth power for some atom `n`. Else, produce a tuple with head of (end a 1 b), the single-block tail of 'b', and the resursive call of rip with 'b' replaced by the single-block right-shift of 'b'. in little endian. - Examples: + +####Examples: + palryp-hocsyt/try=> `@ub`155 0b1001.1011 - --- ~palryp-hocsyt/try=> (rip 0 155) ~[1 1 0 1 1 0 0 1] - --- ~palryp-hocsyt/try=> (rip 2 155) ~[11 9] - --- ~palryp-hocsyt/try=> (rip 1 155) ~[3 2 1 2] - --- ~palryp-hocsyt/try=> `@ub`256 0b1.0000.0000 - --- ~palryp-hocsyt/try=> (rip 0 256) ~[0 0 0 0 0 0 0 0 1] - --- ~palryp-hocsyt/try=> (rip 2 256) ~[0 0 1] - --- ~palryp-hocsyt/try=> (rip 3 256) ~[0 1] -++ rsh - right shift - Description: +##++rsh Accepts a block size 'a' and two atoms, 'b' and 'c'. Right-shifts 'c' by 'b' blocks of size 'a'. - --- + +####Summary + Activate jet. Creates a dry %gold gate with a sample which accepts a block size (an atom) and two atoms. Takes the binary exponent of the binary exponent of 'a' multiplied by 'b', that is (2^(((2^a)*b))) and divides 'c' by it, producing the desired right-shift on 'c'. - Examples: + +####Examples: + ~ronrem-lonsem/try=> `@ub`145 0b1001.0001 - --- ~ronrem-lonsem/try=> `@ub`(rsh 1 1 145) 0b10.0100 - --- ~ronrem-lonsem/try=> (rsh 1 1 145) 36 - --- ~ronrem-lonsem/try=> `@ub`(rsh 2 1 145) 0b1001 - --- ~ronrem-lonsem/try=> (rsh 2 1 145) 9 - --- ~ronrem-lonsem/try=> `@ub`10 0b1010 - --- ~ronrem-lonsem/try=> `@ub`(rsh 0 1 10) 0b101 - --- ~ronrem-lonsem/try=> (rsh 0 1 10) 5 - --- ~ronrem-lonsem/try=> `@ub`1 0b1 - --- ~ronrem-lonsem/try=> (rsh 0 1 1) 0 - --- ~ronrem-lonsem/try=> (rsh 0 1 1) 0 -++ swap - reverse bloq order - Description: - Produces the reversed block order of a number, obeying block number. - Switches little ending to big and vice versa. - --- + +##++swap + +Produces the reversed block order of a number, obeying block number. +Switches little ending to big and vice versa. + +####Summary + Creates a dry %gold gate with a sample which accepts a block size (an atom) and an atom. Rips apart the atom by the block size, then reverses the tape that is produced. Once it is reversed, it is re-assembled using rep. - Examples: + +####Examples: + ~palryp-hocsyt/try=> `@ub`24 0b1.1000 - --- ~palryp-hocsyt/try=> (swap 0 24) 3 - --- ~palryp-hocsyt/try=> `@ub`3 0b11 - --- ~palryp-hocsyt/try=> (swap 0 0) 0 - --- ~palryp-hocsyt/try=> (swap 1 24) 9 - --- ~palryp-hocsyt/try=> (swap 0 128) 1 + section 2cB, bit logic -++ con - binary or - Description: - Produces the bit-wise logical OR of two atoms. - --- +##++con + +Produces the bit-wise logical OR of two atoms. + +####Summary + Activate jet. Creates a dry %gold gate with a sample which accepts two atoms. Let 'c' be 0, d be 0. @@ -1501,26 +1519,26 @@ section 2cB, bit logic 'd' replaced by the sum of 'd' and the 'c' 0-block left-shift of the logical AND of (last bit of 'a')=0 AND (last bit of 'b')=0. (==) terminates the list of changes. - Examples: + +####Examples: + ~palryp-hocsyt/try=> (con 0 1) 1 - --- ~palryp-hocsyt/try=> (con 1 0) 1 - --- ~palryp-hocsyt/try=> (con 0 0) 0 - --- ~palryp-hocsyt/try=> (con 4 4) 4 - --- ~palryp-hocsyt/try=> (con 10.000 234) 10.234 -++ dis - binary and - Description: - Produces the bit-wise logical AND of two atoms. - --- + +##++dis + +Produces the bit-wise logical AND of two atoms. + +####Summary + Activate jet. Creates a dry %gold gate with a sample which accepts two atoms. Pushes the bunt of a two atom tuple onto the subject. @@ -1534,35 +1552,32 @@ section 2cB, bit logic 'd' replaced by the sum of 'd' and the 'c' 0-block left-shift of the logical OR of (last bit of 'a')=0 OR (last bit of 'b')=0. (==) terminates the list of changes. - Examples: + +####Examples: + ~ronrem-lonsem/try=> `@ub`9 0b1001 - --- ~ronrem-lonsem/try=> `@ub`5 0b101 - --- ~ronrem-lonsem/try=> `@ub`(dis 9 5) 0b1 - --- ~ronrem-lonsem/try=> (dis 9 5) 1 - --- ~ronrem-lonsem/try=> `@ub`534 0b10.0001.0110 - --- ~ronrem-lonsem/try=> `@ub`987 0b11.1101.1011 - --- ~ronrem-lonsem/try=> `@ub`(dis 534 987) 0b10.0001.0010 - --- ~ronrem-lonsem/try=> (dis 534 987) 530 -++ mix - binary xor - Description: - Produces the bit-wise logical exclusive OR of two atoms. - --- + +##++mix + +Produces the bit-wise logical exclusive OR of two atoms. + +####Summary + Activate jet. Creates a dry %gold gate with a sample which accepts two atoms. Casts the result to an atom. @@ -1576,7 +1591,9 @@ section 2cB, bit logic 'c' replaced by the increment of 'c'. 'd' replaced by (==) terminates the list of changes. - Examples: + +####Examples: + ~ronrem-lonsem/try=> `@ub`2 0b10 ~ronrem-lonsem/try=> `@ub`3 @@ -1589,40 +1606,39 @@ section 2cB, bit logic 0b0 ~ronrem-lonsem/try=> (mix 2 2) 0 -++ not - binary not (sized) - Description: - Produces the bit-wise logical NOT over 'b' blocks of the given blocksize. - --- +##++not + +Produces the bit-wise logical NOT over 'b' blocks of the given blocksize. + +####Summary + First produces the binary exponent of the binary exponent of the block size times 'b'. This is decremented before being multiplied by 'c'. Finally, this product is exclusive ORed and produced. - Examples: + +####Examples: + ~palryp-hocsyt/try=> `@ub`24 0b1.1000 - --- ~palryp-hocsyt/try=> (not 0 5 24) 7 - --- ~palryp-hocsyt/try=> `@ub`7 0b111 - --- ~palryp-hocsyt/try=> (not 2 5 24) 1.048.551 - --- ~palryp-hocsyt/try=> (not 2 5 1.048.551) 24 - --- ~palryp-hocsyt/try=> (not 1 1 (not 1 1 10)) 10 section 2cC, noun orders -++ aor - a-order - Description: - Alphabetic comparator gate. - --- +##++aor + +Alphabetic comparator gate. + +####Summary + Activate jet. Creates a dry %gold gate which accepts two nouns. Casts the result to a loobean. @@ -1642,31 +1658,32 @@ section 2cC, noun orders If so, produce the recursive call to the trap with 'a' replaced by the byte right-shift of 'a' and 'b' replaced by the byte right-shift of 'b'. Else (if !(c=d)), produce (c (aor 'a' 'b') %.y ~tadbyl-hilbel/try=> (aor 'b' 'a') %.n - --- ~tadbyl-hilbel/try=> (aor "foo" "bar") %.n ~tadbyl-hilbel/try=> (aor "bar" "foo") %.y - --- ~tadbyl-hilbel/try=> (aor "abcdefz" "abcdefa") %.n ~tadbyl-hilbel/try=> (aor "abcdefa" "abcdefz") %.y - --- ~tadbyl-hilbel/try=> (aor 10.000 17.000) %.y ~tadbyl-hilbel/try=> (aor 10 9) %.n -++ dor - d-order - Description: - Numeric comparator gate. - --- + +##++dor + +Numeric comparator gate. + +####Summary + Activate jet. Creates a dry %gold gate which accepts two nouns. Casts the result to a loobean. @@ -1681,26 +1698,28 @@ section 2cC, noun orders Else ('a' is an atom), build an unless-then-else statement on "b is an atom." If so, produce true. Else, produce (a (dor 1 2) %.y ~tadbyl-hilbel/try=> (dor 2 1) %.n - --- ~tadbyl-hilbel/try=> (dor ~[1 2 3] ~[1 2 4]) %.y ~tadbyl-hilbel/try=> (dor ~[1 2 4] ~[1 2 3]) %.n - --- ~tadbyl-hilbel/try=> (dor (limo ~[99 100 10.000]) ~[99 101 10.000]) %.y ~tadbyl-hilbel/try=> (dor ~[99 101 10.999] (limo ~[99 100 10.000])) %.n -++ gor - g-order - Description: + +##++gor + Hash comparator gate. - --- + +####Summary + Activate jet. Creates a dry %gold gate which accepts two nouns. Casts the result to a loobean. @@ -1708,7 +1727,9 @@ section 2cC, noun orders Create an if-then-else statement on c=d. If so, produce the d-order of 'a' and 'd'. Else, produce the loobean (c (gor 'd' 'c') %.y ~palryp-hocsyt/try=> 'd' @@ -1726,17 +1747,17 @@ section 2cC, noun orders %.y ~palryp-hocsyt/try=> (gor 'c' 'd') %.n - --- ~palryp-hocsyt/try=> (gor "foo" "bar") %.n - --- ~palryp-hocsyt/try=> (gor (some 10) (limo [1 2 3 ~])) %.n -++ hor - h-order - Description: - Recursive hash comparator gate. - --- + +##++hor + +Recursive hash comparator gate. + +####Summary + Activate jet. Creates a dry %gold gate which accepts two nouns. Casts the result to a loobean. @@ -1751,11 +1772,12 @@ section 2cC, noun orders Else (if the heads of 'a' and 'b' are not equal), produce the g-order of the tails of 'a', 'b'. Examples: -++ vor - v-order - Description: - Double hash comparator gate. - --- +##++vor + +Double hash comparator gate. + +####Summary + Activate jet. Creates a dry %gold gate which accepts two nouns. Casts the result to a loobean. @@ -1763,13 +1785,13 @@ section 2cC, noun orders Builds an if-then-else statement on (c=d). If so, produce the d-order of 'a' and 'b'. Else, produce the loobean of (c (vor 'f' 'g') %.y - --- ~palryp-hocsyt/try=> (vor 'a' 'z') %.n - --- ~palryp-hocsyt/try=> (vor 43.326 41.106) %.n From 9814f30a892c2b7caef8ca2f5d4fb220d33468bf Mon Sep 17 00:00:00 2001 From: John Dulin Date: Fri, 8 Aug 2014 14:41:56 -0700 Subject: [PATCH 03/34] Finished markdownifying maps, adding some content. --- main/pub/src/doc/ref/vol2.md | 780 ++++++++++++++++++++++------------- 1 file changed, 503 insertions(+), 277 deletions(-) diff --git a/main/pub/src/doc/ref/vol2.md b/main/pub/src/doc/ref/vol2.md index 94c2c77b56..d0f129153c 100644 --- a/main/pub/src/doc/ref/vol2.md +++ b/main/pub/src/doc/ref/vol2.md @@ -2714,7 +2714,7 @@ section 2dA, sets section 2dB, maps -++ ept +##++ ept Is the given tree of cell pairs a map? @@ -2747,188 +2747,199 @@ Is the given tree of cell pairs a map? ~tadbyl-hilbel/try=> (ept b) ! type-fail ! exit -++ ja +##++ ja The jar engine: A container arm for jar operation arms. Jars are maps of lists. The contained arms inherit the sample jar. 'a'. Build a wet %gold tray with a sample jar `a`... - +- get +##+- get - Retrieve a list from the map by its key. +Retrieve a list from the map by its key. - ####Summary +####Summary - Build wet %gold gate with sample noun `b` - Push `d` is the slug of by to get with `a` slammed with `b`. - If: `c` is null, - Then: Produce null, - Else: Produce `u.c`, the unit value of `c` + Build wet %gold gate with sample noun `b` + Push `d` is the slug of by to get with `a` slammed with `b`. + If: `c` is null, + Then: Produce null, + Else: Produce `u.c`, the unit value of `c` - ####Examples - - ~zod/try=> =l (mo `(list ,[@t (list ,@)])`[['a' `(list ,@)`[1 2 3 ~]] ['b' `(list ,@)`[4 5 6 ~]] ~]) - ~zod/try=> l - {[p='a' q=~[1 2 3]] [p='b' q=~[4 5 6]]} - ~zod/try=> (~(get ja l) 'a') - ~[1 2 3] - ~zod/try=> (~(get ja l) 'b') - ~[4 5 6] - ~zod/try=> (~(get ja l) 'c') - ~ - - +- add - - Add a key-list value to the jar. +####Examples + + ~zod/try=> =l (mo `(list ,[@t (list ,@)])`[['a' `(list ,@)`[1 2 3 ~]] ['b' `(list ,@)`[4 5 6 ~]] ~]) + ~zod/try=> l + {[p='a' q=~[1 2 3]] [p='b' q=~[4 5 6]]} + ~zod/try=> (~(get ja l) 'a') + ~[1 2 3] + ~zod/try=> (~(get ja l) 'b') + ~[4 5 6] + ~zod/try=> (~(get ja l) 'c') + ~ - ####Summary +##+- add - Build wet %gold gate with sample noun `b`, noun `c` - Push `d` is the call of get with the subject replaced by `a`, slammed with `b` - Produce the slam of by to put with `a` slammed with `b` and [c d]. +Add a key-list value to the jar. - ####Examples +####Summary - ~zod/try=> =l (mo `(list ,[@t (list ,@)])`[['a' `(list ,@)`[1 2 3 ~]] ['b' `(list ,@)`[4 5 6 ~]] ~]) - ~zod/try=> l - {[p='a' q=~[1 2 3]] [p='b' q=~[4 5 6]]} - ~zod/try=> (~(add ja l) 'b' 7) - {[p='a' q=~[1 2 3]] [p='b' q=~[7 4 5 6]]} - ~zod/try=> (~(add ja l) 'a' 100) - {[p='a' q=~[100 1 2 3]] [p='b' q=~[4 5 6]]} - ~zod/try=> (~(add ja l) 'c' 7) - {[p='a' q=~[1 2 3]] [p='c' q=~[7]] [p='b' q=~[4 5 6]]} - ~zod/try=> (~(add ja l) 'c' `(list ,@)`[7 8 9 ~]) - ! type-fail - ! exit + Build wet %gold gate with sample noun `b`, noun `c` + Push `d` is the call of get with the subject replaced by `a`, slammed with `b` + Produce the slam of by to put with `a` slammed with `b` and [c d]. - Terminate the core. - -++ ju +####Examples + + ~zod/try=> =l (mo `(list ,[@t (list ,@)])`[['a' `(list ,@)`[1 2 3 ~]] ['b' `(list ,@)`[4 5 6 ~]] ~]) + ~zod/try=> l + {[p='a' q=~[1 2 3]] [p='b' q=~[4 5 6]]} + ~zod/try=> (~(add ja l) 'b' 7) + {[p='a' q=~[1 2 3]] [p='b' q=~[7 4 5 6]]} + ~zod/try=> (~(add ja l) 'a' 100) + {[p='a' q=~[100 1 2 3]] [p='b' q=~[4 5 6]]} + ~zod/try=> (~(add ja l) 'c' 7) + {[p='a' q=~[1 2 3]] [p='c' q=~[7]] [p='b' q=~[4 5 6]]} + ~zod/try=> (~(add ja l) 'c' `(list ,@)`[7 8 9 ~]) + ! type-fail + ! exit + + Terminate the core. + +##++ ju The jug engine: container arm for jug operation arms. Jugs are maps of sets. The contained arms inherit it's sample jug, 'a'. Build a wet %gold tray with a sample jug `a`. - +- del +##+- del - Delete a value in a set and produce the resulting jug. +Delete a value in a set and produce the resulting jug. - ####Summary +####Summary - Build wet %gold gate with sample noun `b`, noun `c` - Cast the following to the type of `a` - Push `d` is the call of get with the subject replaced by `a`, slammed with `b` - Push `e` is slug del to in by `d` slammed with `c` - If: `e` is null, - Then: Slug tray by to del with `a` slammed with `b` - Else: Produce the slug tray by to put with `a` slammedw ith `b`, `e`. + Build wet %gold gate with sample noun `b`, noun `c` + Cast the following to the type of `a` + Push `d` is the call of get with the subject replaced by `a`, slammed with `b` + Push `e` is slug del to in by `d` slammed with `c` + If: `e` is null, + Then: Slug tray by to del with `a` slammed with `b` + Else: Produce the slug tray by to put with `a` slammedw ith `b`, `e`. - ####Examples +####Examples - ~zod/try=> s - {[p='a' q={1 3 2}] [p='b' q={5 4 6}]} - ~zod/try=> (~(del ju s) 'a' 1) - {[p='a' q={3 2}] [p='b' q={5 4 6}]} - ~zod/try=> (~(del ju s) 'c' 7) - {[p='a' q={1 3 2}] [p='b' q={5 4 6}]} + ~zod/try=> s + {[p='a' q={1 3 2}] [p='b' q={5 4 6}]} + ~zod/try=> (~(del ju s) 'a' 1) + {[p='a' q={3 2}] [p='b' q={5 4 6}]} + ~zod/try=> (~(del ju s) 'c' 7) + {[p='a' q={1 3 2}] [p='b' q={5 4 6}]} - +- get ++- get - Retrieve a set from the map by its key. +Retrieve a set from the map by its key. - ####Summary +####Summary - Build wet %gold gate with sample noun `b` - Push `c` is the slug of by to get with `a` slammed with `b` - If: `c` is null, - Then: Produce null, - Else: Produce `u.c`, the unit value of `c` + Build wet %gold gate with sample noun `b` + Push `c` is the slug of by to get with `a` slammed with `b` + If: `c` is null, + Then: Produce null, + Else: Produce `u.c`, the unit value of `c` - ####Examples +####Examples - ~zod/try=> s - {[p='a' q={1 3 2}] [p='b' q={5 4 6}]} - ~zod/try=> (~(get ju s) 'a') - {1 3 2} - ~zod/try=> (~(get ju s) 'b') - {5 4 6} - ~zod/try=> (~(get ju s) 'c') - ~ - - +- has + ~zod/try=> s + {[p='a' q={1 3 2}] [p='b' q={5 4 6}]} + ~zod/try=> (~(get ju s) 'a') + {1 3 2} + ~zod/try=> (~(get ju s) 'b') + {5 4 6} + ~zod/try=> (~(get ju s) 'c') + ~ + +##+- has - Is the element `c` in the set `b`? +Is the element `c` in the set `b`? - ####Summary +####Summary - Build wet %gold gate with sample noun `b`, noun `c` - Yield bean. - Produce the slug of in to has with the call of get with the subject replaced by `a` slammed with: - `b`, a set, slammed with: - `c`. - I.e.: Check if `c` is in the set which is the value of the map key `b`. + Build wet %gold gate with sample noun `b`, noun `c` + Yield bean. + Produce the slug of in to has with the call of get with the subject replaced by `a` slammed with: + `b`, a set, slammed with: + `c`. + I.e.: Check if `c` is in the set which is the value of the map key `b`. - ####Examples +####Examples - ~zod/try=> s - {[p='a' q={1 3 2}] [p='b' q={5 4 6}]} - ~zod/try=> (~(has ju s) 'a' 3) - %.y - ~zod/try=> (~(has ju s) 'b' 6) - %.y - ~zod/try=> (~(has ju s) 'a' 7) - %.n - ~zod/try=> (~(has jus s) 'c' 7) - ! -find-limb.jus - ! find-none - ! exit - ~zod/try=> (~(has ju s) 'c' 7) - %.n + ~zod/try=> s + {[p='a' q={1 3 2}] [p='b' q={5 4 6}]} + ~zod/try=> (~(has ju s) 'a' 3) + %.y + ~zod/try=> (~(has ju s) 'b' 6) + %.y + ~zod/try=> (~(has ju s) 'a' 7) + %.n + ~zod/try=> (~(has jus s) 'c' 7) + ! -find-limb.jus + ! find-none + ! exit + ~zod/try=> (~(has ju s) 'c' 7) + %.n - +- put +##+- put - Add a value to a specific set in the jug. +Add a value to a specific set in the jug. - ####Summary +####Summary - Build wet %gold gate with sample noun b. noun c. - Cast the following to the type of `a`. - Push `d` is the call of get with the subject replaced by `a`, slammed with `b`. - Produce the slug of by to put with `a` slammed with: - `b`, - The slug of in to put by `d` slammed with `c`. + Build wet %gold gate with sample noun b. noun c. + Cast the following to the type of `a`. + Push `d` is the call of get with the subject replaced by `a`, slammed with `b`. + Produce the slug of by to put with `a` slammed with: + `b`, + The slug of in to put by `d` slammed with `c`. - ####Examples +####Examples - ~zod/try=> s - {[p='a' q={1 3 2}] [p='b' q={5 4 6}]} - ~zod/try=> (~(put ju s) 'a' 7) - {[p='a' q={7 1 3 2}] [p='b' q={5 4 6}]} - ~zod/try=> (~(put ju s) 'a' 1) - {[p='a' q={1 3 2}] [p='b' q={5 4 6}]} - ~zod/try=> (~(put ju s) 'c' 7) - {[p='a' q={1 3 2}] [p='c' q={7}] [p='b' q={5 4 6}]} + ~zod/try=> s + {[p='a' q={1 3 2}] [p='b' q={5 4 6}]} + ~zod/try=> (~(put ju s) 'a' 7) + {[p='a' q={7 1 3 2}] [p='b' q={5 4 6}]} + ~zod/try=> (~(put ju s) 'a' 1) + {[p='a' q={1 3 2}] [p='b' q={5 4 6}]} + ~zod/try=> (~(put ju s) 'c' 7) + {[p='a' q={1 3 2}] [p='c' q={7}] [p='b' q={5 4 6}]} + +##++ by + +Container arm for map operation arms. The contained arms inherit it's sample map, 'a'. + +####Summary -++ by - Container arm for map operation arms. The contained arms inherit it's sample map, 'a'. - --- Activate jet. - Builds a %gold tray with a sample which accepts a map. - +- all - Accepts a gate which accepts any noun and produces a loobean. Slams the gate with each member - of map 'a', produce the logical AND of the transformed map. - --- + Build a %gold tray with a sample which accepts a map. + +##+- all + +Accept a gate which accepts any noun and produces a loobean. Slams the gate with each member +of map 'a', produce the logical AND of the transformed map. + +####Summary + Activate jet. - Builds a wet %gold gate which accepts the tile of a gate accepts any noun and produces a loobean. - Creates and kicks a dry %gold gate. Casts the result to loobean. - Builds an if-then-else statement on "a is an atom." - If so, produce true. - Else, produce the logical AND of (b q.n.a), the recursive call of the trap with 'a' replaced by - 'l.a', and the recursive call of the trap with 'a' replaced by 'r.a'. - Examples: + Build wet %gold gate with sample gate accepting any noun and producing a loobean, `b`. + Kick dry %gold trap. Yield bean. + If: `a` is null, + Then: Produce true, + Else: Produce the logical AND of: + `b` slammed with `q.n.a` + The toss of `a` for `l.a` + The toss of `a` for `r.a` + +####Examples + ~talsur-todres/try=> =b (mo `(list ,[@t *])`[['a' 1] ['b' [2 3]] ~]) ~talsur-todres/try=> (~(all by b) |=(a=* ?@(a & |))) %.n @@ -2938,18 +2949,25 @@ The contained arms inherit it's sample jug, 'a'. %.y ~tadbyl-hilbel/try=> (~(all by a) |=(a=@ (lte a 4))) %.n - +- any - Accepts a gate which accepts any noun and produces a loobean. Slams the gate with each member - of map 'a', produce the logical OR of the transformed map. - --- + +##+- any + +Accept a gate which accepts any noun and produces a loobean. Slam the gate with each member +of map 'a' and produce the logical OR of the transformed map. + +####Summary + Activate jet. - Builds a wet %gold gate which accepts the tile of a gate accepts any noun and produces a loobean. - Creates and kicks a dry %gold gate. Casts the result to loobean. - Builds an if-then-else statement on "a is an atom." - If so, produce false. - Else, produce the logical OR of (b q.n.a), the recursive call of the trap with 'a' replaced by - 'l.a', and the recursive call of the trap with 'a' replaced by 'r.a'. - Examples: + Kick dry %gold trap. Yield bean. + If: `a` is null, + Then: Produce false, + Else: Produce the logical OR of: + `b` slammed with `q.n.a` + The toss of `a` for `l.a` + The toss of `a` for `r.a` + +####Examples + ~talsur-todres/try=> =b (mo `(list ,[@t *])`[['a' 1] ['b' [2 3]] ~]) ~talsur-todres/try=> (~(all by b) |=(a=* ?@(a & |))) %.y @@ -2957,170 +2975,378 @@ The contained arms inherit it's sample jug, 'a'. ~tadbyl-hilbel/try=> =a (mo `(list ,[@t @u])`[['a' 1] ['b' 2] ['c' 3] ['d' 4] ['e' 5] ~]) ~tadbyl-hilbel/try=> (~(any by a) |=(a=@ (lte a 4))) %.y - +- del - delete at key b - Description: - Accepts a noun 'b', producing the map with the key-value pair of key 'b' removed. - --- + +##+- del + +Accept a noun 'b', producing the map with the key-value pair of key 'b' removed. + +####Summary + Activate jet. - Creates a wet %gold gate which accepts a noun. - Creates and kicks a dry %gold trap. Casts the result to the type of map 'a'. - Builds an if-then-else statement on "a is null." - If so, produce null. - Else, build an unless-then-else statement on (b=(p.n.a)). - If so, build the if-then-else statement on the g-order of 'b' and 'p.n.a'. - If so, produce the the tuple [n.a $(a l.a) r.a] where $(a l.a) is the recursive call of the - trap with 'a' replaced by 'l.a'. - Else (g-order of 'b' and 'p.n.a' is not true.), produce [n.a l.a $(a r.a)]. - Else (!(b=(p.n.a))), create and kick a dry %gold trap. - Cast the result to a fork between null and the tile of the map 'a'. - Builds an if-then-else statement on "l.a is null." If so, produce 'r.a'. - Else, build an if-then-else statement on "r.a is null." If so, produce 'l.a'. - Else, build an if-then-else statement on the v-order of 'p.n.l.a' and 'p.n.r.a'. - If so, produce [n.l.a l.l.a $(l.a r.l.a)],where $(l.a r.l.a) is the recursive call of the - trap with 'l.a' replaced by 'r.l.a'. - Else, produce [n.r.a $(r.a l.r.a) r.r.a], ,where $(r.a l.r.a) is the recursive call of the - trap with 'r.a' replaced by 'l.r.a'. - Examples: - ~talsur-todres/try=> =b (mo `(list ,[@t *])`[['a' 1] ['b' [2 3]] ~]) + Build wet %gold gate with sample noun `b`. + Kick dry %gold trap. Cast the following to the type of `a`. + If: `a` is null, + Then: Produce null, + Else: Unless: `b` is `p.n.a` + Then: If: gor slammed with `b`, `p.n.a` + Then: Produce the tuple [n.a $(a l.a) r.a] + Else: Produce the tuple [n.a l.a $(a r.a)] + Else: Kick dry %gold trap. Yield either null or the type of `a`. + If: `l.a` is null, Then: Produce `r.a`, + Else: If: `r.a` is null, Then: Produce `l.a`, + ELse: If: vor slammed with `p.n.l.a` and `p.n.r.a`, + Then: Produce the tuple [n.l.a l.l.a $(l.a r.l.a)] + Else: [n.r.a $(r.a l.r.a) r.r.a] + +####Examples + + ~talsur-todres/try=> =b (mo `(list ,[@t *])`[['a' 1] ['b' [2 3]] ~]) ~talsur-todres/try=> (~(del by b) `a`) {[p=`b` q=[2 3]]} - +- dig - axis of 'b' key - Description: - Accepts any noun 'b' and produces the axis of 'b' in within the values of 'p.a' in map 'a'. - --- +##+- dig + +Accept any noun 'b' and produce the axis of 'b' in within the values of 'p.a' in map 'a'. + +####Summary + Creates a wet %gold gate which accepts a noun. - Let 'c' be 1. - Creates and kicks a dry %gold gate. Casts the result to an atomic unit. - Builds an if-then-else statement on "a is null." If so, produce null. - Else, build an if-then-else statement on (b=(p.n.a.)). If so, produce the unit [~ u=(peg c 2)]. - Else, build an if-then-else statement on the g-order of 'b' and 'p.n.a'. - If so, recursively call the trap with 'a' replaced by 'l.a' and 'c' by (peg c 6). - Else, recursively call the trap with 'a' replaced by 'r.a' and 'c' by (peg c 7). - Examples: + Push `c` is 1. + Kick dry %gold gate. Yield atomic unit. + If: `a` is null, Then: Produce null. + Else: If: `b` is `p.n.a`, Then: Produce the unit with value: peg slammed with `c`, 2. + Else: If: gor slammed with `b`, `p.n.a`. + Then: Produce the toss of `a` for `l.a`, `c` for peg slammed with `c`, 6. + Else: Produce the toss of `a` for `r.a`, `c` for peg slammed with `b, 7. + +####Examples + ~talsur-todres/try=> =b (mo `(list ,[@t *])`[['a' 1] ['b' [2 3]] ~]) ~talsur-todres/try=> (~(dig by b) `b`) [~ 2] - +- gas - concatenate - Description: - Accepts any list 'b' of key-value pair cells and produces the map 'a' with the members of 'b' added. - --- +##+- gas + +Accept any list 'b' of key-value pair cells and produce the map 'a' +with the members of 'b' added. + +####Summary + Activate jet. - Creates a wet %gold gate which accepts a list of cells. - Replaces 'b' in the subject with the cast of 'b' to a list whose members have the - same type as the members of 'a'. - Creates and kicks a dry %gold trap. Casts the result to the type of map 'a'. - Builds an if-then-else statement on "b is an atom." - If so, produce 'a'. - Else, recursively call the trap iwth 'b' replaced by the tail of 'b' and 'a' replaced by - 'a' with the key and value of the head of 'b' added to it. - Examples: + Build wet %gold gate with sample list of noun cells [p=* q=*], `b`. + Use `b` replaced by the cast of `b` to the type of the map as subject. + Kick dry %gold trap. Cast the following to the type of the map `a`. + If: `b` is null, + Then: Produce `a`, + Else: Produce the toss of `b` for the tail of `b`, `a` for the cell at the head of `b` + inserted into the map as a `p`, `q` key, value pair. + +####Examples + ~talsur-todres/try=> =a (mo `(list ,[@t *])`[[`a` 1] [`b` 2] ~]) ~talsur-todres/try=> =b `(list ,[@t *])`[[`c` 3] [`d` 4] ~] ~talsur-todres/try=> (~(gas by a) b) {[p=`d` q=4] [p=`a` q=1] [p=`c` q=3] [p=`b` q=2]} - +- get - grab value by key - Description: - Produces the value in the map at key 'b'. - --- - Creates a wet %gold gate which accepts a noun. - Creates and kicks a dry %gold trap. Casts its result to the type of the map's values. - Builds an if-then-else statement on "a is an atom." - If so, produces null. - Else, build an if-then-else statement on (b=(p.n.a)). - If so, produce the unit [~ u=p.n.a]. - Else, build an if-then-else statement on the g-order of 'b' and 'p.n.a'. - If so, produce the recursive call to the trap with 'a' replaced by 'l.a'. - Else, produce the recursive call to the trap with 'a' replaced by 'r.a'. - Examples: + +##+- get + +Produce the value in the map at key 'b'. + +####Summary + + Activate jet. + Build wet %gold gate with sample noun `b`. + Kick dry %gold gate. Yield a unit of the type of the map's values. + If: `a` is null, + Then: Produce null, + Else: If: Is `b` equal to `p.n.a`? + Then: Produce the unit of the value of the tree node, `q.n.a` + Else: If: gor slammed with `b`, `p.n.a` + Then: Produce the toss of `a` for `l.a`, + Else: Produce the toss of `a` for `r.a`. + +####Examples + ~talsur-todres/try=> =b (mo `(list ,[@t *])`[['a' 1] ['b' [2 3]] ~]) ~talsur-todres/try=> (~(get by b) `b`) [~ [2 3]] - +- has - key existence check - Description: - Accepts any noun 'b' and produces the loobean indicating whether the noun exists in map 'a'. - --- + +##+- got + +####Summary + + Build wet %gold gate with sample noun `b`. + Produce the slam of need with: + The slam get with its sample replaced by `a` with `b`. + +####Examples + + ~zod/try=> =m (mo `(list ,[@t *])`[['a' 1] ['b' 2] ~]) + ~zod/try=> m + {[p='a' q=1] [p='b' q=2]} + ~zod/try=> (~(get by m) 'a') + [~ 1] + ~zod/try=> (~(got by m) 'a') + 1 + ~zod/try=> (~(got by m) 'c') + ! exit + + +##+- has + +Accept any noun 'b' and produces the loobean indicating whether the noun exists in map 'a'. + +####Summary + Activate jet. - Creates a wet %gold gate which accepts a noun. - Attempts to get 'b' from 'a', then produces the logical NOT of the loobean "get 'b' in 'a' is null" - Examples: + Build wet %gold gate with smaple noun `b`. + Build dry %gold gate with null sample. + Produce the slam of get with its sample replaced by `a` with `b`. + +####Examples + ~talsur-todres/try=> =b (mo `(list ,[@t *])`[['a' 1] ['b' [2 3]] ~]) ~talsur-todres/try=> (~(has by b) `b`) %.y ~talsur-todres/try=> (~(has by b) `c`) %.n - +- mar - add with validation - Description: - Accepts two nouns of the types of the map's keys and values, respectively. - Validates that the value is not null and puts the pair in the map. If the value is null, - it deletes the key. - --- - Creates a wet %gold gate which accepts a cell of two nouns: one of the type of the map's keys - and one a unit of the map's value type. - If "c is null", produce the map with 'b' deleted. - Else, produce the map with the 'b' and 'u.c' key-value pair added. - Examples: + +##+- int + +Produce the intersection of two maps of the same type. + +####Summary + + Activate jet. + Build wet %gold gate with sample map of the type of `a`, `b`. + Kick dry %gold trap. Cast the following to the type of `a`. + If: `b` is null, + Then: Produce null, + Else: If: vor slammed with `p.n.a` and `p.n.b`, + Then: If: `p.n.b` is `p.n.a` + Then: Produce the tuple [n.b $(a l.a, b l.b) $(a r.a, b r.b)] + Else: If: hor slammed with `p.n.b` and `p.n.a`, + Then: Slam uni(+< $(a l.a, b [n.b l.b ~])) with $(b r.b) + Else: Slam uni(+< $(a r.a, b [n.b ~ r.b])) with $(b l.b) + Else: If: `p.n.a` is `p.n.b` + Then: Produce [n.b $(b l.b, a l.a) $(b r.b, a r.b)]A + Else: If: hor slammed with `p.n.a` p.n.b` + Then: Slam uni(+< $(b l.b, b [n.b l.b ~])) with $(a r.a) + Else: Slam uni(+< $(b r.b, b [n.b ~ r.b])) with $(a l.a) + + Where uni(+< $(b r.b, b [n.b ~ r.b])) is the call of uni with the map + replaced by the toss of `b` for `r.b` and `b` for [n.b ~ r.b]. + +####Examples + + ~zod/try=> =n (mo `(list ,[@t *])`[['a' 1] ['c' 3] ~]) + ~zod/try=> n + {[p='a' q=1] [p='c' q=3]} + ~zod/try=> m + {[p='a' q=1] [p='b' q=2]} + ~zod/try=> (~(int by m) n) + {[p='a' q=1]} + ~zod/try=> =o (mo `(list ,[@t *])`[['c' 3] ['d' 4] ~]) + ~zod/try=> (~(int by m) o) + {} + - +- put +##+- mar + +Accept a noun and a unit of a noun of the type of the map's keys and values, respectively. +Validate that the value is not null and put the pair in the map. If the value is null, +delete the key. + +####Summary + + Build wet %gold gate with sample noun of the type of the map's keys, `b`, + the unit of the type of the map's values `c`. + If: `c`, + Then: Delete `b` from the map. + Else: Put key `b` in the map with the value of the unit `c`, `u.c`. + +####Examples + - --- + +##+- put + +Add a key-value pair to the map. + +####Summary + Activate jet. Build a wet %gold gate with sample noun `b`, noun `c` Creates and kicks a dry %gold trap. Casts the result to the type of the map 'a'. If "a is an atom", produce the cell [[b c] ~ ~]. Else, build the if-then-else statement if - --- - - +- rep - replace by product - Description: - Walks through the map, replacing 'b' with the product of (c n.a b). Produces the resulting - map. - --- - Creates a wet %gold gate which accepts a noun and a gate. - Creates and kicks a dry %gold trap. - If "a is null", produce 'b'. - Else, produce the recursive call to the trap with 'a' replaced by 'r.a' and 'b' replaced by - the recursive call to the trap with 'a' replaced by 'l.a' and b replaced by - the product (c n.a b). - Examples: - - +- rib - transform + product - Description: - - --- - Examples: +####Examples + + ~zod/try=> m + {[p='a' q=1] [p='b' q=2]} + ~zod/try=> (~(put by m) 'c' 3) + {[p='a' q=1] [p='c' q=3] [p='b' q=2]} + ~zod/try=> (~(put by m) "zod" 26) + ! type-fail + ! exit + ~zod/try=> (~(put by m) 'a' 2) + {[p='a' q=2] [p='b' q=2]} + +##+- rep + +Walk through the map, replacing 'b' with the product of (c n.a b). Produce the resulting +map. + +####Summary + + Build wet %gold gate with sample noun `b`, gate `c` + Kick dry %gold trap. + If: `a` is null, Then: Produce `b`, + Else: Produce the toss of `a` for `r.a`, `b` for the toss of `a` for `l.a` and `b` + for the slam of `c` with `n.a` and `b`. + +####Examples + + + +##+- rib + +Walk throught the map, replacing the values n.a with the product of (c n.a b) and produce +the transformed map with the accumulated. `b`. + +####Summary + + Build wet %gold gate with sample noun `b`, gate `c`. + Kick dry %gold trap. Cast the following to the type of the tuple [b a]. + If: `a` is null, Then: Produce the tuple [b ~], + Else: Push `d` is the slam of `c` with `n.a` and `b`. + Set `n.a` to `+.d`, the tail of `d`, in the subject. + Push `e` is the toss of `a` for `l.a`, `b` for `-.d`, the head of `d`. + Push `f` is the toss of `a` for `r.a`, `b` for `-.e`, the head of `e`. + Produce the tuple [-.f [n.a +.e +.f]], that is, the cell of + the head of accumulator `f` and the head of tree [n.a +.e +.f], with + left and right sides of the tails of `e` nad `f`, respectively. + + +####Examples + + +- run - turns to tuples - Description: - --- - Examples: + +####Summary + +####Examples + +- tap - listify pairs - Description: - --- - Examples: - +- uni - union, merge - Description: - --- - Examples: - +- wyt - depth of map - Description: - --- - Examples: + +####Summary + +####Examples + +##+- uni + +Produce the union between two maps. + +####Summary + + Acitvate jet. + Build wey %gold gate with sample map of the type of `a`, `b`. + Kick dry %gold gate. Cast the following to the type of `a`. + If: `b` is null, + Then: Produce `a`, + Else: If: `a` is null, + Then: Produce `b`, + Else: If: vor slammed with `p.n.a` and `p.n.b` + Then: If: `p.n.b` is `p.n.a` + Then: Produce the tuple [n.b $(a l.a, b l.b) $(a r.a, b r.b)] + Else: If: hor slammed with `p.n.b` and `p.n.b` + Then: Produce the toss of `a` for the tree map root: + [n.a $(a l.a, b [n.b l.b ~]) r.a], + `b` for `r.b`. + Else: Produce the toss of `a` for the tree map root: + [n.a l.a $(a r.a, b [n.b ~ r.b])], + `b` for `l.b`. + Else: If: `p.n.a` is `p.n.b`, + Then: Produce the tree map root: + [n.b $(b l.b, a l.a) $(b r.b, a r.a)] + Else: If: hor slammed `p.n.a` and `p.n.b`, + Then: Produce the toss of `b` for: + The tree map root of [n.b $(b l.b, a [n.a l.a ~]) r.b], + `a` for `r.a` + Else: Produce the toss of `b` for: + The tree map root of [n.b l.b $(b r.b, a [n.a ~ r.a])], + `a` for `l.a` + +####Examples + + ~zod/try=> m + {[p='a' q=1] [p='b' q=2]} + ~zod/try=> o + {[p='d' q=4] [p='c' q=3]} + ~zod/try=> (~(uni by m) o) + {[p='d' q=4] [p='a' q=1] [p='c' q=3] [p='b' q=2]} + ~zod/try=> (~(uni by m) ~) + {[p='a' q=1] [p='b' q=2]} + ~zod/try=> n + {[p='a' q=1] [p='c' q=3]} + ~zod/try=> (~(uni by o) n) + {[p='d' q=4] [p='a' q=1] [p='c' q=3]} + +##+- urn + +Turn over the values of the map and produce the tranformed map. + +####Summary + + Build wet %gold gate with sample gate accepting two nouns and producing a noun, `b`. + Kick dry %gold trap. + If: `a` is null, + Then: Produce null, + Else: Produce the tuple [n=[p=p.n.a q=(b p.n.a q.n.a)] l=$(a l.a) r=$(a r.a)] + The root of the tree map with the value:A + The slam of `b` of with `p.n.a` and `q.n.a` + The left and right trees are the toss of `a` for their respective maps. + +####Examples + + ~zod/try=> m + {[p='a' q=1] [p='b' q=2]} + ~zod/try=> (~(urn by m) |=(a=[p=* q=*] q.a)) + {[p='a' q=1] [p='b' q=2]} + ~zod/try=> (~(urn by m) |=(a=[p=* q=*] 7)) + {[p='a' q=7] [p='b' q=7]} + ~zod/try=> (~(urn by m) |=(a=[p=* q=*] p.a)) + {[p='a' q=97] [p='b' q=98]} + +##+- wyt + +Produce the depth of the tree map. + +####Summary + + Increment the following. + Kick dry %gold trap. Yield an atom. + If: `a` is null, + Then: Produce 0, + Else: Produce the increment of the sum of: + The toss of `a` for `l.a`, + the toss of `a` for `r.a`. + +####Examples + + ~zod/try=> m + {[p='a' q=1] [p='b' q=2]} + ~zod/try=> o + {[p='d' q=4] [p='c' q=3]} + ~zod/try=> ~(wyt by m) + 3 + ~zod/try=> ~(wyt by o) + 3 + ~zod/try=> ~(wyt by (~(uni by m) o)) + 5 section 2dC, queues From 0e794b47d02b73b41e17c29a1c8d19930275851b Mon Sep 17 00:00:00 2001 From: ault011 Date: Fri, 8 Aug 2014 16:15:04 -0700 Subject: [PATCH 04/34] updates for jd --- main/pub/src/doc/ref/vol2.md | 619 ++++++++++++++++++++++------------- 1 file changed, 384 insertions(+), 235 deletions(-) diff --git a/main/pub/src/doc/ref/vol2.md b/main/pub/src/doc/ref/vol2.md index efbec53f91..22540543af 100644 --- a/main/pub/src/doc/ref/vol2.md +++ b/main/pub/src/doc/ref/vol2.md @@ -556,13 +556,13 @@ Retrieve the value from a unit and crash if the unit is null. ####Summary Build wet %gold gate with sample unit `a` of any type. - If: `p` is null, - Then: fail, - Else: produce `u.a`, the value of the unit. + If: `p` is null, + Then: fail, + Else: produce `u.a`, the value of the unit. ####Examples - ~zod/try=> =a ((unit ,[@t @t]) [~ ['a' 'b']]) + ~zod/try=> =a ((unit ,[@t @t]) [~ ['a' 'b']]) ~zod/try=> (need a) ['a' 'b'] ~zod/try=> =a ((unit ,@ud) [~ 17]) @@ -1797,14 +1797,14 @@ Double hash comparator gate. section 2cD, insecure hashing -++ fnv - FNV scrambler - Description: - Hashes an atom with the 32-bit FNV non-cryptographic hash algorithm. - --- - Multiplies 'a' by the prime number 16,777,619 and then takes the block of - size 5 off the product's end. - Examples: +##++fnv + +Hashes an atom with the 32-bit FNV non-cryptographic hash algorithm. +Multiplies 'a' by the prime number 16,777,619 and then takes the block of +size 5 off the product's end. + +####Examples + ~palryp-hocsyt/try=> (fnv 10.000) 272.465.456 --- @@ -1813,16 +1813,15 @@ section 2cD, insecure hashing --- ~palryp-hocsyt/try=> (fnv 1) 16.777.619 -++ mug - 31bit nonzero FNV1a - Description: - Hashes any noun with the 31-bit nonzero FNV-1a non-cryptographic hash algorithm. - --- +##++mug + +Hashes any noun with the 31-bit nonzero FNV-1a non-cryptographic hash algorithm. + +####Summary + Activate jet. Creates a dry %gold gate with a sample accepting any noun. - (?^ and 'p' subsection fill in.) - Let 'b' be 2,166,136,261. Create and kick a dry %gold gate. Cast its result to an atom. Let 'c' be 'b'. @@ -1837,37 +1836,36 @@ section 2cD, insecure hashing the fnv hash of the logical XOR of 'c' and (cut 3 [d 1] a), 'd' replaced by the increment of 'd'. - Examples: +####Examples + ~palryp-hocsyt/try=> (mug 10.000) 178.152.889 - --- ~palryp-hocsyt/try=> (mug 10.001) 714.838.017 - --- ~palryp-hocsyt/try=> (mug 1) 67.918.732 - --- ~palryp-hocsyt/try=> (mug (some 10)) 1.872.403.737 - --- ~palryp-hocsyt/try=> (mug (limo [1 2 3 4 5 ~])) 1.067.931.605 section 2cE, phonetic base -++ po - left-right syllable - Description: - Provides the phonetic syllables and name generators for the Urbit naming system. - --- +##++po + +Provides the phonetic syllables and name generators for the Urbit naming system. + +####Summary + Activate jet. Create the cell [sis dex] where 'sis' and 'dex' are the togas on the left-hand ("sinister") and right-hand ("Dexter") phonetic syllable cords, respectively. Build %gold core to contain the following arms. - ++ ind + +##++ind - Description: - --- +####Summary + Activate jet. Creates a dry %gold gate which accepts and atom. Let 'b' be 0. @@ -1875,12 +1873,13 @@ section 2cE, phonetic base Builds an if-then-else statement on (b=256). If so, produce null. Else, build an if-then-else statement on (a=(tod b)). If so, produce the atomic unit [~ b]. Else, recursively call the trap with 'b' replaced by the increment of 'b'. - Examples: + +####Examples - ++ ins +##++ins - Description: - --- +####Summary + Activate jet. Creates a dry %gold gate which accepts and atom. Let 'b' be 0. @@ -1888,181 +1887,201 @@ section 2cE, phonetic base Builds an if-then-else statement on (b=256). If so, produce null. Else, build an if-then-else statement on (a=(tos b)). If so, produce the atomic unit [~ b]. Else, recursively call the trap with 'b' replaced by the increment of 'b'. - Examples: - ++ tod - Description: - Selects right-hand phonetic syllable from 'dex'. - --- +####Examples + +##++tod + +Selects right-hand phonetic syllable from 'dex'. + +####Summary + Activate jet. Creates a dry %gold gate which accepts and atom. Assert that 'a' is less than 256. Produce the three tail-end byte blocks in the rght-shift of dex. - Examples: + +####Examples + ~palryp-hocsyt/try=> (tod:po 98) 6.514.020 - --- ~palryp-hocsyt/try=> (tod:po 150) 6.781.298 - --- ~palryp-hocsyt/try=> (tod:po 255) 7.562.598 - --- ~palryp-hocsyt/try=> (tod:po 256) ! exit - ++ tos +##++tos + Selects left-hand phonetic syllable from 'sin'. - --- + +####Summary + Activate jet. Creates a dry %gold gate which accepts and atom. Assert that 'a' is less than 256. Produce the three tail-end byte blocks in the rght-shift of dex. - Examples: + +####Examples + section 2cF, signed and modular ints -++ si - signed integer - ++ abs - absolute value - Description: - Produces the absolute value of a signed integer. - --- +##++si + +signed integer + +####Summary + +####Examples + +##++abs + +Produces the absolute value of a signed integer. + +####Summary + Creates a dry %gold gate with a sample which accepts a single atom. Sums the last bit of the atom with the single bit-wise block right-shift of the atom, producing the absolute value. - Examples: +####Examples + ~palryp-hocsyt/try=> (abs:si -2) 2 - --- ~palryp-hocsyt/try=> (abs:si -10.000) 10.000 - --- ~palryp-hocsyt/try=> (abs:si --2) 2 - ++ dif - subtraction - Description: - Produces the difference between two signed integers. - --- + +#++dif + +Produces the difference between two signed integers. + +####Summary + Creates a dry %gold gate with a sample which accepts two signed integers. Sums the first signed integer with a new signed integer, made from the second by (new !(syn b) (abs b)), where !(syn b) is the negative of the second integer's sign. This sum, produced, is the difference. - Examples: + +####Examples + ~palryp-hocsyt/try=> (dif:si --10 -7) --17 - --- ~palryp-hocsyt/try=> (dif:si --10 --7) --3 - --- ~palryp-hocsyt/try=> (dif:si `@s`0 --7) -7 - --- ~palryp-hocsyt/try=> (dif:si `@s`0 `@s`7) --4 - ++ dul - modulus - Description: - Produces the modulus of two signed integers. - --- +##++dul + +Produces the modulus of two signed integers. + +####Summary + Creates a dry %gold gate which accepts a signed integer and an atom. Let 'c' be the [sign value] representation of 'a'. Builds an if-then-else statement on -.c, the sign of 'a'. If so ('a' is positive.), produce the modulus of the absolute value of 'c' and 'b'. Else, produce the differenece between 'b' and the absolute value of 'c'. - Examples: +####Examples + ~palryp-hocsyt/try=> (dul:si --9 3) 0 - --- ~palryp-hocsyt/try=> (dul:si --9 4) 1 - --- ~palryp-hocsyt/try=> (dul:si --9 5) 4 - --- ~palryp-hocsyt/try=> (dul:si --9 6) 3 - --- ~palryp-hocsyt/try=> (dul:si --90 --10) 10 - ++ fra - divide - Description: + +####++fra + Produces the quotient of two signed integers. - --- + +####Summary + Creates a dry %gold gate with a sample which accepts two signed integers. Divides the absolute value of 'a', the dividend, and 'b', the divisor, and passes that value as the unsigned integer value of a new signed integer. The sign of the new signed integer is the bitwise logical XOR of the two integer's signs, meaning the quotient is only positive when both factors are positive. This new signed integer is produced. - Examples: +####Examples ~palryp-hocsyt/try=> (fra:si --4 --2) --2 - --- ~palryp-hocsyt/try=> (fra:si -4 -2) --2 - --- ~palryp-hocsyt/try=> (fra:si -4 --2) -2 - --- ~palryp-hocsyt/try=> (fra:si --4 -2) -2 - --- ~palryp-hocsyt/try=> (fra:si `@s`4 `@s`2) --2 - --- ~palryp-hocsyt/try=> (fra:si `@s`4 2) ! type-fail ! exit - ++ new - [sign value] to @s - Description: + +##++new + +[sign value] to @s + +####Summary + Produces a signed integer from a sign value (either & or |) and an atom. - --- Creates a dry %gold gate with a sample which acccepts a loobean and an atom Builds an if-then-else statement on the sign value 'a'. If so, just produce 'b' multiplied by 2. Else, build an if-then-else statement on b=0. If so, produce 0. Else, produce the increment of (2*(dec b)). The result is then cast to an integer and produced from new:si. - Examples: + +####Examples + ~palryp-hocsyt/try=> (new:si [& 10]) --10 ~palryp-hocsyt/try=> (new:si [| 10]) -10 ~palryp-hocsyt/try=> (new:si [%.y 7]) --7 - ++ old - [sign value] - Description: - Produces the cell [sign value] representations of a signed integer. - --- + +####++old + +Produces the cell [sign value] representations of a signed integer. + +####Summary + Create a dry %gold date with a with a sample which accepts a signed integer. Produce a cell with head (syn a), the sign of 'a', and tail (abs), the absolute value of 'a'. - Examples: + +####Examples + ~palryp-hocsyt/try=> (old:si 7) ! type-fail ! exit - --- ~palryp-hocsyt/try=> (old:si -7) [%.n 7] - --- ~palryp-hocsyt/try=> (old:si --7) [%.y 7] - --- ~palryp-hocsyt/try=> (old:si `@s`7) [%.n 4] - --- ~palryp-hocsyt/try=> (old:si -0) [%.y 0] - ++ pro - Produces the product of two signed integers. - --- + +##++pro + +Produces the product of two signed integers. + +####Summary + Creates a dry %gold gate with a sample which accepts two signed integers. Produces their product by evaluating a new signed integer whose sign is the bitwise XOR of the two number's signs and whose value is the product of their two absolute values. - --- + +####Examples + palryp-hocsyt/try=> (pro:si -4 --2) -8 ~palryp-hocsyt/try=> (pro:si -4 -2) @@ -2071,12 +2090,18 @@ section 2cF, signed and modular ints -100.000.000 ~palryp-hocsyt/try=> (pro:si -1.337 --0) --0 - ++ rem - Produces the remainder from a division of two signed integers. - --- + +##++rem + +Produces the remainder from a division of two signed integers. + +####Summary + Creates a dry %gold gate with a sample which accepts two signed integers. Produces the difference between 'a' and the (b*(a/b)). - --- + +####Examples + ~palryp-hocsyt/try=> (rem:si -10 -4) -2 ~palryp-hocsyt/try=> (rem:si --10 --4) @@ -2087,9 +2112,13 @@ section 2cF, signed and modular ints --1 ~palryp-hocsyt/try=> (rem:si --0 --10.000) --0 - ++ sum - Sum two signed integers. - --- + +#++sum + +Sum two signed integers. + +####Summary + Creates a dry %gold gate which accepts two signed integers. Prints '%si-sum' in the stack trace if the following code crashes. Let 'c' and 'd' be the [sign value] representation of 'a' and 'b', respectively. @@ -2105,26 +2134,28 @@ section 2cF, signed and modular ints If so, produce a new, negative signed intger with value ((abs a)-(abs b)) Else, produce a new, positive signed integer with value ((abs c)-(abs d)) Else (if d is not positive), produce a new, negative signed with value ((abs c)+(abs d)). - --- + +####Examples + ~palryp-hocsyt/try=> (sum:si --10 --10) --20 - --- ~palryp-hocsyt/try=> (sum:si --10 -0) --10 - --- ~palryp-hocsyt/try=> (sum:si -10 -7) -17 - --- ~palryp-hocsyt/try=> (sum:si -10 --7) -3 - ++ sun - Produces a signed integer from an unsigned integer. - Note that the result must be manually cast to some @s odor to be inferred as an - unsigned integer in the type system. - --- + +##++sun + +Produces a signed integer from an unsigned integer. +Note that the result must be manually cast to some @s odor to be inferred as an +unsigned integer in the type system. + +####Examples + Build dry %gold gate with sample unsigned integer `a` Produce the integer multiplied by 2. - --- ~palryp-hocsyt/try=> `@s`10 --5 ~palryp-hocsyt/try=> (sun:si 10) @@ -2135,13 +2166,16 @@ section 2cF, signed and modular ints --10 ~palryp-hocsyt/try=> `@sd`(sun:si 12.345) --12.345 - ++ syn - Is a signed integer positive? - Produce the sign of a signed integer - & being posiitve, | negative. - --- + +##++syn + +Is a signed integer positive? +Produce the sign of a signed integer - & being posiitve, | negative. + +####Summary + Build dry %gold gate with sample signed integer `a` Is the last bit of 'a' 0? - --- ~palryp-hocsyt/try=> (syn:si -7) %.n ~palryp-hocsyt/try=> (syn:si --7) @@ -2152,20 +2186,33 @@ section 2cF, signed and modular ints %.y ~palryp-hocsyt/try=> (syn:si --0) %.y -++ fe - Binary block modulo math engine. Defaults to bloq size 1. - --- +##+fe + +Binary block modulo math engine. Defaults to bloq size 1. + +####Summary + Build dry %gold tray with sample bloq `a` - ++ dif - Produces the difference between two atoms in the modular basis representation. - --- + +####Examples + +--- + +##++dif + +Produces the difference between two atoms in the modular basis representation. + +####Summary + Build dry %gold gate wtih sample atom `b`, atom `c` Produce sit slammed with: The difference between: The sum of: `out` and slam of `b` to sit Slam of `c` to sit - --- + +####Examples + ~tadbyl-hilbel/try=> (~(dif fe 3) 63 64) 255 ~tadbyl-hilbel/try=> (~(dif fe 3) 5 10) @@ -2182,14 +2229,19 @@ section 2cF, signed and modular ints 13 ~tadbyl-hilbel/try=> (~(dif fe 2) 63 64) 15 - ++ inv - Inverts the order of the modular field. - --- +##++inv + +Inverts the order of the modular field. + +####Summary + Build dry %gold gate with sample atom `b` Produce the difference between: The decrement of `out` Slam of `b` to sit. - --- + +####Examples + palryp-hocsyt/try=> (~(inv fe 3) 255) 0 ~palryp-hocsyt/try=> (~(inv fe 3) 256) @@ -2202,9 +2254,11 @@ section 2cF, signed and modular ints 253 ~palryp-hocsyt/try=> (~(inv fe 3) 3) 252 - ++ net + +##++net - --- +####Summary + Build dry %gold gate with sample atom `b`. Yield atom. Push toss of `b` for the slam of `b` to sit on the context. Unless: `a` is less than or equal to 3, @@ -2214,7 +2268,9 @@ section 2cF, signed and modular ints The single c-block left-shift of: The toss of `a` for `c`, `b` for the c-block [0 1] cut of `b` The toss of `a` for `c`, `b` for the c-block [1 1] cut of `b` - --- + +####Examples + ~tadbyl-hilbel/try=> (~(net fe 3) 64) 64 ~tadbyl-hilbel/try=> (~(net fe 3) 128) @@ -2261,13 +2317,18 @@ section 2cF, signed and modular ints 562.949.953.421.312 ~tadbyl-hilbel/try=> (~(net fe 6) 513) 72.620.543.991.349.248 - ++ out - Description: - The maximum integer value that the current block can store. - --- + +##+out + +The maximum integer value that the current block can store. + +####Summary + Produce the binary exponent of: - The binary expoenent of the block size, `a` - --- + The binary expoenent of the block size, `a` + +####Examples + ~tadbyl-hilbel/try=> ~(out fe 0) 2 ~tadbyl-hilbel/try=> ~(out fe 1) @@ -2284,9 +2345,10 @@ section 2cF, signed and modular ints 768.814.416.622.492.847.430.639.474.124.377.767.893.424.865.485.276.302.219.601.246. 094.119.453.082.952.085.005.768.838.150.682.342.462.881.473.913.110.540.827.237.163. 350.510.684.586.298.239.947.245.938.479.716.304.835.356.329.624.224.137.216 - ++ rol - - --- +##++rol + +####Summary + Build dry %gold gate with sample bloq `b`, atom `c`, atom `d`. Yield atom. Push `e` is sit slammed with `d`, the modular representation of `d` Push `f` is the binary expoenent of: @@ -2296,12 +2358,14 @@ section 2cF, signed and modular ints con slammed with: The `g` b-blocks right-shift of `e` The difference between `f` and `g` b-blocks left-shift of `e` - --- - - ++ ror +####Examples - --- +##++ror + + +####Summary + Build dry %gold gate with sample bloq `b`, atom `c`, atom `d`. Yield atom. Push `e` is sit slammed with `d`, the modular representation of `d` Push `f` is the binary expoenent of: @@ -2311,14 +2375,20 @@ section 2cF, signed and modular ints con slammed with: The `g` b-blocks left-shift of `e` The difference between `f` and `g` b-blocks right-shift of `e` - --- - ++ sum - Sum two numbers in this modular field. - --- +####Examples + +##++sum + +Sum two numbers in this modular field. + +####Summary + Build dry %gold gate with sample atom `b`, atom `c` - Produce sit slammed with the sum of `b` and `c` - --- + Produce sit slammed with the sum of `b` and `c`. + +####Examples + ~tadbyl-hilbel/try=> (~(sum fe 3) 10 250) 4 ~tadbyl-hilbel/try=> (~(sum fe 0) 0 1) @@ -2333,12 +2403,18 @@ section 2cF, signed and modular ints 10.256 ~tadbyl-hilbel/try=> (~(sum fe 4) 10.000 100.000) 44.464 - ++ sit - Produce an atom in the current modular block representation. - --- + +##++sit + +Produce an atom in the current modular block representation. + +####Summary + Build dry %gold gate with sample atom `b` Produce the last block of size `a` in `b` - --- + +####Examples + ~tadbyl-hilbel/try=> (~(sit fe 3) 255) 255 ~tadbyl-hilbel/try=> (~(sit fe 3) 256) @@ -2381,10 +2457,13 @@ We use this for many of our examples. ~zod/try=> -<- ~2014.8.4..19.39.59..9288 -++ year - Accept a parsed date of form [[a=? y=@ud] m=@ud t=tarp] and produce - its @d representation. - --- +##++year + +Accept a parsed date of form [[a=? y=@ud] m=@ud t=tarp] and produce +its @d representation. + +####Summary + Build dry %gold gate with sample parsed date `det` Yield @d. Push `yer` is: @@ -2395,12 +2474,17 @@ We use this for many of our examples. `yer`, `m.det`, `d.t.det` Produce yule slammed with: `day`, `h.t.det`, `m.t.det`, `s.t.det`, `f.t.det` - --- + +####Examples + ~zod/try=> (year [[a=%.y y=2.014] m=8 t=[d=4 h=20 m=4 s=57 f=~[0xd940]]]) 0x8000000d227df4e9d940000000000000 -++ yore +##++yore + Produce the parsed date [[a=? y=@ud] m=@ud t=tarp] representation of a @d date. - --- + +####Summary + Build dry %gold gate with sample @d `now`. Yield date. Push `rip` is yell slammed with `now`, the @@ -2411,14 +2495,20 @@ We use this for many of our examples. a is true, y is the difference between y.ger and 292.277.024.400, Else: Proudce a is false, y is the difference between 292.277.024.400 and y.ger. [m.ger d.ger h.rip m.rip s.rip. f.rip], the tarp of the date. - --- + +####Examples + ~zod/try=> (yore -<-) [[a=%.y y=2.014] m=8 t=[d=4 h=20 m=17 s=1 f=~[0x700d]]] ~zod/try=> (yore -<-) [[a=%.y y=2.014] m=8 t=[d=4 h=20 m=28 s=53 f=~[0x7b82]]] -++ yell - Produce a parsed daily time format from an atomic date. - --- + +##++yell + +Produce a parsed daily time format from an atomic date. + +####Summary + Build a dry %gold gate with sample @d, `now`. Yield tarp. Push `sec` is the 6-bit right-shift of `now`. @@ -2435,16 +2525,21 @@ We use this for many of our examples. Push `mit` is `sec` divided by the constant `mit:yo` Use `sec` replaced by the modulus of`sec` and the constant `mit:yo` Produce the tuple `day`, `hor`, `mit`, `sec`, `fan`. - --- + +####Examples + ~dovryp-toblug/try=> (yell ~2014.3.20..05.42.53..7456) [d=106.751.991.820.094 h=5 m=42 s=53 f=~[0x7456]] ~tadbyl-hilbel/try=> (yell ~2014.6.9..19.09.40..8b66) [d=106.751.991.820.175 h=19 m=9 s=40 f=~[0x8b66]] ~tadbyl-hilbel/try=> (yell ~1776.7.4) [d=106.751.991.733.273 h=0 m=0 s=0 f=~] -++ yule - Accept a tarp, a parsed daily time, and produces a time atom, @d. - --- +##++yule + +Accept a tarp, a parsed daily time, and produces a time atom, @d. + +####Summary + Build a dry %gold gate with sample tarp, `rip`. Yield @d. Push `sec` is the sum of: @@ -2464,7 +2559,9 @@ We use this for many of our examples. Produce con (binary OR) slammed with: The 6-bit single block left-shift of `sec`, `fac`. - --- + +####Examples + ~tadbyl-hilbel/try=> =murica (yell ~1776.7.4) ~tadbyl-hilbel/try=> murica [d=106.751.991.733.273 h=0 m=0 s=0 f=~] @@ -2474,10 +2571,13 @@ We use this for many of our examples. 0x8000000d21c88d5d7456000000000000 ~tadbyl-hilbel/try=> (yule (yell ~2014.6.9..19.09.40..8b66)) 0x8000000d223413f48b66000000000000 -++ yall - Produce the date tuple of [y=@ud m=@ud d=@ud] of the year, month, and day - from a number of days from the beginning of time. - --- +##++yall + +Produce the date tuple of [y=@ud m=@ud d=@ud] of the year, month, and day +from a number of days from the beginning of time. + +####Summary + Build dry %gold gate with sample @ud, `day` Yield the tuple [y=@ud m=@ud d=@ud] Push `era` is 0, `cet` is 0, `lep` is the bunt of a bean. @@ -2524,17 +2624,22 @@ We use this for many of our examples. Else: Produce the toss of: `mot` for its increment, `day` for the difference between `day` and `zis` - --- + +####Examples + ~zod/try=> (yall 198) [y=0 m=7 d=17] ~zod/try=> (yall 90.398) [y=247 m=7 d=3] ~zod/try=> (yall 0) [y=0 m=1 d=1] -++ yawn +##++yawn + Days since Jesus. Accpet a year, month, and day (Three unsigned decimal integers) and produce the day number it is in the CE. - --- + +####Summary + Build dry %gold gate with sample atoms `yer`, `mot`, `day` Yield atom. Use `mot` replaced by its decrement, `day` by its decrement as subject. @@ -2564,21 +2669,28 @@ We use this for many of our examples. Else: Produce the sum of `day`, `yer` divided by 400 multiplied by the increment of 4*36,524. - --- + +####Examples + ~zod/try=> (yawn 2.014 8 4) 735.814 ~zod/try=> (yawn 1.776 7 4) 648.856 -++ yelp +##++yelp + Is the given year a leap year? - --- + +####Summary + Build dry %gold gate with sample atom `yer`. Yield loobean. Produce the logical AND of: Is 0 the modulus of `yer` by 4? The logical OR of: Is 0 the modulus of `yer` by 100? Is 0 the modulus of `yer` by 400? - --- + +####Examples + ~tadbyl-hilbel/try=> (yelp 2.014) %.n ~tadbyl-hilbel/try=> (yelp 2.008) @@ -2587,86 +2699,118 @@ We use this for many of our examples. %.y ~tadbyl-hilbel/try=> (yelp 14.011) %.n -++ yo +##++yo + Constants of time. - --- + +####Summary + Build a %gold core. - ++ cet + +##++ cet + Days in a century. Derived by multiplying the number of days in a year (365) by the number of years in a century (100), then adding the number days from leap years in a century (24). - --- + +####Examples + ~tadbyl-hilbel/try=> cet:yo 36.524 ~tadbyl-hilbel/try=> (add 365 cet:yo) 36.889 ~tadbyl-hilbel/try=> (sub (add 24 (mul 100 365)) cet:yo) 0 - ++ day + +##++day + The number of seconds in a day. Derived by multiplying the the number of seconds in an hour by the hours in a day. - --- + +####Examples + ~tadbyl-hilbel/try=> day:yo 86.400 ~tadbyl-hilbel/try=> (add 60 day:yo) 86.460 - ++ era - --- - - --- - - ++ hor - The number of seconds in an hour. Derived by multiplying the number of - seconds in a minute by the minutes in an hour. - --- +##++era + +####Examples + + +##++hor + +The number of seconds in an hour. Derived by multiplying the number of +seconds in a minute by the minutes in an hour. + +####Examples + ~tadbyl-hilbel/try=> hor:yo 3.600 - ++ jes +##++jes + +####Examples - --- - - --- - - ++ mit - The number of seconds in a minute. We just knew this one. - --- + +##++mit + +The number of seconds in a minute. We just knew this one. + +####Examples + ~tadbyl-hilbel/try=> mit:yo 60 - ++ moh + +##++moh + The days in each month of the Gregorian common year. A list of unsigned decimal atoms (Either 28, 30, or 31) denoting the number of days in the month at the year at that index. - --- + +####Examples + ~tadbyl-hilbel/try=> moh:yo ~[31 28 31 30 31 30 31 31 30 31 30 31] - ++ moy + +##++moy + The days in each month of the Gregorian leap-year. A list of unsigned decimal atoms (Either 29,30, or 31) denoting the number of days in the month at the leap-year at that index. - --- + +####Examples + ~tadbyl-hilbel/try=> moy:yo ~[31 29 31 30 31 30 31 31 30 31 30 31] - ++ qad + +##++qad + The number of seconds in four years. Derived by adding one second to the number of seconds in four years. - --- + +####Examples + ~tadbyl-hilbel/try=> qad:yo 126.144.001 - ++ yer +##++yer + The number of seconds in a year. Derived by multiplying the number of seconds in a day by 365. - --- + +####Examples + ~tadbyl-hilbel/try=> yer:yo 31.536.000 section 2cI, almost macros -++ hard - demand result type - Description: - Ruthlessly demands that a specific type be produced, crashing the program is it is not. - --- +##++hard + +Ruthlessly demands that a specific type be produced, crashing the program is it is not. + +####Summary + Creates a vulanized wet gate which accepts any gate which accepts any noun and produces any noun. Creates a dry %gold gate which accepts any noun and casts the result to the @@ -2675,7 +2819,9 @@ section 2cI, almost macros Let gol be the higher gate argument slammed with the lower arbitrary noun. Assert that the result's icon is equal to that of the lower arbitrary noun before producing said result. - Examples: + +####Examples + ~palryp-hocsyt/try=> ((hard (list)) (limo [1 2 3 ~])) ~[1 2 3] ~tadbyl-hilbel/try=> ((hard ,@) (add 2 2)) @@ -2685,11 +2831,13 @@ section 2cI, almost macros ~tadbyl-hilbel/try=> ((hard tape) (crip "...Tape to cord, bro?...")) ! hard ! exit -++ soft - politely demand - Description: - Politely requests a specific type to be produced, producing null if it is not. - --- + +##++soft + +Politely requests a specific type to be produced, producing null if it is not. + +####Summary + Creates a vulanized wet gate which accepts any gate which accepts any noun and produces any noun. Creates a dry %gold gate which accepts any noun and casts the result to the @@ -2699,7 +2847,8 @@ section 2cI, almost macros the lower arbitrary noun. If so, produce null. Else, produce the unit of the result. - Examples: +####Examples + ~tadbyl-hilbel/try=> ((soft ,%4) (add 2 2)) [~ %4] ~tadbyl-hilbel/try=> ((soft ,@) (add 2 2)) From 05578eba5c72fb1fee31f7e4aa10243bb7cf74d4 Mon Sep 17 00:00:00 2001 From: ault011 Date: Fri, 8 Aug 2014 16:51:09 -0700 Subject: [PATCH 05/34] error check pass through sets --- main/pub/src/doc/ref/vol2.md | 100 +++++++++++++++++++++-------------- 1 file changed, 61 insertions(+), 39 deletions(-) diff --git a/main/pub/src/doc/ref/vol2.md b/main/pub/src/doc/ref/vol2.md index 118e37e174..492594f80f 100644 --- a/main/pub/src/doc/ref/vol2.md +++ b/main/pub/src/doc/ref/vol2.md @@ -508,6 +508,7 @@ A default value `b` for the unit `a` when `a` is null 0 ##++lift + Fmap; Accept a gate that accepts and produces an unwrapped value and pass it a unit value, then produce a unit value. @@ -629,7 +630,8 @@ Homogenizes a lists' type information. Terminates the core. Produces list a. -####Examples: +####Examples + ~palryp-hocsyt/try=> lyst [i=1 t=[i=97 t=[i=2 t=[i=98 t=[i=[~ u=10] t=~]]]]] ~palryp-hocsyt/try=> (homo lyst) @@ -802,6 +804,7 @@ Left fold - Move left to right recursively slamming a binary gate with an elemen 0 ##++skid + Seperate a list `a` into two lists - Those elements of `a` who produce true when slammed to `b` and those who produce false. ####Summary @@ -873,7 +876,8 @@ Produces the sublist of `a` whose elments produce false when slammed with `b`. Accepts an atom `a` and list `b`, producing the first `a` elements of the front of the list. -####Summary: +####Summary + Activate jet. Build wet %gold gate with sample atom `a` and list `b`. Kick dry %gold trap. @@ -937,7 +941,7 @@ Accepts an atom `a` and list `b`, producing the last `a` elements from the back ~palryp-hocsyt/try=> (snag 4 (limo [1 2 3 4 5 6 7 8 ~])) 5 -####+sort +##++sort Accepts a list `a` and a gate `b` with a sample which accepts two nouns and produces a loobean. 'sort' then produces a list of the elements of 'a' sorted according to 'b'. @@ -1032,6 +1036,7 @@ Concatenates two lists without losing their type information to homogenization. Produces a tape when passed two tapes. ####Summary + Identical to the internals of `++weld`, except it does not implement the list homogenization. ####Examples: @@ -1085,7 +1090,7 @@ Turns a list of lists into a single list by promoting the elements of each subli chapter 2c, simple noun surgery -section 2cA, bit surgery **capitalization of "section" inconsistent in source** +section 2cA, bit surgery ##++bex @@ -1133,7 +1138,7 @@ Takes the base-2 logarithm of an atom. ##++can -Assembles a +Assembles an atom. ####Summary @@ -1197,7 +1202,8 @@ Concatenates two atoms, obeying the given block size. ~ronrem-lonsem/try=> `@ub`(cat 2 256 255) 0b1111.1111.0001.0000.0000 ~ronrem-lonsem/try=> (cat 3 256 255) - 16.711.936 + 16.711.936 + ##++cut Accepts a block size 'a', a cell of two atoms 'b' and 'c' and another atom 'd'. @@ -1240,7 +1246,7 @@ Produces the tail of 'd' that is 'c' blocks long after right-shifting 'd' 'b'-bl Multiplies the binary exponent of `a` (2^a) with `b`, then takes the binary exponent of that (2^((2^a)*b)) to finally produce the modulus of 'c' and the ensuing product. -####Examples: +####Examples ~ronrem-lonsem/try=> `@ub`12 0b1100 @@ -1255,8 +1261,9 @@ Produces the tail of 'd' that is 'c' blocks long after right-shifting 'd' 'b'-bl ~ronrem-lonsem/try=> (end 3 1 256) 0 ~ronrem-lonsem/try=> (end 3 1 255) - 255 -++ fil + 255 + +##++fil fill bloqstream @@ -1340,6 +1347,7 @@ Measures the number of blocks of size `a` in `b`. 1 ~ronrem-lonsem/try=> (met 3 256) 2 + ##++rap Concatenate a list of atoms while obeying a given blocksize. @@ -1433,9 +1441,10 @@ block size. ~palryp-hocsyt/try=> (rip 3 256) ~[0 1] -##++rsh - Accepts a block size 'a' and two atoms, 'b' and 'c'. Right-shifts 'c' by 'b' blocks - of size 'a'. +##++rsh + +Accepts a block size 'a' and two atoms, 'b' and 'c'. Right-shifts 'c' by 'b' blocks +of size 'a'. ####Summary @@ -1606,6 +1615,7 @@ Produces the bit-wise logical exclusive OR of two atoms. 0b0 ~ronrem-lonsem/try=> (mix 2 2) 0 + ##++not Produces the bit-wise logical NOT over 'b' blocks of the given blocksize. @@ -1770,7 +1780,10 @@ Recursive hash comparator gate. Else, build an if-then-else statement on (-.a=-.b), where '-.a' is the head of 'a'. If so, produce the g-order of the tails of 'a' and 'b'. Else (if the heads of 'a' and 'b' are not equal), produce the g-order of the tails of 'a', 'b'. - Examples: + +####Examples + +--- ##++vor @@ -1813,6 +1826,7 @@ size 5 off the product's end. --- ~palryp-hocsyt/try=> (fnv 1) 16.777.619 + ##++mug Hashes any noun with the 31-bit nonzero FNV-1a non-cryptographic hash algorithm. @@ -1874,7 +1888,6 @@ Provides the phonetic syllables and name generators for the Urbit naming system. Else, build an if-then-else statement on (a=(tod b)). If so, produce the atomic unit [~ b]. Else, recursively call the trap with 'b' replaced by the increment of 'b'. -####Examples ##++ins @@ -1888,8 +1901,6 @@ Provides the phonetic syllables and name generators for the Urbit naming system. Else, build an if-then-else statement on (a=(tos b)). If so, produce the atomic unit [~ b]. Else, recursively call the trap with 'b' replaced by the increment of 'b'. -####Examples - ##++tod Selects right-hand phonetic syllable from 'dex'. @@ -1911,6 +1922,7 @@ Selects right-hand phonetic syllable from 'dex'. 7.562.598 ~palryp-hocsyt/try=> (tod:po 256) ! exit + ##++tos Selects left-hand phonetic syllable from 'sin'. @@ -1928,11 +1940,6 @@ section 2cF, signed and modular ints ##++si -signed integer - -####Summary - -####Examples ##++abs @@ -1973,6 +1980,7 @@ Produces the difference between two signed integers. -7 ~palryp-hocsyt/try=> (dif:si `@s`0 `@s`7) --4 + ##++dul Produces the modulus of two signed integers. @@ -1984,6 +1992,7 @@ Produces the modulus of two signed integers. Builds an if-then-else statement on -.c, the sign of 'a'. If so ('a' is positive.), produce the modulus of the absolute value of 'c' and 'b'. Else, produce the differenece between 'b' and the absolute value of 'c'. + ####Examples ~palryp-hocsyt/try=> (dul:si --9 3) @@ -1997,9 +2006,9 @@ Produces the modulus of two signed integers. ~palryp-hocsyt/try=> (dul:si --90 --10) 10 -####++fra +##++fra - Produces the quotient of two signed integers. +Produces the quotient of two signed integers. ####Summary @@ -2186,6 +2195,7 @@ Produce the sign of a signed integer - & being posiitve, | negative. %.y ~palryp-hocsyt/try=> (syn:si --0) %.y + ##+fe Binary block modulo math engine. Defaults to bloq size 1. @@ -2194,10 +2204,6 @@ Binary block modulo math engine. Defaults to bloq size 1. Build dry %gold tray with sample bloq `a` -####Examples - ---- - ##++dif Produces the difference between two atoms in the modular basis representation. @@ -2229,6 +2235,7 @@ Produces the difference between two atoms in the modular basis representation. 13 ~tadbyl-hilbel/try=> (~(dif fe 2) 63 64) 15 + ##++inv Inverts the order of the modular field. @@ -2345,6 +2352,7 @@ The maximum integer value that the current block can store. 768.814.416.622.492.847.430.639.474.124.377.767.893.424.865.485.276.302.219.601.246. 094.119.453.082.952.085.005.768.838.150.682.342.462.881.473.913.110.540.827.237.163. 350.510.684.586.298.239.947.245.938.479.716.304.835.356.329.624.224.137.216 + ##++rol ####Summary @@ -2360,10 +2368,11 @@ The maximum integer value that the current block can store. The difference between `f` and `g` b-blocks left-shift of `e` ####Examples + + ?? ##++ror - ####Summary Build dry %gold gate with sample bloq `b`, atom `c`, atom `d`. Yield atom. @@ -2378,6 +2387,8 @@ The maximum integer value that the current block can store. ####Examples + ?? + ##++sum Sum two numbers in this modular field. @@ -2440,19 +2451,19 @@ Produce an atom in the current modular block representation. section 2cG, floating point -++ rlyd -++ rlyh -++ rlyq -++ rlys -++ ryld -++ rylh -++ rylq -++ ryls +##++ rlyd +##++ rlyh +##++ rlyq +##++ rlys +##++ ryld +##++ rylh +##++ rylq +##++ ryls + section 2cH, urbit time -Note that entering '-<-' in the shell produces the current time in @da format. -We use this for many of our examples. +####Note that entering '-<-' in the shell produces the current time in @da format. We use this for many of our examples. ~zod/try=> -<- ~2014.8.4..19.39.59..9288 @@ -2479,6 +2490,7 @@ its @d representation. ~zod/try=> (year [[a=%.y y=2.014] m=8 t=[d=4 h=20 m=4 s=57 f=~[0xd940]]]) 0x8000000d227df4e9d940000000000000 + ##++yore Produce the parsed date [[a=? y=@ud] m=@ud t=tarp] representation of a @d date. @@ -2534,6 +2546,7 @@ Produce a parsed daily time format from an atomic date. [d=106.751.991.820.175 h=19 m=9 s=40 f=~[0x8b66]] ~tadbyl-hilbel/try=> (yell ~1776.7.4) [d=106.751.991.733.273 h=0 m=0 s=0 f=~] + ##++yule Accept a tarp, a parsed daily time, and produces a time atom, @d. @@ -2571,6 +2584,7 @@ Accept a tarp, a parsed daily time, and produces a time atom, @d. 0x8000000d21c88d5d7456000000000000 ~tadbyl-hilbel/try=> (yule (yell ~2014.6.9..19.09.40..8b66)) 0x8000000d223413f48b66000000000000 + ##++yall Produce the date tuple of [y=@ud m=@ud d=@ud] of the year, month, and day @@ -2633,6 +2647,7 @@ from a number of days from the beginning of time. [y=247 m=7 d=3] ~zod/try=> (yall 0) [y=0 m=1 d=1] + ##++yawn Days since Jesus. Accpet a year, month, and day (Three unsigned decimal integers) @@ -2676,6 +2691,7 @@ from a number of days from the beginning of time. 735.814 ~zod/try=> (yawn 1.776 7 4) 648.856 + ##++yelp Is the given year a leap year? @@ -2699,6 +2715,7 @@ from a number of days from the beginning of time. %.y ~tadbyl-hilbel/try=> (yelp 14.011) %.n + ##++yo Constants of time. @@ -2736,7 +2753,9 @@ from a number of days from the beginning of time. ##++era -####Examples +####Examples + + ?? ##++hor @@ -2748,6 +2767,7 @@ seconds in a minute by the minutes in an hour. ~tadbyl-hilbel/try=> hor:yo 3.600 + ##++jes ####Examples @@ -2793,6 +2813,7 @@ The number of seconds in a minute. We just knew this one. ~tadbyl-hilbel/try=> qad:yo 126.144.001 + ##++yer The number of seconds in a year. Derived by multiplying the number of @@ -2847,6 +2868,7 @@ Politely requests a specific type to be produced, producing null if it is not. the lower arbitrary noun. If so, produce null. Else, produce the unit of the result. + ####Examples ~tadbyl-hilbel/try=> ((soft ,%4) (add 2 2)) From b3ce191659a6db6aee4fb8e17abf16bb9b8b1489 Mon Sep 17 00:00:00 2001 From: ault011 Date: Fri, 8 Aug 2014 17:49:19 -0700 Subject: [PATCH 06/34] 2eh-2em --- main/pub/src/doc/ref/vol2.md | 1009 ++++++++++++++++++++++------------ 1 file changed, 654 insertions(+), 355 deletions(-) diff --git a/main/pub/src/doc/ref/vol2.md b/main/pub/src/doc/ref/vol2.md index 492594f80f..1ab26d9be4 100644 --- a/main/pub/src/doc/ref/vol2.md +++ b/main/pub/src/doc/ref/vol2.md @@ -5185,56 +5185,85 @@ section 2eG, parsing (whitespace) section 2eH, parsing (idioms) -++ alf - Parse alphabetic characters, both upper and lowercase. - --- +##++alf + +Parse alphabetic characters, both upper and lowercase. + +####Summary + Produce the rule of pose gonadified with low and hig. - --- + +####Examples + ~tadbyl-hilbel/try=> (scan "a" alf) ~~a ~tadbyl-hilbel/try=> (scan "A" alf) ~~~41. ~tadbyl-hilbel/try=> (scan "AaBbCc" (star alf)) "AaBbCc" -++ aln - Parse alphanumeric characters - both alphabetic characters and numbers. - --- + +##++aln + +Parse alphanumeric characters - both alphabetic characters and numbers. + +####Summary + Produce the rule of pose gonadified with low,hig, and nud. - --- + +####Examples + ~tadbyl-hilbel/try=> (scan "0" aln) ~~0 ~tadbyl-hilbel/try=> (scan "alf42" (star aln)) "alf42" ~tadbyl-hilbel/try=> (scan "0123456789abcdef" (star aln)) "0123456789abcdef" -++ alp - Parse alphanumeric strings and hep, "-". - --- + +##++alp + +Parse alphanumeric strings and hep, "-". + +####Summary + Produce the rule pose gonadified with low, hig, nud, hep. - --- + +####Examples + ~tadbyl-hilbel/try=> (scan "7" alp) ~~7 ~tadbyl-hilbel/try=> (scan "s" alp) ~~s ~tadbyl-hilbel/try=> (scan "123abc-" (star alp)) "123abc-" -++ bet - Parse the hep and lus axis syntax. - --- + +##++bet + +Parse the hep and lus axis syntax. + + +####Summary + Produce the rule pose gonadified with: - (cold 2 hep), which replaces parsed heps with 2s. - (cold 3 lus), which replaced parsed luses with 3s. - --- + (cold 2 hep), which replaces parsed heps with 2s. + (cold 3 lus), which replaced parsed luses with 3s. + +####Examples + ~tadbyl-hilbel/try=> (scan "-" bet) 2 ~tadbyl-hilbel/try=> (scan "+" bet) 3 -++ bin - Parse a tape of binary (0s and 1s) and produce its atomic representation. - --- + +##++bin + +Parse a tape of binary (0s and 1s) and produce its atomic representation. + +####Summary + Produce the slam of bass with 2 and the (most gon but), which produces + +####Examples - --- ~tadbyl-hilbel/try=> (scan "0000" bin) 0 ~tadbyl-hilbel/try=> (scan "0001" bin) @@ -5243,13 +5272,19 @@ section 2eH, parsing (idioms) 2 ~tadbyl-hilbel/try=> (scan "100000001111" bin) 2.063 -++ but + +##++but + Parse a single binary digit. - --- + +####Summary + Produce rule cook slammed with a gate: With sample atom `a` that results in the difference between `a` and '0' (48). All slammed with the rule shim slammed with '0' and '1', to parse either of those characters. - --- + +####Examples + ~tadbyl-hilbel/try=> (scan "0" but) 0 ~tadbyl-hilbel/try=> (scan "1" but) @@ -5260,13 +5295,19 @@ section 2eH, parsing (idioms) ! exit ~tadbyl-hilbel/try=> (scan "01" (star but)) ~[0 1] -++ cit + +##++cit + Parse a single octal digit. - --- + +####Summary + Produce rule cook slammed with a gate: With sample atom `a` that results in the difference between `a` and '0' (48). All slammed with the rule shim slammed with '0' and '7', to parse any number between 0 and 7. - --- + +####Examples + ~tadbyl-hilbel/try=> (scan "1" cit) 1 ~tadbyl-hilbel/try=> (scan "7" cit) @@ -5277,12 +5318,17 @@ section 2eH, parsing (idioms) ! exit ~tadbyl-hilbel/try=> (scan "60" (star cit)) ~[6 0] -++ dem - Parse a decimal number to an atom. - --- + +##++dem + +Parse a decimal number to an atom. + +####Summary + Produce the slam of bass with 10 (The base number system) and (most gon dit), which produces - --- +####Examples + ~tadbyl-hilbel/try=> (scan "7" dem) 7 ~tadbyl-hilbel/try=> (scan "42" dem) @@ -5291,48 +5337,71 @@ section 2eH, parsing (idioms) 150.000.000 ~tadbyl-hilbel/try=> (scan "12456" dem) 12.456 -++ dit - Parse a single decimal digit. - --- + +##++dit + + Parse a single decimal digit. + +####Summary + Produce the rule cook slammed with a gate: With sample atom `a` that results in the difference between `a` and '0' (48). All slammed with the rule shim slammed with '0' and '9', to parse any number. - --- + +####Examples + ~tadbyl-hilbel/try=> (scan "7" dit) 7 ~tadbyl-hilbel/try=> (scan "42" (star dit)) ~[4 2] ~tadbyl-hilbel/try=> (scan "26000" (star dit)) ~[2 6 0 0 0] -++ gul - Parse the axis gal and gar axis syntax. - --- + +##++gul + +Parse the axis gal and gar axis syntax. + +####Summary + Produce the rule pose gonadified with: (cold 2 gal), which replaces parsed gals with 2s. (cold 3 gar), which replaced parsed gars with 3s. - --- + +####Examples + ~tadbyl-hilbel/try=> (scan "<" gul) 2 ~tadbyl-hilbel/try=> (scan ">" gul) 3 -++ gon - Parse long numbers - Numbers which wrap around the shell with the line break characters bas and fas. - --- + +##++gon + +Parse long numbers - Numbers which wrap around the shell with the line break characters bas and fas. + +####Summary + Produce the rule pose gonadified with: The rule plug gonadified with: bas, gay, and fas, to succeed to parse a bas, fas, or a gap in text. The rule (easy ~), to succeed to parse but produces null as the parsed text. - --- + +####Examples + ~tadbyl-hilbel/try=> (scan "\\/" gon) [~~~5c. ~ ~~~2f.] ~tadbyl-hilbel/try=> (gon [[1 1] "\\/"]) [p=[p=1 q=3] q=[~ u=[p=[~~~5c. ~ ~~~2f.] q=[p=[p=1 q=3] q=""]]]] -++ hex - Parse any hexadecimal number to an atom. - --- + +##++hex + +Parse any hexadecimal number to an atom. + +####Summary + Produce bass slammed with 16 (The base number system) and (most gon hit), which produces the atom - --- +####Examples + ~tadbyl-hilbel/try=> (scan "a" hex) 10 ~tadbyl-hilbel/try=> (scan "A" hex) @@ -5343,11 +5412,17 @@ section 2eH, parsing (idioms) 7.911 ~tadbyl-hilbel/try=> (scan "1EE7" hex) 7.911 -++ hig - Parse a single uppercase letter. - --- + +##++hig + +Parse a single uppercase letter. + +####Summary + Produce the slam of shim with the characters 'A' (65) and 'Z' (90), to parse any character between them, inclusive. - --- + +####Examples + ~tadbyl-hilbel/try=> (scan "G" hig) ~~~47. ~tadbyl-hilbel/try=> `cord`(scan "G" hig) @@ -5356,9 +5431,13 @@ section 2eH, parsing (idioms) "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ~tadbyl-hilbel/try=> (hig [[1 1] "G"]) [p=[p=1 q=2] q=[~ [p=~~~47. q=[p=[p=1 q=2] q=""]]]] -++ hit + +##++hit + Parse a hexadecimal digit. - --- + +####Summary + Pose gonadified with: dit, parse a single decimnal digit. Slam cook with: @@ -5366,7 +5445,9 @@ section 2eH, parsing (idioms) The slam of shim with the characters 'a' (97) and 'z' (122), to parse any character between them, inclusive. The slam of shim with the characters 'A' () and 'Z' (), to parse any character between them, inclusive. Terminate the gonadification. - --- + +####Examples + ~tadbyl-hilbel/try=> (scan "a" hit) 10 ~tadbyl-hilbel/try=> (scan "A" hit) @@ -5375,11 +5456,17 @@ section 2eH, parsing (idioms) [p=[p=1 q=2] q=[~ [p=10 q=[p=[p=1 q=2] q=""]]]] ~tadbyl-hilbel/try=> (scan "2A" (star hit)) ~[2 10] -++ low - Parse a single lowercase letter. - --- + +##++low + +Parse a single lowercase letter. + +####Summary + Produce the slam of shim with the characters 'a' (97) and 'z' (122), to parse any character between them, inclusive. - --- + +####Examples + ~tadbyl-hilbel/try=> (scan "g" low) ~~g ~tadbyl-hilbel/try=> `cord`(scan "g" low) @@ -5388,30 +5475,39 @@ section 2eH, parsing (idioms) "abcdefghijklmnopqrstuvwxyz" ~tadbyl-hilbel/try=> (low [[1 1] "g"]) [p=[p=1 q=2] q=[~ [p=~~g q=[p=[p=1 q=2] q=""]]]] -++ mes - Parse a hexbyte. - --- + +##++mes + +Parse a hexbyte. + +####Sumamry + Slam cook with: Build dry %gold gate with sample atom `a`, atom `b`. Produce the sum of `a` multiplied by 16 and `b` Plug gonadified with hit and hit, parse two consecutive hex digits. - --- +####Examples + ~tadbyl-hilbel/try=> (scan "2A" mes) 42 ~tadbyl-hilbel/try=> (mes [[1 1] "2A"]) [p=[p=1 q=3] q=[~ u=[p=42 q=[p=[p=1 q=3] q=""]]]] ~tadbyl-hilbel/try=> (scan "42" mes) 66 -++ nix - - --- + +##++nix + Slam boss with 256 - --- -++ nud - Parse a numeric character - A number. - --- +##++nud + +Parse a numeric character - A number. + +####Summary + Produce the slam of shim with the characters '0' (48) and '9' (57), to parse any character between them, inclusive. - --- + +####Examples + ~tadbyl-hilbel/try=> (scan "0" nud) ~~0 ~tadbyl-hilbel/try=> (scan "7" nud) @@ -5420,26 +5516,34 @@ section 2eH, parsing (idioms) [p=[p=1 q=2] q=[~ [p=~~1 q=[p=[p=1 q=2] q=""]]]] ~tadbyl-hilbel/try=> (scan "0123456789" (star nud)) "0123456789" -++ poy + +####++poy + Parse an escape character. - --- + +####Summary + Produce pfix gonadified with: bas pose gonadifided with: bas soq mes, to parse a hexbyte. - --- -++ qit - Parse an individual character to its cord atom representation. - --- +##++qit + +Parse an individual character to its cord atom representation. + +####Summary + Produce pose gonadified with: The slam of shim with 32 and 38, to parse any characters between them, inclusive. The slam of shim with 40 and 91, to parse any characters between them, inclusive. The slam of shim with 93 and 126, to parse any characters between them, inclusive. The slam of shim with 128 and 255, to parse any characters between them, inclusive. - --- + +####Examples + ~tadbyl-hilbel/try=> (scan "%" qit) 37 ~tadbyl-hilbel/try=> (scan "0" qit) @@ -5450,45 +5554,48 @@ section 2eH, parsing (idioms) 97 ~tadbyl-hilbel/try=> (scan "cord" (star qit)) ~[99 111 114 100] -++ qut - Parse - --- + +##++qut + +Parse + +####Summary + Slam ifix with: [soq soq] boss slammed with 256 and (most gon qit) - --- + +##++sym -++ sym - - --- - --- +##++ ven -++ ven - --- +##++vit - --- +Parse a text and produce its base 64 encoding + +####Summary -++ vit - Parse a text and produce its base 64 encoding - --- Build list of falling rules to match on with ';~' and pose. Encodes capital letters by - --- - section 2eI, parsing (external) -++ rash - Parse a cord with a given rule and crash if the cord isn't entirely parsed. - --- +##++rash + +Parse a cord with a given rule and crash if the cord isn't entirely parsed. + +####Summary + Build wet %gold gate with sample atom `naf`, rule `sab` Produce the slam of scan with: Trip slammed with `naf`, to turn `naf` into a tape. The rule `sab` - --- + +####Examples + ~tadbyl-hilbel/try=> (rash 'I was the world in which I walked, and what I saw' (star (shim 0 200))) "I was the world in which I walked, and what I saw" ~tadbyl-hilbel/try=> (rash 'abc' (just 'a')) @@ -5501,14 +5608,20 @@ section 2eI, parsing (external) ! {1 3} ! 'syntax-error' ! exit -++ rush - Parse a given with a given rule and produce null if the cord isn't entirely parsed. - --- + +##++rush + +Parse a given with a given rule and produce null if the cord isn't entirely parsed. + +####Summary + Build wet %gold gate with sample atom `naf`, rule `sab` Produce the slam of scan with: Trip slammed with `naf`, to turn `naf` into a tape. The rule `sab` - --- + +####Examples + ~tadbyl-hilbel/try=> (rush 'I was the world in which I walked, and what I saw' (star (shim 0 200))) [~ "I was the world in which I walked, and what I saw"] ~tadbyl-hilbel/try=> (rush 'abc' (just 'a')) @@ -5519,31 +5632,43 @@ section 2eI, parsing (external) ~ ~tadbyl-hilbel/try=> (rush 'abc' (jest 'ab')) ~ -++ rust - Parse a tape with a given rule and produce null if the tape isn't entirely parsed. - --- + +##++rust + +Parse a tape with a given rule and produce null if the tape isn't entirely parsed. + +####Summary + Build wet %gold gate with sample tape `los`, rule `sab` Push `vex` is the rule (full sab) slammed with the beginning of the `los` tape. If: `q.vex`, the parsed result, is null, Then: Produce null. Else: Produce the unit with value 'p.u.q.vex', the parsed text. - --- + +####Examples + ~tadbyl-hilbel/try=> (rust "I was the world in which I walked, and what I saw" (star (shim 0 200))) [~ "I was the world in which I walked, and what I saw"] ~tadbyl-hilbel/try=> (rust "Or heard or felt came not but from myself;" (star (shim 0 200))) [~ "Or heard or felt came not but from myself;"] ~tadbyl-hilbel/try=> (rust "And there I found myself more truly and more strange." (jest 'And there I')) ~ + ++ scan - Parse a tape with a given rule and crash if the tape isn't entirely parsed. - --- + +Parse a tape with a given rule and crash if the tape isn't entirely parsed. + +####Summary + Build wet %gold gate with sample tape `los`, rule `sab` Push `vex` is the rule (full sab) slammed with the beginning of the `los` tape. If: `q.vex` is null, Then: Add to the crash with message 'syntax-error''s trace: show slammed with [%m '{%d %d}'], `p.p.vex`, `q.p.vex`, and null Else: Produce the parsing output of `vex` - --- + +####Examples + ~tadbyl-hilbel/try=> (scan "I was the world in which I walked, and what I saw" (star (shim 0 200))) "I was the world in which I walked, and what I saw" ~tadbyl-hilbel/try=> (scan "Or heard or felt came not but from myself;" (star (shim 0 200))) @@ -5555,9 +5680,12 @@ section 2eI, parsing (external) section 2eJ, formatting (basic text) -++ cass - Produce the case insensitive (all lowercase) cord of a tape. - --- +##++cass + +Produce the case insensitive (all lowercase) cord of a tape. + +####Summary + Build wet %gold gate with sample tape `vib` Slam rap with: 3, to rap by bytes @@ -5567,7 +5695,9 @@ section 2eJ, formatting (basic text) Unless: `a` is greater than or equal to 'A' or less than or equal to 'Z', Then: Produce `a`, Else: Produce the difference between `a` and 32. - --- + +####Examples + ~tadbyl-hilbel/try=> (cass "john doe") 7.309.170.810.699.673.450 ~tadbyl-hilbel/try=> `cord`(cass "john doe") @@ -5576,9 +5706,13 @@ section 2eJ, formatting (basic text) 2.792.832.775.110.938.439.066.079.945.313 ~tadbyl-hilbel/try=> `cord`(cass "abc, 123, !@#") 'abc, 123, !@#' -++ cuss - Turn all occurances of lowercase letters in any tape into uppercase letters, as a cord. - --- + +##++cuss + +Turn all occurances of lowercase letters in any tape into uppercase letters, as a cord. + +####Summary + Build dry %gold gate with sample tape `vib` Yield cord Slam rap with: @@ -5589,7 +5723,9 @@ section 2eJ, formatting (basic text) Unless: `a` is greater than or equal to 'A' or less than or equal to 'Z', Then: Produce `a`, Else: Produce the difference between `a` and 32. - --- + +####Examples + ~tadbyl-hilbel/try=> (cuss "john doe") 'JOHN DOE' ~tadbyl-hilbel/try=> (cuss "abc ABC 123 !@#") @@ -5598,215 +5734,392 @@ section 2eJ, formatting (basic text) 4.407.873 ~tadbyl-hilbel/try=> (cuss "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsQqRrVvWwXxYyZz") 'AABBCCDDEEFFGGHHIIJJKKLLMMNNOOPPQQRRSSQQRRVVWWXXYYZZ' -++ crip - Produce the cord of a tape. - --- + +##++crip + +Produce the cord of a tape. + +####Summary + Build dry %gold with sample tape `a` Produce the rap of `a` by bytes, cast to a cord. - --- + +####Examples + ~tadbyl-hilbel/try=> (crip "john doe") 'john doe' ~tadbyl-hilbel/try=> (crip "abc 123 !@#") 'abc 123 !@#' ~tadbyl-hilbel/try=> `@ud`(crip "abc") 6.513.249 -++ mesc -++ runt -++ sand -++ sane -++ trim -++ trip -++ teff -++ turf -++ tuba -++ tufa -++ tuft -++ wack -++ wick -++ woad -++ wood + +##++mesc + +##++runt + +##++sand + +##++sane + +##++trim + +##++trip + +##++teff + +##++turf + +##++tuba + +##++tufa + +##++tuft + +##++wack + +##++wick + +##++woad + +##++wood section 2eK, formatting (layout) -++ re - ++ ram - ++ win - ++ din - ++ fit - ++ rig - ++ wig +##++re + +##++ram + +##++win + +##++din + +##++fit + +##++rig + +##++wig section 2eL, formatting (path) -++ ab - ++ bix - ++ hif - ++ huf - ++ hyf - ++ pev - ++ pew - ++ piv - ++ piw - ++ qeb - ++ qex - ++ qib - ++ qix - ++ seb - ++ sed - ++ sev - ++ sew - ++ sex - ++ sib - ++ siq - ++ sid - ++ siv - ++ siw - ++ six - ++ sov - ++ sow - ++ sox - ++ ted - ++ tip - ++ tiq - ++ tid - ++ til - ++ urs - ++ urt - ++ voy - ++ vym - ++ vyn -++ ag - ++ ape - ++ bay - ++ bip - ++ dem - ++ dim - ++ dum - ++ fed - ++ hex - ++ lip - ++ qut - ++ sym - ++ tyq - ++ viz - ++ vum - ++ wiz -++ co - ++ rear - ++ rent - ++ rend - ++ a-co - ++ d-co - ++ r-co - ++ s-co - ++ v-co - ++ w-co - ++ x-co - ++ y-co - ++ z-co - ++ em-co - ++ ox-co - ++ ro-co -++ ne - ++ d - ++ x - ++ v - ++ w -++ mu - ++ zag - ++ zig - ++ zug -++ so - ++ bisk - ++ crub - ++ nuck - ++ nusk - ++ perd - ++ royl - ++ tash - ++ twid - ++ zust -++ scot -++ scow -++ slav -++ slaw -++ slay -++ smyt +##++ab + +##++bix + +##++hif + +##++huf + +##++hyf + +##++pev + +##++pew + +##++piv + +##++piw + +##++qeb + +##++qex + +##++qib + +##++qix + +##++seb + +##++sed + +##++sev + +##++sew + +##++sex + +##++sib + +##++siq + +##++sid + +##++siv + +##++siw + +##++six + +##++sov + +##++sow + +##++sox + +##++ted + +##++tip + +##++tiq + +##++tid + +##++til + +##++urs + +##++urt + +##++voy + +##++vym + +##++vyn + +##++ag + +##++ape + +##++bay + +##++bip + +##++dem + +##++dim + +##++dum + +##++fed + +##++hex + +##++lip + +##++qut + +##++sym + +##++tyq + +##++viz + +##++vum + +##++wiz + +##++co + +##++rear + +##++rent + +##++rend + +##++a-co + +##++d-co + +##++r-co + +##++s-co + +##++v-co + +##++w-co + +##++x-co + +##++y-co + +##++z-co + +##++em-co + +##++ox-co + +##++ro-co + +##++ne + +##++d + +##++x + +##++v + +##++w + +##++mu + +##++zag + +##++zig + +##++zug + +##++so + +##++bisk + +##++crub + +##++nuck + +##++nusk + +##++perd + +##++royl + +##++tash + +##++twid + +##++zust + +##++scot + +##++scow + +##++slav + +##++slaw + +##++slay + +##++smyt section 2eM, regular-expressions -++ pars -++ nor -++ les -++ lep -++ alm -++ alb -++ mis -++ anns -++ mall -++ bets -++ ranc -++ flap -++ rang -++ chun -++ seac -++ sead -++ sade -++ seap -++ cape -++ lower -++ upper -++ digit -++ print -++ graph -++ blank -++ space -++ cntrl -++ alpha -++ alnum -++ punct -++ wordc -++ white -++ xdigi -++ chad -++ escd -++ escp -++ unid -++ proc -++ cont -++ abor -++ matc -++ chet -++ blak -++ deep -++ rexp -++ repg +##++pars + +##++nor + +##++les +##++lep + +##++alm + +##++alb + +##++mis + +##++anns + +##++mall + +##++bets + +##++ranc + +##++flap + +##++rang + +##++chun + +##++seac + +##++sead + +##++sade + +##++seap + +##++cape + +##++lower + +##++upper + +##++digit + +##++print + +##++graph + +##++blank + +##++space + +##++cntrl + +##++alpha + +##++alnum + +##++punct + +##++wordc + +##++white + +##++xdigi + +##++chad + +##++escd + +##++escp + +##++unid + +##++proc + +##++cont + +##++abor + +##++matc + +##++chet + +##++blak + +##++deep + +##++rexp + +##++repg section 2eN, pseudo-cryptography -++ un - ++ wre - ++ wre - ++ xaf - ++ xar - ++ zaf - ++ zar - ++ zyf - ++ zyr +##++un + +##++wre + +##++wre + +##++xaf + +##++xar + +##++zaf + +##++zar + +##++zyf + +##++zyr section 2eO, virtualization -++ mack - Accpet a nock subject-formula cell. - Produce a unit result, treating 11 as a crash (i.e. pure nock). - --- +##++mack + +Accpet a nock subject-formula cell. +Produce a unit result, treating 11 as a crash (i.e. pure nock). + +####Summary + Creates a dry %gold gate accepting cell ['sub' 'fol']. Its output is a unit (of a noun). Let 'ton' be the result of minking the sample, with a sky that produces ~ on any input, halting interpretation. Unless ton has stem 0, produce the empty unit, otherwise produce one containing ton's bulb. - --- + +####Examples + ~zod/try=> (mack [[1 2 3] [0 1]]) [~ [1 2 3]] ~zod/try=> (mack [41 4 0 1]) @@ -5817,10 +6130,13 @@ section 2eO, virtualization [~ 6] ~zod/try=> ;;((unit ,@tas) (mack [[1 %yes %no] 6 [0 2] [0 6] 0 7])) [~ %no] -++ mink - XX - Description: - Bottom-level mock (virtual nock) interpreter. + +##++mink + +Bottom-level mock (virtual nock) interpreter. + +####Summary + Accepts a nock subject-formula cell, and an %iron gate which accepts any noun and produces a unit, which is defined to be mock 11. Produces a ++tone, which is the result of the virtualized computation. @@ -5891,17 +6207,23 @@ section 2eO, virtualization Tail-recur with fol replaced by d and tax prepended with a pair of b and the bulb of ben. Else tail-recur with just fol replaced by d. - Examples: + +####Examples + XX -++ mock - XX - Description: - Accepts a nock subject-formula cell and an %iron gate which - accepts any noun and produces a unit (this is used as nock 11). - Produces a ++toon, which is a sucesful, blocked, or crashed result. - --- + +##++mock + +Accepts a nock subject-formula cell and an %iron gate which +accepts any noun and produces a unit (this is used as nock 11). +Produces a ++toon, which is a sucesful, blocked, or crashed result. + +####Summary + Compose ++mook and ++mink. - Examples + +####Examples + ~zod/try=> (mock [5 4 0 1] ,~) [%0 p=6] ~zod/try=> (mock [~ 11 1 0] |=(* `999)) @@ -5917,10 +6239,12 @@ section 2eO, virtualization ~zod/try=> ;;(tape +:(mock [[[4 4 4 4 0 3] 10] 11 9 2 0 1] |=(* `[<+<>]))) "14" -++ mook - XX - Description: - Intelligently render crash annotation. +####++mook + +Intelligently render crash annotation. + +####Summary + Accepts a ++tone, produces a ++toon --- Create a dry %gold gate accepting a tone we name 'ton' @@ -5963,7 +6287,8 @@ section 2eO, virtualization [ [ q.p]] in the pint in sot rendered as @ud "]>" - Examples +####Examples + ~zod/try=> (mook [%0 5 4 5 1]) [%0 p=[5 4 5 1]] ~zod/try=> (mook [%2 ~[[%hunk %rose ["<" "," ">"] ~[[%leaf "err"]]]]]) @@ -5972,52 +6297,26 @@ section 2eO, virtualization [%2 p=~[[%leaf p="do print"]]] ~zod/try=> (mook [%2 ~[[%spot /b/repl [[1 1] 1 2]] [%mean |.(!!)]]]) [%2 p=~[[%leaf p="/b/repl/:<[1 1].[1 2]>"] [%leaf p="####"]]] -++ mang - XX - Description: - XX - --- - XX - Examples - XX -++ mong - XX - Comment: - XX - Description: - Mang is just like mack, but accepting a sky. - It produces a unit computation result. - --- + +####++mang + +Mang is just like mack, but accepting a sky. +It produces a unit computation result. + +####Summary + Creates a dry %gold gate accepting cell ['sub' 'fol'] and an %iron unit-clam 'sky'. Its output is a unit (of a noun). Let 'ton' be the result of monging the sample. Unless ton has stem 0, produce the empty unit, otherwise produce one containing ton's bulb. -++ mung - XX - Description: - XX - --- - XX - Examples - XX -++ mule - XX - Description: - XX - --- - XX - Examples - XX -++ mute - XX - Description: - XX - --- - XX - Examples - XX + +##++mung + +##++mule + +##++mute section 2eP, diff **noted as "(move me)" in source** From 9684ef85bb6367cad6e5b94bb1c78452017087dd Mon Sep 17 00:00:00 2001 From: John Dulin Date: Fri, 8 Aug 2014 18:36:08 -0700 Subject: [PATCH 07/34] Markdownified parsing, containers, formatting. --- main/pub/src/doc/ref/vol2.md | 1794 ++++++++++++++++++++++++---------- 1 file changed, 1297 insertions(+), 497 deletions(-) diff --git a/main/pub/src/doc/ref/vol2.md b/main/pub/src/doc/ref/vol2.md index e08fcd8770..204b686302 100644 --- a/main/pub/src/doc/ref/vol2.md +++ b/main/pub/src/doc/ref/vol2.md @@ -2710,16 +2710,19 @@ section 2cI, almost macros [~ 'Tape to cord, Woohoo!'] ~tadbyl-hilbel/try=> ((soft ,@t) (trip 'Cmon man... Tape to cord? Please?!')) ~ - + +--- chapter 2d, containers section 2dA, sets +--- -++ apt - set invariant - Description: - Accepts any tree and produces a loobean indicating whether the tree is a set. - --- +##++ apt + +Accept any tree and produce a loobean indicating whether the tree is a set. + +####Summary + Creates a dry %gold gate which accepts a tree. Builds an if-then-else statement on "a is an atom." If so, produce true. @@ -2729,7 +2732,9 @@ section 2dA, sets The if "r.a is an atom" then produce true, else (produce the logical AND of the v-order of n.a and n.r.a and the h-order of n.a and n.r.a) if-then-else statement. (==) terminates the tall logical AND statement. - Examples + +####Examples + ~tadbyl-hilbel/try=> =b (sa `(list ,@t)`['john' 'bonita' 'daniel' 'madeleine' ~]) ~tadbyl-hilbel/try=> (apt b) %.y @@ -2739,19 +2744,26 @@ section 2dA, sets {[p='d' q=5] [p='a' q=1] [p='c' q=4] [p='b' q=[2 3]]} ~tadbyl-hilbel/try=> (apt m) %.y -++ in - set engine - Description: + +--- + +##++ in + Container arm for set operation arms. The contained arms inherit it's sample set, 'a'. - --- + +####Summary + Activate jet. Creates a %gold trap with sample 'a', a set. - +- all - logical AND - Description: - Accepts a gate which accepts any noun and produces a loobean. Slams the gate with each member - of set 'a', produce the logical AND of the transformed set. - --- +--- + +##+- all + +Accept a gate which accepts any noun and produce a loobean. Slam the gate with each member +of set 'a', produce the logical AND of the transformed set. + +####Summary + Activate jet. Creates a wet %gold gate which accepts any gate which produces a loobean. Creates and kicks a dry %gold gate, casts the result to a loobean. @@ -2759,19 +2771,25 @@ section 2dA, sets If so, produce true. Else, produce the logical AND of (b n.a) and the recursive calls of the trap with 'a' replaced by 'l.a' and 'a' replaced by 'r.a'. - Examples: + +####Examples + ~dovryp-toblug/try=> =b (sa `(list ,[@t *])`[['a' 1] ['b' [2 3]] ~]) ~dovryp-toblug/try=> (~(all in b) |=(a=* ?@(-.a & |))) %.n ~tadbyl-hilbel/try=> =b (sa `(list ,@t)`['john' 'bonita' 'daniel' 'madeleine' ~]) ~tadbyl-hilbel/try=> (~(all in b) |=(a=@t (gte a 100))) %.y - +- any - logical OR - Description: - Accepts a gate which accepts any noun and produces a loobean. Slams the gate with each member - of set 'a', produce the logical OR of the transformed set. - --- + +--- + +##+- any + +Accept a gate which accepts any noun and produce a loobean. Slam the gate with each member +of set 'a', produce the logical OR of the transformed set. + +####Summary + Activate jet. Creates a wet %gold gate which accepts any gate which produces a loobean. Creates and kicks a dry %gold gate, casts the result to a loobean. @@ -2779,18 +2797,24 @@ section 2dA, sets If so, produce false. Else, produce the logical OR of (b n.a) and the recursive calls of the trap with 'a' replaced by 'l.a' and 'a' replaced by 'r.a'. - Examples: + +####Examples: + ~dovryp-toblug/try=> =b (sa `(list ,[@t *])`[['a' 1] ['b' [2 3]] ~]) ~dovryp-toblug/try=> (~(any in b) |=(a=* ?@(+.a & |))) %.y ~tadbyl-hilbel/try=> =b (sa `(list ,@t)`['john' 'bonita' 'daniel' 'madeleine' ~]) ~tadbyl-hilbel/try=> (~(any in b) |=(a=@t (lte a 100))) %.n - +- del - b without any a - Description: - Accepts any noun 'b' and removes it from the set 'a'. - --- + +--- + +##+- del + +Accept any noun 'b' and removes it from the set 'a'. + +####Summary + Activate jet. Creates a wet %gold gate which accepts any noun. Creates and kicks a dry %gold gate, casts the result to the type of 'a'. @@ -2800,7 +2824,9 @@ section 2dA, sets If so, build an if-then-else statement by testing the h-order of 'b' and 'n.a'. If so, produce a the cell [n.a $(a l.a) r.a], where $(a l.a) is the recursive call of the trap with 'a' replaced by the left - Examples: + +####Examples + ~dovryp-toblug/try=> =b (sa `(list ,@t)`[`a` `b` `c` ~]) ~dovryp-toblug/try=> (~(del in b) `a`) {`c` `b`} @@ -2812,20 +2838,27 @@ section 2dA, sets ~tadbyl-hilbel/try=> (~(del in b) 'susan') {'bonita' 'madeleine' 'daniel' 'john'} - +- dig - axis of b in a - Description: - Produces - --- +--- + +##+- dig + +Produce the axis of the noun `b` within the set `a`. + +####Summary + Creates a dry %gold gate which accepts a single noun. Let 'c' be 1. Creates and kicks a dry %gold trap. Casts the result to an atomic unit. Builds an if-then-else statement on "a is null." If so, produce null. Else, build an if-then-else statement on (b=n.a). If so, produce the unit [~ u=(peg c 2)]. Else, build an if-then-else statement on the g-order of 'b' and 'n.a' - If so, produce the recursive call of the trap with 'a' replaced by 'l.a' and 'c' replaced by (peg c 6). - Else, produce the recursive call of the trap with 'a' replaced by 'r.a' and 'c' replaced by (peg c 7). - Examples: + If so, produce the recursive call of the trap with 'a' + replaced by 'l.a' and 'c' replaced by (peg c 6). + Else, produce the recursive call of the trap with 'a' + replaced by 'r.a' and 'c' replaced by (peg c 7). + +####Examples + ~talsur-todres/try=> =a (sa `(list ,@)`[1 2 3 4 5 6 7 ~]) ~talsur-todres/try=> a {5 4 7 6 1 3 2} @@ -2837,12 +2870,16 @@ section 2dA, sets [~ 14] ~talsur-todres/try=> (~(dig in a) 6) [~ 2] - +- gas - concatenate - Description: - Accepts a list 'b' with members of the same type as the set 'a' and produces - the union set of 'a' and 'b'. - --- + +--- + +##+- gas + +Accept a list 'b' with members of the same type as the set 'a' and produce +the union set of 'a' and 'b'. + +####Summary + Activate jet. Creates a dry %gold gate which accepts a list of elements of the same type as 'a'. Creates and kicks a dry %gold trap whose result is cast to the type of 'a'. @@ -2850,7 +2887,9 @@ section 2dA, sets If so, produce 'a'. Else, recursively call the trap with 'b' replaced by the tail of 'b' and the head of 'b' put into 'a'. - Examples: + +####Examples + ~tadbyl-hilbel/try=> b {'bonita' 'madeleine' 'rudolf' 'john'} ~tadbyl-hilbel/try=> (~(gas in b) `(list ,@t)`['14' 'things' 'number' '1.337' ~]) @@ -2858,11 +2897,15 @@ section 2dA, sets --- ~tadbyl-hilbel/try=> (~(gas in s) `(list ,@t)`['1' '2' '3' ~]) {'1' '3' '2' 'e' 'd' 'a' 'c' 'b'} - +- has - b exists in a check - Description: - Accepts any noun and produces the loobean indicating whether or not that value (n.a) exists in 'a'. - --- + +--- + +##+- has + +Accepts any noun and produces the loobean indicating whether or not that value (n.a) exists in 'a'. + +####Summary + Activate jet. Creates a wet %gold gate which accepts any noun. Creates and kicks a dry %gold trap. Casts the result to a loobean. @@ -2872,15 +2915,23 @@ section 2dA, sets Else, build an if-then-else statement on the h-order of 'b' and 'n.a' If so, produce the recursive call to the trap with 'a' replaced by 'l.a' If so, produce the recursive call to the trap with 'a' replaced by 'r.a' - Examples: + +####Examples + ~dovryp-toblug/try=> =a (~(gas in `(set ,@t)`~) `(list ,@t)`[`a` `b` `c` ~]) ~dovryp-toblug/try=> (~(has in a) `a`) %.y ~dovryp-toblug/try=> (~(has in a) 'z') %.n - +- put - Accept any noun 'b' and produce the set 'a' with 'b' added to its sorted location. - --- + +--- + +##+- put + +Accept any noun 'b' and produce the set 'a' with 'b' added to its sorted location. + +####Summary + Activate jet. Creates a wet %gold gate which accepts any atom. Creates and kicks a dry %gold gate. Casts the result to the type of set 'a'. @@ -2900,16 +2951,24 @@ section 2dA, sets Builds an if-then-else statement on the v-order of 'n.a' and 'n.c' If so, produce [n.a l.a c] Else, produce [n.c [n.a l.a l.c] r.c]. - Examples: + +####Examples + ~talsur-todres/try=> =a (~(gas in `(set ,@t)`~) `(list ,@t)`[`a` `b` `c` ~]) ~talsur-todres/try=> =b (~(put in a) `d`) ~talsur-todres/try=> b {`d` `a` `c` `b`} ~talsur-todres/try=> -.l.+.b n=`d` - +- rep - Accept a noun and a binary gate. Produce the 'a' with each member 'n.a' replaced by (c n.a b). - --- + +--- + +##+- rep + +Accept a noun and a binary gate. Produce the 'a' with each member 'n.a' replaced by (c n.a b). + +####Summary + XXX Creates a wet %gold gate which accpets a noun and a tile, 'a' and 'b'. Creates and kicks a dry %gold gate. @@ -2917,18 +2976,23 @@ section 2dA, sets Else, recursively call the trap with 'a' replaced by 'r.a' and 'b' replaced by the recursive call of the trap with 'a' replaced by 'l.a' and 'b' replaced by (c n.a b). - --- + +####Examples + ~talsur-todres/try=> =a (~(gas in *(set ,@)) [1 2 3 ~]) ~talsur-todres/try=> a {1 3 2} ~talsur-todres/try=> (~(rep in a) 0 |=([a=@ b=@] (add a b))) 6 - --- - XXX - - +- tap - Accept a list of elements of the set and produce a cell of the set with the list concatenated. - --- + +--- + +##+- tap + +Accept a list of elements of the set and produce a cell of the set with the list concatenated. + +####Summary + Activate jet. Build dry %gold gate with sample list of the same Cast the following to the type of `b` @@ -2936,21 +3000,27 @@ section 2dA, sets Then: Produce `b`, Else: Produce the toss of `a` for `r.a`, `b` for [n.a $(a l.a)]), where $(a l.a) is the toss of `a` for the left twig of `a`. - --- + +####Examples + ~tadbyl-hilbel/try=> =s (sa `(list ,@t)`['a' 'b' 'c' 'd' 'e' ~]) ~tadbyl-hilbel/try=> s {'e' 'd' 'a' 'c' 'b'} - --- ~tadbyl-hilbel/try=> (~(tap in s) `(list ,@t)`['1' '2' '3' ~]) ~['b' 'c' 'a' 'd' 'e' '1' '2' '3'] - --- ~tadbyl-hilbel/try=> b {'bonita' 'madeleine' 'daniel' 'john'} ~tadbyl-hilbel/try=> (~(tap in b) `(list ,@t)`['david' 'people' ~]) ~['john' 'daniel' 'madeleine' 'bonita' 'david' 'people'] - +- wyt - Produce the cardinality (number of elements) of the set. - --- + +--- + +##+- wyt + +Produce the cardinality (number of elements) of the set. + +####Summary + Increment the following. Kick dry %gold trap. Yield atom. If: `a` is null, @@ -2958,17 +3028,20 @@ section 2dA, sets Else: Produce the increment of the sum of: The toss of `a` for `l.a`, the left twig of `a`. The toss of `a` for `r.a`, the right twig of `a`. - --- + +####Examples + ~talsur-todres/try=> =a (~(gas in `(set ,@t)`~) `(list ,@t)`[`a` `b` `c` ~]) ~talsur-todres/try=> ~(wyt in a) 4 - --- ~tadbyl-hilbel/try=> b {'bonita' 'madeleine' 'daniel' 'john'} ~tadbyl-hilbel/try=> ~(wyt in b) 5 -section 2dB, maps +--- +section 2dB, maps +--- ##++ ept @@ -3003,6 +3076,9 @@ Is the given tree of cell pairs a map? ~tadbyl-hilbel/try=> (ept b) ! type-fail ! exit + +--- + ##++ ja The jar engine: A container arm for jar operation arms. Jars are maps of lists. @@ -3010,6 +3086,8 @@ The contained arms inherit the sample jar. 'a'. Build a wet %gold tray with a sample jar `a`... +--- + ##+- get Retrieve a list from the map by its key. @@ -3034,6 +3112,8 @@ Retrieve a list from the map by its key. ~zod/try=> (~(get ja l) 'c') ~ +--- + ##+- add Add a key-list value to the jar. @@ -3059,8 +3139,12 @@ Add a key-list value to the jar. ! type-fail ! exit +--- + Terminate the core. +--- + ##++ ju The jug engine: container arm for jug operation arms. Jugs are maps of sets. @@ -3091,6 +3175,8 @@ Delete a value in a set and produce the resulting jug. ~zod/try=> (~(del ju s) 'c' 7) {[p='a' q={1 3 2}] [p='b' q={5 4 6}]} +--- + +- get Retrieve a set from the map by its key. @@ -3114,6 +3200,8 @@ Retrieve a set from the map by its key. ~zod/try=> (~(get ju s) 'c') ~ +--- + ##+- has Is the element `c` in the set `b`? @@ -3144,6 +3232,8 @@ Is the element `c` in the set `b`? ~zod/try=> (~(has ju s) 'c' 7) %.n +--- + ##+- put Add a value to a specific set in the jug. @@ -3168,6 +3258,8 @@ Add a value to a specific set in the jug. ~zod/try=> (~(put ju s) 'c' 7) {[p='a' q={1 3 2}] [p='c' q={7}] [p='b' q={5 4 6}]} +--- + ##++ by Container arm for map operation arms. The contained arms inherit it's sample map, 'a'. @@ -3177,6 +3269,8 @@ Container arm for map operation arms. The contained arms inherit it's sample ma Activate jet. Build a %gold tray with a sample which accepts a map. +--- + ##+- all Accept a gate which accepts any noun and produces a loobean. Slams the gate with each member @@ -3206,6 +3300,8 @@ of map 'a', produce the logical AND of the transformed map. ~tadbyl-hilbel/try=> (~(all by a) |=(a=@ (lte a 4))) %.n +--- + ##+- any Accept a gate which accepts any noun and produces a loobean. Slam the gate with each member @@ -3232,6 +3328,8 @@ of map 'a' and produce the logical OR of the transformed map. ~tadbyl-hilbel/try=> (~(any by a) |=(a=@ (lte a 4))) %.y +--- + ##+- del Accept a noun 'b', producing the map with the key-value pair of key 'b' removed. @@ -3260,6 +3358,8 @@ Accept a noun 'b', producing the map with the key-value pair of key 'b' removed. ~talsur-todres/try=> (~(del by b) `a`) {[p=`b` q=[2 3]]} +--- + ##+- dig Accept any noun 'b' and produce the axis of 'b' in within the values of 'p.a' in map 'a'. @@ -3281,6 +3381,8 @@ Accept any noun 'b' and produce the axis of 'b' in within the values of 'p.a' in ~talsur-todres/try=> (~(dig by b) `b`) [~ 2] +--- + ##+- gas Accept any list 'b' of key-value pair cells and produce the map 'a' @@ -3304,6 +3406,8 @@ with the members of 'b' added. ~talsur-todres/try=> (~(gas by a) b) {[p=`d` q=4] [p=`a` q=1] [p=`c` q=3] [p=`b` q=2]} +--- + ##+- get Produce the value in the map at key 'b'. @@ -3327,6 +3431,8 @@ Produce the value in the map at key 'b'. ~talsur-todres/try=> (~(get by b) `b`) [~ [2 3]] +--- + ##+- got ####Summary @@ -3347,6 +3453,7 @@ Produce the value in the map at key 'b'. ~zod/try=> (~(got by m) 'c') ! exit +--- ##+- has @@ -3367,6 +3474,8 @@ Accept any noun 'b' and produces the loobean indicating whether the noun exists ~talsur-todres/try=> (~(has by b) `c`) %.n +--- + ##+- int Produce the intersection of two maps of the same type. @@ -3406,7 +3515,8 @@ Produce the intersection of two maps of the same type. ~zod/try=> (~(int by m) o) {} - +--- + ##+- mar Accept a noun and a unit of a noun of the type of the map's keys and values, respectively. @@ -3423,7 +3533,23 @@ delete the key. ####Examples - + XXX This arm appears to be broken. + ~zod/try=> m + {[p='a' q=1] [p='b' q=2]} + ~zod/try=> (~(mar by m) 'c' (some 3)) + ! -find-limb.n + ! find-none + ! exit + ~zod/try=> (~(mar by m) 'c' ~) + ! -find-limb.n + ! find-none + ! exit + ~zod/try=> (~(mar by m) 'b' ~) + ! -find-limb.n + ! find-none + ! exit + +--- ##+- put @@ -3450,6 +3576,8 @@ Add a key-value pair to the map. ~zod/try=> (~(put by m) 'a' 2) {[p='a' q=2] [p='b' q=2]} +--- + ##+- rep Walk through the map, replacing 'b' with the product of (c n.a b). Produce the resulting @@ -3465,7 +3593,8 @@ map. ####Examples - +--- + ##+- rib @@ -3488,20 +3617,25 @@ the transformed map with the accumulated. `b`. ####Examples + +--- - - +- run +##+- run ####Summary ####Examples - +- tap +--- + +##+- tap ####Summary ####Examples +--- + ##+- uni Produce the union between two maps. @@ -3551,6 +3685,8 @@ Produce the union between two maps. ~zod/try=> (~(uni by o) n) {[p='d' q=4] [p='a' q=1] [p='c' q=3]} +--- + ##+- urn Turn over the values of the map and produce the tranformed map. @@ -3577,6 +3713,8 @@ Turn over the values of the map and produce the tranformed map. ~zod/try=> (~(urn by m) |=(a=[p=* q=*] p.a)) {[p='a' q=97] [p='b' q=98]} +--- + ##+- wyt Produce the depth of the tree map. @@ -3604,19 +3742,24 @@ Produce the depth of the tree map. ~zod/try=> ~(wyt by (~(uni by m) o)) 5 +--- + section 2dC, queues -++ to - queue engine - Description: - Container arm for queue operation arms. The contained arms inherit it's sample queue, 'a'. - --- - Builds a wet %gold tray with sample 'a' of type 'qeu'. - +- bal - v-order queue - Description: - Walks through the queue using vor (v-order check) on all eleements. - --- +##++ to + +Container arm for queue operation arms. The contained arms inherit it's sample queue, 'a'. + +####Summary + + Build wet %gold tray with sample 'a' of type 'qeu'. + +##+- bal + +Walks through the queue using vor (v-order check) on all eleements. + +####Summary + Creates and kicks a dry %gold trap. Casts the result to the type of the queue 'a'. If "a is null", produce null. Else, build an unless-then-else statement on the logical OR of: @@ -3627,24 +3770,30 @@ section 2dC, queues "null is in r.a" "n.a" precedes "n.r.a" in v-order. If so, produce the recursvie call to the trap with 'a' replaced by [n.r.a $(a [n.a l.a l.r.a]) r.r.a]. - Examples: + +####Examples + ~palryp-hocsyt/try=> =a (~(gas to `(qeu ,@)`~) `(list ,@)`[6 1 3 6 1 3 4 6 ~]) ~palryp-hocsyt/try=> a {6 4 3 1 6 3 1 6} ~palryp-hocsyt/try=> ~(bal to a) {6 4 3 1 6 3 1 6} - --- - +- dep - max depth of queue - Description: - Produces the maximum depth of leaves (r.a and l.a) in the queue 'a'. - --- +--- + +##+- dep + +Produce the maximum depth of leaves (r.a and l.a) in the queue 'a'. + +####Summary + Creates and kicks a dry %gold trap. Casts the result to an atom. If "a is null", produce 0. Else, increment the maximum of the recursive calls of the 'dep' to the left and right leaves of 'a', $(a l.a) and $(a r.a). - Examples: + +####Examples + ~palryp-hocsyt/try=> =a (~(gas to `(qeu ,@)`~) `(list ,@)`[1 2 3 4 5 6 7 ~]) ~palryp-hocsyt/try=> ~(dep to a) 4 @@ -3656,29 +3805,40 @@ section 2dC, queues ~palryp-hocsyt/try=> =a (~(gas to `(qeu ,@)`~) `(list ,@)`[1 2 ~]) ~palryp-hocsyt/try=> ~(dep to a) 2 - +- gas - insert list to que - Description: - Accepts a - --- + +--- + +##+- gas + +Accept a list `b` of elements of the type of the queue `a` elements and produce the queue +`a` with the elements of `b` added. + +####Summary + Creates a dry %gold gate which accepts a list of the elements of the queue. Creates and kicks a dry %gold gate. Casts the result to the type of 'a', the queue. If "b is null", produce 'a'. Else, Produce the recursive call to the trap with 'b' replaced by the tail of 'b' and 'a' replaced by the result of putting the head of 'b' into 'a'. - Examples: + +####Examples + ~palryp-hocsyt/try=> (~(gas to `(qeu ,@)`~) `(list ,@)`[1 2 3 ~]) {3 2 1} --- ~palryp-hocsyt/try=> =a (~(gas to `(qeu ,@)`~) `(list ,@)`[1 2 3 ~]) ~palryp-hocsyt/try=> =b `(list ,@)`[4 5 6 ~] ~palryp-hocsyt/try=> (~(gas to a) b) - {6 5 4 3 2 1} - +- get - head-tail pair - Description: - Produces the queue 'a' in the format [p=head q=tail]. - --- + {6 5 4 3 2 1} + +--- + +##+- get + +Produces the queue 'a' in the format [p=head q=tail]. + +####Summary + Creates and kicks a dry %gold trap. Casts the head term of the resulting tuple to the type of the queue's elements and the tail type to that of the queue itself. If "a is null", crash the program. @@ -3690,18 +3850,24 @@ section 2dC, queues If "null is in q.b" OR 'n.a' precedes 'n.q.b' in the v-order, produce [n.a l.a q.b]. Else, produce [n.q.b [n.a l.q.b] r.q.b]. - Examples: - - +- nap - removes head - Description: - Removes the head of a queue, producing the resulting queue. - --- + +####Examples + +--- + +##+- nap + +Remove the head of a queue and produce the resulting queue. + +####Summary + Assert that 'a' is a cell. Builds an if-then-else statement on "l.a is null". If so, produce r.a. Else, let 'b' be the result of getting the [p=head q=tail] pair from 'l.a'. Produce the queue v-order of bal(+< ^+(a [p.b q.b r.a])). - Examples: + +####Examples + ~talsur-todres/try=> =a (~(gas to `(qeu ,@)`~) `(list ,@)`[1 2 3 4 5 6 ~]) ~talsur-todres/try=> -.a n=6 @@ -3712,93 +3878,131 @@ section 2dC, queues {5 4 3 2 1} ~talsur-todres/try=> a {6 5 4 3 2 1} - +- put - insert new head - Description: - Accepts any noun and adds to the queue as the head, producing the resutling queue. - --- + +--- + +##+- put + +Accept any noun and adds to the queue as the head, producing the resutling queue. + +####Summary + Creates a wet %gold gate which accepts any noun. Creates and kicks a dry %gold trap. Casts the result to the type of the queue 'a'. If "a is null", produce [b ~ ~]. Else, produce bal(+< a(l $(a l.a))). - Examples: +####Examples + ~dovryp-toblug/try=> (~(gas to `(qeu ,@)`~) `(list ,@)`[3 1 2 4 5 6 ~]) ~dovryp-toblug/try=> (~(put to a) 7) {7 6 5 4 2 1 3} + +--- + +- tap - adds list to end - Description: - Concatenates two lists from the first - --- + +Concatenates two lists from the first + +####Summary + Creates a dry %gold gate which accepts a list of elements of the type of the queue's elements. Casts the result to the type of 'b', the list. If "a is null", produce 'b'. Else, produce the recursive call to the gate with 'a' replaced by 'r.a' and 'b' replaced by [n.a $(a l.a)], where $(a l.a) is the recursive call to the trap with 'a' replaced by 'l.a'. - Examples: + +#### Examples + ~dovryp-toblug/try=> =a (~(gas to `(qeu ,@)`~) `(list ,@)`[3 1 2 4 5 6 ~]) ~dovryp-toblug/try=> (~(tap to a) `(list ,@)`[99 100 101 ~]) ~[3 1 2 4 5 6 99 100 101] - +- top - produces head - Description: - - --- + +--- + +##+- top + +####Summary + Creates and kicks a dry %gold trap. Casts the result to a unit of the type of the queue's element. If "a is null", produce null. Else, if "the right leaf of 'a' is null", produce [~ n.a]. Else, produce $(a r.a), the recursive call to the trap with 'a' replaced by 'r.a'. - Examples: + +####Examples + ~talsur-todres/try=> =a (~(gas to `(qeu ,@)`~) `(list ,@)`[1 2 3 4 5 6 ~]) ~talsur-todres/try=> ~(top to a) [~ 1] +--- + section 2dD, casual containers -++ mo - make a map - Description: - Mapifiy. Accepts a list of cells and produces a map of key-value pairs from the left-right cell pairs of the list. - --- +--- + +##++ mo + +Mapifiy. Accepts a list of cells and produces a map of key-value pairs from the left-right cell pairs of the list. + +####Summary + Creates a wet %gold gate which accepts a list, 'a'. Pushes the homogenized list onto the context. Casts the list 'a' to a list of cells whose left-right types correspond to the key-value type pairs. Let 'b' be the bunt of the map with the properly typed keys and values from the cell at the head of our list. Concatenate the elements of 'a' into the empty map of bunt 'b', and produce the result. - Examples: + +####Examples + ~talsur-todres/try=> (mo `(list ,[@t *])`[[`a` 1] [`b` 2] ~]) {[p=`a` q=1] [p=`b` q=2]} + +---- -++ sa - make a set - Description: - Setify. Accepts a list and produces a set of the list's elements. - --- +##++ sa + +Setify. Accepts a list and produces a set of the list's elements. + +####Summary + Creates a wet %gold gate which accepts a list, 'a'. Pushes the homogenized list onto the context. Let 'b' be the bunt of the set with elements of the same type of the elements of 'a'. Concatenate the elements of 'a' into the empty set of bunt 'b', and produce the result. - Examples: + +####Examples + ~talsur-todres/try=> (sa `(list ,@)`[1 2 3 4 5 ~]) {5 4 1 3 2} --- ~talsur-todres/try=> (sa `(list ,[@t *])`[[`a` 1] [`b` 2] ~]) {[`a` 1] [`b` 2]} -++ qu - make a set - Description: - XXX THIS APPEARS TO BE A COPY OF ++sa. QUEUIFY IS NOT IMPLEMENTED YET. XXX - --- - Examples: + +---- + +##++ qu + +XXX THIS APPEARS TO BE A COPY OF ++sa. QUEUIFY IS NOT IMPLEMENTED YET. XXX + +####Summary + +####Examples + +--- chapter 2e, miscellaneous libs section 2eA, packing - -++ cue - Unpack an atom to a noun. The inverse of jam. - --- + +--- + +##++ cue + +Unpack an atom to a noun. The inverse of jam. + +####Summary + Activate jet. Build dry %gold gate with sample atom `a`. Yield noun. @@ -3809,8 +4013,9 @@ section 2eA, packing If (0=(cut 0 [b 1] a)), Then, push `c` is (rub +(b) a). Produce - - --- + +####Examples + ~midlys-rocpet/try=> (cue (jam 1)) 1 ~midlys-rocpet/try=> (cue 4.657) @@ -3819,25 +4024,38 @@ section 2eA, packing [1 1] ~tadbyl-hilbel/try=> (cue 39.689) [0 19] -++ jam - Compress a noun to an atom. The inverse of cue. - --- + +--- + +##++ jam + +Compress a noun to an atom. The inverse of cue. + +####Summary + Activate jet. Build wet %gold gate with sample noun `a`. Yield atom. Push `b` is 0. Push `m` is empty may of type (map ,@ ,*). - --- +####Examples + ~midlys-rocpet/try=> (jam 1) 12 ~midlys-rocpet/try=> (jam [1 1]) 817 ~tadbyl-hilbel/try=> (jam [~ u=19]) 39.689 -++ mat - Encodes length. Only used internally as helper function to jam and cue. - --- + +--- + +##++ mat + +Encodes length. Only used internally as helper function to jam and cue. + +####Summary + Activate jet. Build dry %gold gate with sample atom a. Yield atom a, atom b. @@ -3848,9 +4066,17 @@ section 2eA, packing Produce pair: (add (add c c) b) and (cat 0 (bex c) (mix (end 0 (dec c) b) (lsh 0 (dec c) a))) -++ rub - Decodes length. Only used internally as a helper function to jam and cue. - --- + +####Examples + +--- + +##++ rub + +Decodes length. Only used internally as a helper function to jam and cue. + +####Summary + Activate jet. Build wet %gold gold with sample atom a, atom b. Yield atom p, atom q. @@ -3866,11 +4092,20 @@ section 2eA, packing Push `e` is (add (bex (dec c)) (cut 0 [d (dec c)] b)). Produce [(add (add c c) e) (cut 0 [(add d (dec c)) e] b)] -section 2eB, parsing (tracing) +####Examples + +--- + +section 2eB, parsing (tracing) + +--- + +##++ last + +Compare two [line column] pairs and produce the one which is farther along in text. + +####Summary -++ last - Compare two [line column] pairs and produce the one which is farther along in text. - --- Build dry %gold gate with sample hair `zyc`, hair `naz` Yield hair. If: p.zyc is p.naz, @@ -3880,7 +4115,9 @@ section 2eB, parsing (tracing) Else: If: p.zyc is greater than p.naz, Then: Produce zyc, Else: Produce naz. - --- + +####Examples + ~tadbyl-hilbel/try=> (last [1 1] [1 2]) [p=1 q=2] ~tadbyl-hilbel/try=> (last [2 1] [1 2]) @@ -3889,15 +4126,24 @@ section 2eB, parsing (tracing) [p=99 q=0] ~tadbyl-hilbel/try=> (last [7 7] [7 7]) [p=7 q=7] -++ lust - Produce the beginning of the next line after a newline character or increment the column number - The index of the next character to be parsed. - --- + +--- + +##++ lust + +Produce the beginning of the next line after a newline character or increment the +column number - The index of the next character to be parsed. + +####Summary + Build dry %gold gate with sample char `weq`, hair `naz` Yield hair. If: `weq` is 10, Then: Produce [+(p.naz) 1]. Else: Produce [p.naz +(q.naz)]. - --- + +####Examples + ~tadbyl-hilbel/try=> (lust `a` [1 1]) [p=1 q=2] ~tadbyl-hilbel/try=> (lust `@t`10 [1 1]) @@ -3907,11 +4153,18 @@ section 2eB, parsing (tracing) ~tadbyl-hilbel/try=> (lust `@t`10 [0 0]) [p=1 q=1] +--- + section 2eC, parsing (custom rules) -++ cold - Build gate to parse a nail with a rule, then replaced the parsed texted with a constant. - --- +--- + +##++ cold + +Build gate to parse a nail with a rule, then replaced the parsed texted with a constant. + +####Summary + Activate jet. Build wet %gold gate with sample noun `cus`, bunt of a rule `sef`. Activate extra parsing jet. @@ -3920,14 +4173,22 @@ section 2eC, parsing (custom rules) If: q.vex is an atom, Then: Produce `vex` Else: Produce [p=p.vex q=[~ u=[p=cus q=q.u.q.vex]]] - --- + +####Examples + ~midlys-rocpet/try=> ((cold %foo (just `a`)) [[1 1] "abc"]) [p=[p=1 q=2] q=[~ u=[p=%foo q=[p=[p=1 q=2] q="bc"]]]] ~midlys-rocpet/try=> ((cold %foo (just `a`)) [[1 1] "bc"]) [p=[p=1 q=1] q=~] -++ cook - Build gate to parse a nail with a rule, then slam a gate with the parsed text. - --- + +--- + +##++ cook + +Build gate to parse a nail with a rule, then slam a gate with the parsed text. + +####Summary + Activate jet. Build wet %gold gate with sample clam gate `poq`, bunt of a rule `sef`. Activate extra parsing jet. @@ -3937,7 +4198,9 @@ section 2eC, parsing (custom rules) Then: Produce `vex` Else: Produce [p=p.vex q=[~ u=[p=(poq p.u.q.vex) q=q.u.q.vex]]], where (poq p.u.q.vex) is gate `poq` slammed with the parsed text. - --- + +####Examples + ~midlys-rocpet/try=> ((cook ,@ud (just `a`)) [[1 1] "abc"]) [p=[p=1 q=2] q=[~ u=[p=97 q=[p=[p=1 q=2] q="bc"]]]] ~midlys-rocpet/try=> ((cook ,@tas (just `a`)) [[1 1] "abc"]) @@ -3946,35 +4209,58 @@ section 2eC, parsing (custom rules) [p=[p=1 q=2] q=[~ u=[p=98 q=[p=[p=1 q=2] q="bc"]]]] ~midlys-rocpet/try=> ((cook |=(a=@ `@t`+(a)) (just `a`)) [[1 1] "abc"]) [p=[p=1 q=2] q=[~ u=[p=`b` q=[p=[p=1 q=2] q="bc"]]]] -++ easy - Succeed but consume no characters - Produce an edge at the same text position with the text to parse unchanged, but with a - --- + +--- + +##++ easy + +Succeed but consume no characters - Produce an edge at the same text position +with the text to parse unchanged, but with a + +####Summary + Activate jet. Build wet %gold gate with sample noun, `huf`, a noun to produce as the parsed value. Activate extra parsing jet. Build dry %gold date with sample nail, `tub` Yield edge of type `huf` Produce [p=p.tub q=[~ u=[p=huf q=tub]]], the edge with the noun `huf` as it's parsed value and `tub` as unparsed. - --- + +####Examples + ~tadbyl-hilbel/try=> ((easy %foo) [[1 1] "abc"]) [p=[p=1 q=1] q=[~ [p=%foo q=[p=[p=1 q=1] q="abc"]]]] ~tadbyl-hilbel/try=> ((easy %foo) [[1 1] "bc"]) [p=[p=1 q=1] q=[~ [p=%foo q=[p=[p=1 q=1] q="bc"]]]] ~tadbyl-hilbel/try=> ((easy 'a') [[1 1] "bc"]) [p=[p=1 q=1] q=[~ [p='a' q=[p=[p=1 q=1] q="bc"]]]] -++ fail - Fail to parse - Produce a nail at the same text position but with null text. - --- + +--- + +##++ fail + +Fail to parse - Produce a nail at the same text position but with null text. + +####Summary + Build wet %gold gate with sample nail, `tub`. Produce nail [p=p.tub q=~]. - --- + +####Examples + ~tadbyl-hilbel/try=> (fail [[1 1] "abc"]) [p=[p=1 q=1] q=~] ~tadbyl-hilbel/try=> (fail [[p=1.337 q=70] "Parse me, please?"]) [p=[p=1.337 q=70] q=~] -++ full - Demand politely that the parsing rule parse the entire sample nail, produce a null edge otherwise. - --- + +--- + +##++ full + +Demand politely that the parsing rule parse the entire sample nail, produce a null edge otherwise. + +####Summary + Build wet %gold gate with sample rule, `sab` Build dry %gold gate with sample nail `tub` Push `vex` is the rule slammed with the text to parse. @@ -3983,30 +4269,47 @@ section 2eC, parsing (custom rules) Else: If: The unparsed text in the produced edge is nulll, Then: Produce `vex` Else: Produce [p=p.vex q=~], the edge with a null unit nail. - --- + +####Examples + ~tadbyl-hilbel/try=> ((full (just 'a')) [[1 1] "ab"]) [p=[p=1 q=2] q=~] ~tadbyl-hilbel/try=> ((full (jest 'ab')) [[1 1] "ab"]) [p=[p=1 q=3] q=[~ u=[p='ab' q=[p=[p=1 q=3] q=""]]]] ~tadbyl-hilbel/try=> ((full ;~(plug (just 'a') (just 'b'))) [[1 1] "ab"]) [p=[p=1 q=3] q=[~ u=[p=[~~a ~~b] q=[p=[p=1 q=3] q=""]]]] -++ funk - Prepend a tape to the text to be parsed, then parse the new tape. - --- + +--- + +##++ funk + +Prepend a tape to the text to be parsed, then parse the new tape. + +####Summary + Build wet %gold gate with sample tape `pre`, rule `sef` Build dry %gold gate with sample nail, `tub` Produce the rule slammed with the hair index of `tub` and the concatenation of the prefix tape and the `tub` tape. - --- + +####Examples + ~tadbyl-hilbel/try=> ((funk "abc prefix-" (jest 'abc')) [[1 1] "to be parsed"]) [p=[p=1 q=4] q=[~ [p='abc' q=[p=[p=1 q=4] q=" prefix-to be parsed"]]]] ~tadbyl-hilbel/try=> ((funk "parse" (just 'a')) [[1 4] " me"]) [p=[p=1 q=4] q=~] -++ here - Apply rule if parsing within a specific line and column range. - --- + +--- + +##++ here + +Apply rule if parsing within a specific line and column range. + +####Summary + Activate jet. - Build wet %gold gate with sample bunted gate accepting pint `a`, noun `b` and producing cell [a b], and bunt of rule `sef` + Build wet %gold gate with sample bunted gate accepting pint `a`, + noun `b` and producing cell [a b], and bunt of rule `sef` Activate extra parsing jet. Build dry %gold gate with sample nail `tub` Push `vex` is the rule `sef` slammed by the nail `tub`, an edge. @@ -4019,12 +4322,18 @@ section 2eC, parsing (custom rules) u is: p is `hez` slammed with the pint cell of tub's position and vex's position. q is `q.u.q.vex`, the text not parsed. - --- + +####Examples + +--- -++ inde - Apply rule to indented block starting at current column number, - omitting the leading whitespace. - --- +##++ inde + +Apply rule to indented block starting at current column number, +omitting the leading whitespace. + +####Summary + Build wet %gold gate with sample rule, 'sef' Build dry %gold gate with sample nail and the same product type as sef. Let 'har' and 'tap' be p and q within that nail @@ -4046,11 +4355,17 @@ section 2eC, parsing (custom rules) by the result of tossing res for its tail. Welp together a newline, lev, and the result of tossing res for its tail. - --- -++ jest - Match and consume a cord. - --- +####Examples + +--- + +##++ jest + +Match and consume a cord. + +####Summary + Build dry %gold gate with sample cord `daf` Build dry %gold gate with sample nail `tub` Push `fad` is `daf` @@ -4063,8 +4378,11 @@ section 2eC, parsing (custom rules) u is the cell [p=fad q=tub] Else: If: fish for null in q.tub OR compile to Nock the last byte in `daf` and the Then: Produce the failed parse of `tub`, - Else: Toss `p.tub` for the index of the next character to be parsed, `q.tub` for the tail of `q.tub`, `daf` for the single byte right-shift of `daf` - --- + Else: Toss `p.tub` for the index of the next character to be parsed, + `q.tub` for the tail of `q.tub`, `daf` for the single byte right-shift of `daf` + +####Examples + ~tadbyl-hilbel/try=> ((jest 'abc') [[1 1] "abc"]) [p=[p=1 q=4] q=[~ [p='abc' q=[p=[p=1 q=4] q=""]]]] ~tadbyl-hilbel/try=> (scan "abc" (jest 'abc')) @@ -4077,9 +4395,15 @@ section 2eC, parsing (custom rules) [p=[p=1 q=6] q=~] ~tadbyl-hilbel/try=> ((jest 'john doe') [[1 1] "john doe"]) [p=[p=1 q=9] q=[~ [p='john doe' q=[p=[p=1 q=9] q=""]]]] -++ just - Match and consume a single character. - --- + +--- + +##++ just + +Match and consume a single character. + +####Summary + Activate jet. Build dry %gold gate with sample char `daf` Activate extra parsing jet. @@ -4090,7 +4414,9 @@ section 2eC, parsing (custom rules) Else: Unless: `daf` is `i.q.tub`, Then: Produce the failed parse of `tub`, Else: Produce the parse of the next character of `tub` - --- + +###Examples + ~tadbyl-hilbel/try=> ((just 'a') [[1 1] "abc"]) [p=[p=1 q=2] q=[~ [p=~~a q=[p=[p=1 q=2] q="bc"]]]] ~tadbyl-hilbel/try=> (scan "abc" (just 'a')) @@ -4101,19 +4427,30 @@ section 2eC, parsing (custom rules) ~~a ~tadbyl-hilbel/try=> (scan "%" (just '%')) ~~~25. -++ knee - Callback - --- + +--- + +##++ knee + +Callback + +####Summary + Build wet %gold gate with sample noun `gar`, rule trap `sef` Build dry %gold gate with sample nail `tub` Yield char edge. Produce `tub` slammed to `sef` - --- - - -++ mask - Match the next char to a list of chars, a tape. - --- + +####Examples + +--- + +##++ mask + +Match the next char to a list of chars, a tape. + +####Summary + Activate jet. Build wet %gold gate with sample (list char) `bud` Activate extra parsing jet. @@ -4123,7 +4460,8 @@ section 2eC, parsing (custom rules) Then: Produce the failed parse of `tub` Else: Unless: - --- +####Examples + ~tadbyl-hilbel/try=> (scan "a" (mask "cba")) ~~a ~midlys-rocpet/try=> ((mask "abc") [[1 1] "abc"]) @@ -4132,9 +4470,15 @@ section 2eC, parsing (custom rules) [p=[p=1 q=2] q=[~ [p=~~b q=[p=[p=1 q=2] q="bc"]]]] ~midlys-rocpet/try=> ((mask "abc") [[1 1] "dbc"]) [p=[p=1 q=1] q=~] -++ next - Always succeeds and consumes a character. - --- + +--- + +##++ next + +Always succeeds and consumes a character. + +####Summary + Build dry %gold gate with sample nail `tub` Yield char edge. If: The text to parse `q.tub` is an atom, @@ -4144,15 +4488,23 @@ section 2eC, parsing (custom rules) Produce the edge with the hair `zac` and unit nail with: The character successfully consumed, the head of the text to parse. A nail of hair index `zac`, text to be parsed `t.q.tub` (The tail of the text to parse.) - --- + +####Examples + ~tadbyl-hilbel/try=> (next [[1 1] "ebc"]) [p=[p=1 q=2] q=[~ [p=~~e q=[p=[p=1 q=2] q="bc"]]]] ~tadbyl-hilbel/try=> (next [[1 1] "john jumps jones"]) [p=[p=1 q=2] q=[~ [p=~~j q=[p=[p=1 q=2] q="ohn jumps jones"]]]] -++ sear - Conditional cook - Produce the slam of the parsed texted to `b` only if the result is not null. - Else, produce null. - --- + +--- + +##++ sear + +Conditional cook - Produce the slam of the parsed texted to `b` only if the result is not null. +Else, produce null. + +####Summary + Activate jet. Build wet %gold gate with sample tile of gate accepting a noun and producing a unit `pyq`, rule `sef` Activate extra parsing jet. @@ -4169,14 +4521,22 @@ section 2eC, parsing (custom rules) q is the unit with value u is: p is the value of the parsed text slammed to `pyq` q is the value of the unparsed text. - --- + +####Examples + ~midlys-rocpet/try=> ((sear |=(a=* ?@(a (some a) ~)) (just `a`)) [[1 1] "abc"]) [p=[p=1 q=2] q=[~ u=[p=97 q=[p=[p=1 q=2] q="bc"]]]] ~midlys-rocpet/try=> ((sear |=(a=* ?@(a [~ u=a] ~)) (just `a`)) [[1 1] "abc"]) [p=[p=1 q=2] q=[~ u=[p=97 q=[p=[p=1 q=2] q="bc"]]]] -++ shim - Match characters within a range. - --- + +--- + +##++ shim + +Match characters within a range. + +####Summary + Activate jet. Build wet %gold gate with sample atom `les`, atom `mos` Activate extra parsing jet. @@ -4187,16 +4547,24 @@ section 2eC, parsing (custom rules) Else: Unless: `i.q.tub` is greater than or equal to `les` AND `i.q.tub` is less than or equal to `mos`, Then: Produce the failed parse of `tub`, Else: Produce the single character parse of `tub` - --- + +####Examples + ~midlys-rocpet/try=> ((shim `a` 'z') [[1 1] "abc"]) [p=[p=1 q=2] q=[~ [p=~~a q=[p=[p=1 q=2] q="bc"]]]] ~midlys-rocpet/try=> ((shim `a` 'Z') [[1 1] "abc"]) [p=[p=1 q=1] q=~] ~midlys-rocpet/try=> ((shim `a` 'Z') [[1 1] "Abc"]) [p=[p=1 q=2] q=[~ [p=~~~41. q=[p=[p=1 q=2] q="bc"]]]] -++ stag - Add a label to an edge parsed by a rule. - --- + +--- + +##++ stag + +Add a label to an edge parsed by a rule. + +####Summary + Activate jet. Build wet %gold gate with sample noun `gob`, bunt of a rule `sef` Activate extra parsing jet. @@ -4205,16 +4573,24 @@ section 2eC, parsing (custom rules) If: `q.vex` is an atom, Then: Produce `vex` Else: Produce the edge with hair `p.vex` and unit with value hair u=[p=[gob p.u.q.vex] q=q.u.q.vex] - --- + +###Examples + ~tadbyl-hilbel/try=> ((stag %foo (just 'a')) [[1 1] "abc"]) [p=[p=1 q=2] q=[~ u=[p=[%foo ~~a] q=[p=[p=1 q=2] q="bc"]]]] ~tadbyl-hilbel/try=> ((stag "xyz" (jest 'abc')) [[1 1] "abc"]) [p=[p=1 q=4] q=[~ u=[p=["xyz" 'abc'] q=[p=[p=1 q=4] q=""]]]] ~tadbyl-hilbel/try=> ((stag 10.000 (shim 0 100)) [[1 1] "abc"]) [p=[p=1 q=2] q=[~ u=[p=[10.000 ~~a] q=[p=[p=1 q=2] q="bc"]]]] -++ stet - Listify a list of text position and bunt of rule pairs. - --- + +--- + +##++ stet + +Listify a list of text position and bunt of rule pairs. + +####Summary + Build wet %gold gate with sample list of position and bunt of rule pairs `leh` Kick dry %gold trap. If: `leh` is null, @@ -4222,8 +4598,11 @@ section 2eC, parsing (custom rules) Else: Produce the cell, with head: The cell of the head of the head of `leh`, p=-.i.leh, the tail of the head of `leh, q=+.i.leh. with tail: Toss `leh` for `t.leh` - --- - ~tadbyl-hilbel/try=> (stet (limo [[5 (just 'a')] [1 (jest 'abc')] [[1 1] (shim 0 200)] [[1 10] (cold %foo (just 'a'))]~])) + +####Examples + + ~tadbyl-hilbel/try=> (stet (limo [[5 (just 'a')] [1 (jest 'abc')] [[1 1] (shim 0 200)] + [[1 10] (cold %foo (just 'a'))]~])) ~[ [p=5 q=<1.lrk [tub=[p=[p=@ud q=@ud] q=""] <1.nqy [daf=@tD <394.imz 97.kdz 1.xlc %164>]>]>] [p=1 q=<1.lrk [tub=[p=[p=@ud q=@ud] q=""] <1.nqy [daf=@tD <394.imz 97.kdz 1.xlc %164>]>]>] @@ -4235,17 +4614,26 @@ section 2eC, parsing (custom rules) [p=[1 1] q=<1.lrk [tub=[p=[p=@ud q=@ud] q=""] <1.nqy [daf=@tD <394.imz 97.kdz 1.xlc %164>]>]>] [p=[2 1] q=<1.lrk [tub=[p=[p=@ud q=@ud] q=""] <1.nqy [daf=@tD <394.imz 97.kdz 1.xlc %164>]>]>] ] -++ stew + +--- + +##++ stew - --- +####Summary + Activate jet. Build wet %gold gate with sample list of position and bunt of rule pairs `leh` Push label `wor` on: Build dry %gold gate with sample fork between `ort` , fork `wan` - --- -++ stir + +####Examples + +--- + +##++ stir - --- +####Summary + Activate jet. Build wet %gold gate with sample noun `rud`, gate accepting two nouns and producing , rule `fel` Activate extra parsing jet. @@ -4261,11 +4649,16 @@ section 2eC, parsing (custom rules) The farthest along hair index of `vex` and `wag` The unit nail of - --- +####Examples + +--- -++ stun - Parse several times - --- +##++ stun + +Parse several times + +####Summary + Activate jet. Build wet %gold gate with sample atom `les`, atom `mos`, rule `fel` Activate extra parsing jet. @@ -4274,13 +4667,17 @@ section 2eC, parsing (custom rules) If: `mos` is 0, Then: Produce the edge with - --- +####Examples + +--- section 2eD, parsing (combinators) +--- -++ bend +##++ bend - --- +####Summary + Activate jet. Build wet %gold gate with sample gate accepting a noun `a`, noun `b` and producing the unit of [a b] Activate extra parsing jet. @@ -4288,11 +4685,17 @@ section 2eD, parsing (combinators) If: `q.vex` is an atom, Then: Produce `vex`, Else: Push `yit` is sab slammed with - --- -++ comp - Arbitrary compose - --- +####Examples + +--- + +##++ comp + +Arbitrary compose + +####Summary + Activate jet. Build wet %gold gate with sample gate accepting noun a, noun b and producing [a b], `raq` Activate extra parsing jet. @@ -4306,12 +4709,17 @@ section 2eD, parsing (combinators) Else: Produce the edge with hair `yur`, unit [p=* q=nail] cell where: p is `raq` slammed with `p.u.q.vex` and `p.u.q.yit`, the parsed results `yit` and `vex` q is `q.u.q.yit`, the unparsed text of `yit` - --- - -++ glue - Add rule. - --- +###Examples + +--- + +##++ glue + +Add rule. + +####Summary + Activate jet. Build wet %gold gate with sample rule `bus` Activate extra parsing jet. @@ -4319,29 +4727,47 @@ section 2eD, parsing (combinators) Slam plug with: The edge `vex` The tuple of slamming bus and sab with pfix - --- -++ less - No first and second. - --- + +####Examples + +--- + +##++ less + +No first and second. + +####Summary + Build wet %gold gate with sample edge `vex`, rule `sab` If: `q.vex` is null, Then: Push `roq` is `sab`. Produce [p=(last p.vex p.roq) q=q.roq] Else: Produce vex with q tossed for null. - --- -++ pfix - Discard the first rule of a two rule cell. - --- +####Examples + +--- + +##++ pfix + +Discard the first rule of a two rule cell. + +####Summary + Activate jet. Produce comp slammed with: Build wet %gold gate slammed with sample noun `a`, noun `b`. Produce `b` - --- + +####Examples + + --- - -++ plug - Apply parsing rules in order to an edge. - --- +##++ plug + +Apply parsing rules in order to an edge. + +####Summary + Activate jet. Build wet %gold gate with sample edge `vex`, rule `sab` If: The unit of text to parse is null, @@ -4352,7 +4778,9 @@ section 2eD, parsing (combinators) Then: Produce the edge [p=yur q=null]. Else: Produce the edge [p=yur q=[~ u=[p=[p.u.q.vex p.u.q.yit] q=q.u.q.yit]]], the edge of the text parsed with the rule. - --- + +####examples + ~tadbyl-hilbel/try=> (;~(plug lus lus) [[1 1] "++"]) [p=[p=1 q=3] q=[~ u=[p=[~~~2b. ~~~2b.] q=[p=[p=1 q=3] q=""]]]] ~tadbyl-hilbel/try=> (scan "++" ;~(plug lus lus)) @@ -4373,11 +4801,17 @@ section 2eD, parsing (combinators) ! {1 3} ! 'syntax-error' ! exit -++ pose - Build list of parsing rules and try to use any of them in order. - `pose` has the same usage as `plug`, but does not fail if the rules are not - successful in a certain order. - --- + +---` + +##++ pose + +Build list of parsing rules and try to use any of them in order. +`pose` has the same usage as `plug`, but does not fail if the rules are not +successful in a certain order. + +####Summary + Activate jet. Build wet %gold gate with sample edge `vex`, rule `sab` If: The unit of text to parse is null, @@ -4385,7 +4819,9 @@ section 2eD, parsing (combinators) Produce the edge with the hair that is farther along of `vex` and `yit` and the parse results of the rule. Else: Produce the initial edge, `vex` - --- + +###Examples + ~tadbyl-hilbel/try=> (;~(pose (just 'a') (just 'b') (just 'c')) [[1 1] "c"]) [p=[p=1 q=2] q=[~ [p=~~c q=[p=[p=1 q=2] q=""]]]] ~tadbyl-hilbel/try=> (scan "c" ;~(pose (just 'a') (just 'b') (just 'c'))) @@ -4398,65 +4834,105 @@ section 2eD, parsing (combinators) "|-" ~tadbyl-hilbel/try=> (scan "john doe" (star ;~(pose (jest 'doe') ace (jest 'john')))) ~['john' ' ' 'doe'] - -++ sfix - Discard second rule. - --- + +--- + +##++ sfix + +Discard second rule. + +####Summary + Activate jet. Slam comp with a wet %gold gate accepting noun `a`, noun `b` and producing noun `a` - --- + +####Examples + +--- section 2eE, parsing (composers) -++ bass - --- +--- + +##++ bass + +####Summary + Build wet %gold gate with sample atom `wuc`, rule `tyd` Slam cook with: Build dry %gold gate with sample list of atoms, `waq` Slam roll with: - --- -++ boss - --- +###Examples + +--- + +##++ boss + +####Summary + Build wet %gold gate with sample atom `wuc`, rule `tyd` - --- -++ ifix + +####Examples + +--- + +##++ ifix - --- +####Summary + Build wet %gold gate with sample cell of rules `fel`, rule `hof` Produce pfix gonadified with: `p.fel`, the first rule in `fel` Gonadify sfix with `hof` and `q.fel`, the second rule in `fel` - --- + +####Examples + +--- -++ more - --- +##++ more + +####Summary + Build wet %gold gate with sample rule `bus`, rule `fel` Produce the gonadified: - --- -++ most - Parse to a list elements of the second rule seperated by the second. - --- +###Examples + +--- + +##++ most + +Parse to a list elements of the second rule seperated by the second. + +####Summary + Build wet %gold gate with sample rule `bus`, rule `fel` Produce gonadified: Plug slammed with `fel`, star slammed with gonadified: pfix slammed with `bus` and `fel`, `bus` added as the prefix of `fel` - --- - -++ plus - Like 'star', but "one or more" instead of "0 or more" +###Examples + +--- + +##++ plus + +Like 'star', but "one or more" instead of "0 or more" + +####Summary - --- Build wet %gold gate with sample rule `fel` Produce gonadified: plug slammed with `fel` and star slammed with `fel`, the repeated application of `fel`. - --- - - -++ slug - --- +####Examples + +--- + +##++ slug + +####Summary + Build wet %gold gate with sample noun `rud`, gate accepting cell of two nouns and producing [a b] `raq` Build wet %gold gate with sample rule `bus`, rule `fel` Produce the gonadified: @@ -4464,16 +4940,23 @@ section 2eE, parsing (composers) slammed with `fel`, slammed with, stir slammed with `rud`, `raq`, and `fel` prefixed with `bus` - --- +####Examples + +--- -++ star - Apply the parsing rule repeatedly until it fails. - --- +##++ star + +Apply the parsing rule repeatedly until it fails. + +####Summary + Build wet %gold gate with sample rule `fel, Produce stir slammed with: The list of elements of type of the icon of `fel` slammed to `wonk` - --- + +####Examples + ~tadbyl-hilbel/try=> (scan "aaaaa" (just 'a')) ! {1 2} ! 'syntax-error' @@ -4489,13 +4972,22 @@ section 2eE, parsing (composers) ~tadbyl-hilbel/try=> (scan "john smith" (star (shim 0 200))) "john smith" +--- + section 2eF, parsing (ascii) -++ ace - Parse ASCII character 32, ace. - --- +--- + +##++ ace + +Parse ASCII character 32, ace. + +####Summary + Produce the rule just slammed with ' ' - --- + +###Examples + ~tadbyl-hilbel/try=> (scan " " ace) ~~. ~tadbyl-hilbel/try=> `cord`(scan " " ace) @@ -4504,11 +4996,19 @@ section 2eF, parsing (ascii) [p=[p=1 q=2] q=[~ [p=~~. q=[p=[p=1 q=2] q=""]]]] ~tadbyl-hilbel/try=> (ace [[1 1] " abc "]) [p=[p=1 q=2] q=[~ [p=~~. q=[p=[p=1 q=2] q="abc "]]]] -++ bar - Parse ASCII character 124, bar. - --- + +--- + +##++ bar + +Parse ASCII character 124, bar. + +####Summary + Produce the rule just slammed with '|' - --- + +####Examples + ~tadbyl-hilbel/try=> (scan "|" bar) ~~~7c. ~tadbyl-hilbel/try=> `cord`(scan "|" bar) @@ -4517,12 +5017,20 @@ section 2eF, parsing (ascii) [p=[p=1 q=2] q=[~ [p=~~~7c. q=[p=[p=1 q=2] q=""]]]] ~tadbyl-hilbel/try=> (bar [[1 1] "|="]) [p=[p=1 q=2] q=[~ [p=~~~7c. q=[p=[p=1 q=2] q="="]]]] -++ bas - Parse ASCII character 92, bas. - Note the extra '\' in the slam of bas with just is to escape the escape character, bas. - --- + +--- + +##++ bas + +Parse ASCII character 92, bas. +Note the extra '\' in the slam of bas with just is to escape the escape character, bas. + +####Summary + Produce the rule just slammed with '\\' - --- + +###Examples + ~tadbyl-hilbel/try=> (scan "\\" bas) ~~~5c. ~tadbyl-hilbel/try=> `cord`(scan "\\" bas) @@ -4533,11 +5041,19 @@ section 2eF, parsing (ascii) [p=[p=1 q=2] q=[~ [p=~~~5c. q=[p=[p=1 q=2] q=""]]]] ~tadbyl-hilbel/try=> (bas [[1 1] "\""]) [p=[p=1 q=1] q=~] -++ buc - Parse ASCII character 36, buc. - --- + +--- + +##++ buc + +Parse ASCII character 36, buc. + +####Summary + Produce the rule just slammed with '$' - --- + +####Examples + ~tadbyl-hilbel/try=> (scan "$" buc) ~~~24. ~tadbyl-hilbel/try=> `cord`(scan "$" buc) @@ -4546,11 +5062,19 @@ section 2eF, parsing (ascii) [p=[p=1 q=2] q=[~ [p=~~~24. q=[p=[p=1 q=2] q=""]]]] ~tadbyl-hilbel/try=> (buc [[1 1] "$%"]) [p=[p=1 q=2] q=[~ [p=~~~24. q=[p=[p=1 q=2] q="%"]]]] -++ cab - Parse ASCII character 95, cab. - --- + +--- + +##++ cab + +Parse ASCII character 95, cab. + +####Summary + Produce the rule just slammed with '_' - --- + +###Examples + ~tadbyl-hilbel/try=> (scan "_" cab) ~~~5f. ~tadbyl-hilbel/try=> `cord`(scan "_" cab) @@ -4559,11 +5083,19 @@ section 2eF, parsing (ascii) [p=[p=1 q=2] q=[~ [p=~~~5f. q=[p=[p=1 q=2] q=""]]]] ~tadbyl-hilbel/try=> (cab [[1 1] "|_"]) [p=[p=1 q=1] q=~] -++ cen - Parse ASCII character 37, cen. - --- + +--- + +##++ cen + +Parse ASCII character 37, cen. + +####Summary + Produce the rule just slammed with '%' - --- + +####Examples + ~tadbyl-hilbel/try=> (scan "%" cen) ~~~25. ~tadbyl-hilbel/try=> `cord`(scan "%" cen) @@ -4572,11 +5104,19 @@ section 2eF, parsing (ascii) [p=[p=1 q=2] q=[~ [p=~~~25. q=[p=[p=1 q=2] q=""]]]] ~tadbyl-hilbel/try=> (cen [[1 1] "%^"]) [p=[p=1 q=2] q=[~ [p=~~~25. q=[p=[p=1 q=2] q="^"]]]] -++ col - Parse ASCII character 58, col. - --- + +--- + +##++ col + +Parse ASCII character 58, col. + +####Summary + Produce the rule just slammed with ':' - --- + +###Examples + ~tadbyl-hilbel/try=> (scan ":" col) ~~~3a. ~tadbyl-hilbel/try=> `cord`(scan ":" col) @@ -4585,11 +5125,19 @@ section 2eF, parsing (ascii) [p=[p=1 q=2] q=[~ [p=~~~3a. q=[p=[p=1 q=2] q=""]]]] ~tadbyl-hilbel/try=> (col [[1 1] ":-"]) [p=[p=1 q=2] q=[~ [p=~~~3a. q=[p=[p=1 q=2] q="-"]]]] -++ com - Parse ASCII character 44, com. - --- + +--- + +##++ com + +Parse ASCII character 44, com. + +####Summary + Produce the rule just slammed with ',' - --- + +####Examples + ~tadbyl-hilbel/try=> (scan "," com) ~~~2c. ~tadbyl-hilbel/try=> `cord`(scan "," com) @@ -4598,11 +5146,18 @@ section 2eF, parsing (ascii) [p=[p=1 q=2] q=[~ [p=~~~2c. q=[p=[p=1 q=2] q=""]]]] ~tadbyl-hilbel/try=> (com [[1 1] "not com"]) [p=[p=1 q=1] q=~] -++ doq - Parse ASCII character 34, doq. - --- + +--- + +##++ doq + +Parse ASCII character 34, doq. + +####Summary + Produce the rule just slammed with '"' - --- +####Examplse + ~tadbyl-hilbel/try=> (scan "\"" doq) ~~~22. ~tadbyl-hilbel/try=> `cord`(scan "\"" doq) @@ -4615,11 +5170,19 @@ section 2eF, parsing (ascii) ! {1 1} ! 'syntax-error' ! exit -++ dot - Parse ASCII character 46, dot. - --- + +--- + +##++ dot + +Parse ASCII character 46, dot. + +####Summary + Produce the rule just slammed with '.' - --- + +####Examples + ~tadbyl-hilbel/try=> (scan "." dot) ~~~. ~tadbyl-hilbel/try=> `cord`(scan "." dot) @@ -4628,11 +5191,19 @@ section 2eF, parsing (ascii) [p=[p=1 q=2] q=[~ [p=~~~. q=[p=[p=1 q=2] q=""]]]] ~tadbyl-hilbel/try=> (dot [[1 1] ".^"]) [p=[p=1 q=2] q=[~ [p=~~~. q=[p=[p=1 q=2] q="^"]]]] -++ fas - Parse ASCII character 47, fas. - --- + +--- + +##++ fas + +Parse ASCII character 47, fas. + +####Summary + Produce the rule just slammed with '/' - --- + +###Examples + ~tadbyl-hilbel/try=> (scan "/" fas) ~~~2f. ~tadbyl-hilbel/try=> `cord`(scan "/" fas) @@ -4641,11 +5212,19 @@ section 2eF, parsing (ascii) [p=[p=1 q=2] q=[~ [p=~~~2f. q=[p=[p=1 q=2] q=""]]]] ~tadbyl-hilbel/try=> (fas [[1 1] "|/"]) [p=[p=1 q=1] q=~] -++ gal - Parse ASCII character 60, gal. - --- + +--- + +##++ gal + +Parse ASCII character 60, gal. + +####Summary + Produce the rule just slammed with '<' - --- + +####Examples + ~tadbyl-hilbel/try=> (scan "<" gal) ~~~3c. ~tadbyl-hilbel/try=> `cord`(scan "<" gal) @@ -4656,11 +5235,19 @@ section 2eF, parsing (ascii) [p=[p=1 q=2] q=[~ [p=~~~3c. q=[p=[p=1 q=2] q="+"]]]] ~tadbyl-hilbel/try=> (gal [[1 1] "+<"]) [p=[p=1 q=1] q=~] -++ gar - Parse ASCII character 62, gar. - --- + +--- + +##++ gar + +Parse ASCII character 62, gar. + +####Summary + Produce the rule just slammed with '>' - --- + +####Examples + ~tadbyl-hilbel/try=> (scan ">" gar) ~~~3e. ~tadbyl-hilbel/try=> `cord`(scan ">" gar) @@ -4669,11 +5256,19 @@ section 2eF, parsing (ascii) [p=[p=1 q=2] q=[~ [p=~~~3e. q=[p=[p=1 q=2] q=""]]]] ~tadbyl-hilbel/try=> (gar [[1 1] "=>"]) [p=[p=1 q=1] q=~] -++ hax - Parse ASCII character 35, hax. - --- + +--- + +##++ hax + +Parse ASCII character 35, hax. + +####Summary + Produce the rule just slammed with '#' - --- + +####Examples + ~tadbyl-hilbel/try=> (scan "#" hax) ~~~23. ~tadbyl-hilbel/try=> `cord`(scan "#" hax) @@ -4682,12 +5277,20 @@ section 2eF, parsing (ascii) [p=[p=1 q=2] q=[~ [p=~~~23. q=[p=[p=1 q=2] q=""]]]] ~tadbyl-hilbel/try=> (hax [[1 1] "#!"]) [p=[p=1 q=2] q=[~ [p=~~~23. q=[p=[p=1 q=2] q="!"]]]] -++ kel - Parse ASCII character 123, kel. - Note that this, with ker, opens and closes a Hoon expression for Hoon string interpolation. Escape kel to parse it. - --- + +--- + +##++ kel + +Parse ASCII character 123, kel. +Note that this, with ker, opens and closes a Hoon expression for Hoon string interpolation. Escape kel to parse it. + +####Summary + Produce the rule just slammed with '{' - --- + +####Examples + ~tadbyl-hilbel/try=> (scan "\{" kel) ~~~7b. ~tadbyl-hilbel/try=> `cord`(scan "\{" kel) @@ -4696,11 +5299,19 @@ section 2eF, parsing (ascii) [p=[p=1 q=2] q=[~ [p=~~~7b. q=[p=[p=1 q=2] q=""]]]] ~tadbyl-hilbel/try=> (kel [[1 1] " \{"]) [p=[p=1 q=1] q=~] -++ ker - Parse ASCII character 125, ker. - --- + +--- + +##++ ker + +Parse ASCII character 125, ker. + +####Summary + Produce the rule just slammed with '}' - --- + +###Examples + ~tadbyl-hilbel/try=> (scan "}" ker) ~~~7d. ~tadbyl-hilbel/try=> `cord`(scan "}" ker) @@ -4709,11 +5320,19 @@ section 2eF, parsing (ascii) [p=[p=1 q=2] q=[~ [p=~~~7d. q=[p=[p=1 q=2] q=""]]]] ~tadbyl-hilbel/try=> (ker [[1 1] "\{}"]) [p=[p=1 q=1] q=~] -++ ket - Parse ASCII character 94, ket. - --- + +--- + +##++ ket + +Parse ASCII character 94, ket. + +####Summary + Produce the rule just slammed with '^' - --- + +####Examples + ~tadbyl-hilbel/try=> (scan "^" ket) ~~~5e. ~tadbyl-hilbel/try=> `cord`(scan "^" ket) @@ -4722,11 +5341,19 @@ section 2eF, parsing (ascii) [p=[p=1 q=2] q=[~ [p=~~~5e. q=[p=[p=1 q=2] q=""]]]] ~tadbyl-hilbel/try=> (ket [[1 1] ".^"]) [p=[p=1 q=1] q=~] -++ lus - Parse ASCII character 43, lus. - --- + +--- + +##++ lus + +Parse ASCII character 43, lus. + +####Summary + Produce the rule just slammed with '+' - --- + +###Examples + ~tadbyl-hilbel/try=> (scan "+" lus) ~~~2b. ~tadbyl-hilbel/try=> `cord`(scan "+" lus) @@ -4735,11 +5362,19 @@ section 2eF, parsing (ascii) [p=[p=1 q=2] q=[~ [p=~~~2b. q=[p=[p=1 q=2] q=""]]]] ~tadbyl-hilbel/try=> (lus [[1 1] ".+"]) [p=[p=1 q=1] q=~] -++ hep - Parse ASCII character 45, hep. - --- + +--- + +##++ hep + +Parse ASCII character 45, hep. + +####Summary + Produce the rule just slammed with '-' - --- + +####Examples + ~tadbyl-hilbel/try=> (scan "-" hep) ~~- ~tadbyl-hilbel/try=> `cord`(scan "-" hep) @@ -4748,11 +5383,19 @@ section 2eF, parsing (ascii) [p=[p=1 q=2] q=[~ [p=~~- q=[p=[p=1 q=2] q=""]]]] ~tadbyl-hilbel/try=> (hep [[1 1] ":-"]) [p=[p=1 q=1] q=~] -++ pel - Parse ASCII character 40, pel. - --- + +--- + +##++ pel + +Parse ASCII character 40, pel. + +####Summary + Produce the rule just slammed with '(' - --- + +####Examples + ~tadbyl-hilbel/try=> (scan "(" pel) ~~~28. ~tadbyl-hilbel/try=> `cord`(scan "(" pel) @@ -4761,11 +5404,19 @@ section 2eF, parsing (ascii) [p=[p=1 q=2] q=[~ [p=~~~28. q=[p=[p=1 q=2] q=""]]]] ~tadbyl-hilbel/try=> (pel [[1 1] ";("]) [p=[p=1 q=1] q=~] -++ pam - Parse ASCII character 38, pam. - --- + +--- + +##++ pam + +Parse ASCII character 38, pam. + +####Summary + Produce the rule just slammed with '&' - --- + +####Examples + ~tadbyl-hilbel/try=> (scan "&" pam) ~~~26. ~tadbyl-hilbel/try=> `cord`(scan "&" pam) @@ -4774,11 +5425,19 @@ section 2eF, parsing (ascii) [p=[p=1 q=2] q=[~ [p=~~~26. q=[p=[p=1 q=2] q=""]]]] ~tadbyl-hilbel/try=> (pam [[1 1] "?&"]) [p=[p=1 q=1] q=~] -++ per - Parse ASCII character 41, per. - --- + +--- + +##++ per + +Parse ASCII character 41, per. + +####Summary + Produce the rule just slammed with ')' - --- + +###Examples + ~tadbyl-hilbel/try=> (scan ")" per) ~~~29. ~tadbyl-hilbel/try=> `cord`(scan ")" per) @@ -4787,11 +5446,19 @@ section 2eF, parsing (ascii) [p=[p=1 q=2] q=[~ [p=~~~29. q=[p=[p=1 q=2] q=""]]]] ~tadbyl-hilbel/try=> (per [[1 1] " )"]) [p=[p=1 q=1] q=~] -++ pat - Parse ASCII character 64, pat. - --- + +--- + +##++ pat + +Parse ASCII character 64, pat. + +####Summary + Produce the rule just slammed with '@' - --- + +####Examples + ~tadbyl-hilbel/try=> (scan "@" pat) ~~~4. ~tadbyl-hilbel/try=> `cord`(scan "@" pat) @@ -4800,11 +5467,19 @@ section 2eF, parsing (ascii) [p=[p=1 q=2] q=[~ [p=~~~4. q=[p=[p=1 q=2] q=""]]]] ~tadbyl-hilbel/try=> (pat [[1 1] "?@"]) [p=[p=1 q=1] q=~] -++ sel - Parse ASCII character 91, sel. - --- + +--- + +##++ sel + +Parse ASCII character 91, sel. + +####Summary + Produce the rule just slammed with '[' - --- + +####Examples + ~tadbyl-hilbel/try=> (scan "[" sel) ~~~5b. ~tadbyl-hilbel/try=> `cord`(scan "[" sel) @@ -4813,11 +5488,19 @@ section 2eF, parsing (ascii) [p=[p=1 q=2] q=[~ [p=~~~5b. q=[p=[p=1 q=2] q=""]]]] ~tadbyl-hilbel/try=> (sel [[1 1] "-["]) [p=[p=1 q=1] q=~] -++ sem - Parse ASCII character 59, sem. - --- + +--- + +##++ sem + +Parse ASCII character 59, sem. + +####Summary + Produce the rule just slammed with ';' - --- + +###Exampels + ~tadbyl-hilbel/try=> (scan ";" sem) ~~~3b. ~tadbyl-hilbel/try=> `cord`(scan ";" sem) @@ -4826,11 +5509,19 @@ section 2eF, parsing (ascii) [p=[p=1 q=2] q=[~ [p=~~~3b. q=[p=[p=1 q=2] q=""]]]] ~tadbyl-hilbel/try=> (sem [[1 1] " ;"]) [p=[p=1 q=1] q=~] -++ ser - Parse ASCII character 93, ser. - --- + +--- + +##++ ser + +Parse ASCII character 93, ser. + +####Summary + Produce the rule just slammed with ']' - --- + +####Examples + ~tadbyl-hilbel/try=> (scan "]" ser) ~~~5d. ~tadbyl-hilbel/try=> `cord`(scan "]" ser) @@ -4839,11 +5530,19 @@ section 2eF, parsing (ascii) [p=[p=1 q=2] q=[~ [p=~~~5d. q=[p=[p=1 q=2] q=""]]]] ~tadbyl-hilbel/try=> (ser [[1 1] "[ ]"]) [p=[p=1 q=1] q=~] -++ sig - Parse ASCII character 126, sig. - --- + +--- + +##++ sig + +Parse ASCII character 126, sig. + +####Summary + Produce the rule just slammed with '~' - --- + +####Examples + ~tadbyl-hilbel/try=> (scan "~" sig) ~~~~ ~tadbyl-hilbel/try=> `cord`(scan "~" sig) @@ -4852,12 +5551,20 @@ section 2eF, parsing (ascii) [p=[p=1 q=2] q=[~ [p=~~~~ q=[p=[p=1 q=2] q=""]]]] ~tadbyl-hilbel/try=> (sig [[1 1] "?~"]) [p=[p=1 q=1] q=~] -++ soq - Parse ASCII character 39, soq. - Note the extra '\' in the slam of soq with just is to escape the first soq because soq denotes a crip. - --- + +--- + +##++ soq + +Parse ASCII character 39, soq. +Note the extra '\' in the slam of soq with just is to escape the first soq because soq denotes a crip. + +####Summary + Produce the rule just slammed with '\'' - --- + +####Examples + ~tadbyl-hilbel/try=> (scan "'" soq) ~~~27. ~tadbyl-hilbel/try=> `cord`(scan "'" soq) @@ -4866,11 +5573,19 @@ section 2eF, parsing (ascii) [p=[p=1 q=2] q=[~ [p=~~~27. q=[p=[p=1 q=2] q=""]]]] ~tadbyl-hilbel/try=> (soq [[1 1] ">'"]) [p=[p=1 q=1] q=~] -++ tar - Parse ASCII character 42, tar. - --- + +--- + +##++ tar + +Parse ASCII character 42, tar. + +####Summary + Produce the rule just slammed with '*' - --- + +####Examples + ~tadbyl-hilbel/try=> (scan "*" tar) ~~~2a. ~tadbyl-hilbel/try=> `cord`(scan "*" tar) @@ -4879,11 +5594,19 @@ section 2eF, parsing (ascii) [p=[p=1 q=2] q=[~ [p=~~~2a. q=[p=[p=1 q=2] q=""]]]] ~tadbyl-hilbel/try=> (tar [[1 1] ".*"]) [p=[p=1 q=1] q=~] -++ tec - Parse ASCII character 96, tec. - --- + +--- + +##++ tec + +Parse ASCII character 96, tec. + +####Summary + Produce the rule just slammed with '`' - --- + +####Examples + ~tadbyl-hilbel/try=> (scan "`" tec) ~~~6. ~tadbyl-hilbel/try=> `cord`(scan "`" tec) @@ -4892,11 +5615,19 @@ section 2eF, parsing (ascii) [p=[p=1 q=2] q=[~ [p=~~~6. q=[p=[p=1 q=2] q=""]]]] ~tadbyl-hilbel/try=> (tec [[1 1] " `"]) [p=[p=1 q=1] q=~] -++ tis - Parse ASCII character 61, tis. - --- + +--- + +##++ tis + +Parse ASCII character 61, tis. + +####Summary + Produce the rule just slammed with '=' - --- + +####Examples + ~tadbyl-hilbel/try=> (scan "=" tis) ~~~3d. ~tadbyl-hilbel/try=> `cord`(scan "=" tis) @@ -4905,11 +5636,18 @@ section 2eF, parsing (ascii) [p=[p=1 q=2] q=[~ [p=~~~3d. q=[p=[p=1 q=2] q=""]]]] ~tadbyl-hilbel/try=> (tis [[1 1] "|="]) [p=[p=1 q=1] q=~] -++ wut - Parse ASCII character 63, wut. - --- +--- + +##++ wut + +Parse ASCII character 63, wut. + +####Summary + Produce the rule just slammed with '?' - --- + +###Examples + ~tadbyl-hilbel/try=> (scan "?" wut) ~~~3f. ~tadbyl-hilbel/try=> `cord`(scan "?" wut) @@ -4918,11 +5656,19 @@ section 2eF, parsing (ascii) [p=[p=1 q=2] q=[~ [p=~~~3f. q=[p=[p=1 q=2] q=""]]]] ~tadbyl-hilbel/try=> (wut [[1 1] ".?"]) [p=[p=1 q=1] q=~] -++ zap - Parse ASCII character 33, zap. - --- + +--- + +##++ zap + +Parse ASCII character 33, zap. + +####Summary + Produce the rule just slammed with '!' - --- + +###Examples + ~tadbyl-hilbel/try=> (scan "!" zap) ~~~21. ~tadbyl-hilbel/try=> `cord`(scan "!" zap) @@ -4932,76 +5678,127 @@ section 2eF, parsing (ascii) ~tadbyl-hilbel/try=> (zap [[1 1] "?!"]) [p=[p=1 q=1] q=~] +--- + section 2eG, parsing (whitespace) -++ dog -++ doh - Parse - --- - Produce plug gonadified with dot and gay. - --- +--- + +++ dog + +--- + +##++ doh + +Parse + +####Summary + + Produce plug gonadified with dot and gay. + +####Examples + +--- + +##++ dun + +Parse phep (--) to null (~). + +####Summary -++ dun - Parse phep (--) to null (~). - --- Produce cold slammed with: null plug gonadified with hep and hep, to parse phep. - --- + +####Examples + ~tadbyl-hilbel/try=> (scan "--" dun) ~ ~tadbyl-hilbel/try=> (dun [[1 1] "--"]) [p=[p=1 q=3] q=[~ u=[p=~ q=[p=[p=1 q=3] q=""]]]] -++ duz - Parse stet (==) to null (~). - --- + +--- + +##++ duz + +Parse stet (==) to null (~). + +####Summary + Produce cold slammed with: null plug gonadified with tis and tis, to parse stet - --- + +####Examples + ~tadbyl-hilbel/try=> (scan "==" duz) ~ ~tadbyl-hilbel/try=> (duz [[1 1] "== |=..."]) [p=[p=1 q=3] q=[~ u=[p=~ q=[p=[p=1 q=3] q=" |=..."]]]] -++ gah - --- +--- + +##++ gah + +####Summary + Produce mask slammed with the tuple: `@`10, the newline character ' ', the ace character null - --- -++ gap +####Examples + +--- + +##++ gap - --- +--- + +####Summary + Produce cold slammed with: null Plug gonadified with: gaq star slammed with pose gonadified with vul and gah - --- -++ gaq - --- +###Examples + +--- + +##++ gaq + +####Summary + Produce pose gonadifed with: just slammed with the newline character. Plug gonadified with gah and pose gonadified with gah and vul. vul - --- + +####Examples + +--- -++ gay +##++ gay - --- +####Summary + Produce pose gonadified with: gap, which Slam of easy with null - --- + +####Examples + +--- -++ vul - Parse comments and replace them with null. - Note that a comment must be ended with a newline character. - --- +##++ vul + +Parse comments and replace them with null. +Note that a comment must be ended with a newline character. + +####Summary + Produce cold slammed with: Pair null and, plug gonadified with col, col, and, pose gonadified with: @@ -5009,7 +5806,10 @@ section 2eG, parsing (whitespace) shim slammed with 128 and 255 just slammed with the newline operator. (==) Terminates the pair. - --- + +####Examples + +--- section 2eH, parsing (idioms) From 185a4bc3c0efbc611d219ef3cc4a0b1063583760 Mon Sep 17 00:00:00 2001 From: John Dulin Date: Fri, 8 Aug 2014 19:22:22 -0700 Subject: [PATCH 08/34] Finished vol2 markdownification. --- main/pub/src/doc/ref/vol2.md | 1023 ++++++++++++++++++++++------------ 1 file changed, 659 insertions(+), 364 deletions(-) diff --git a/main/pub/src/doc/ref/vol2.md b/main/pub/src/doc/ref/vol2.md index addf5c131d..4a1313566c 100644 --- a/main/pub/src/doc/ref/vol2.md +++ b/main/pub/src/doc/ref/vol2.md @@ -1010,7 +1010,7 @@ Accepts a list `a` and a gate `b`. Produces the list with the gate applied to ea ##++weld - Concatenates two lists. +Concatenates two lists. ####Summary @@ -1018,9 +1018,9 @@ Accepts a list `a` and a gate `b`. Produces the list with the gate applied to ea Build wet %gold gate that accepts two lists, `a` and `b`. Homogenizes both lists and makes them the subject of the following code. Kick dry %gold trap. - Cast the resulting list to the type of list `b`. + Cast the resulting list to the type of list `b`. If: a is null, - Then: produce `b`. + Then: produce `b`. Else: produce the tuple where `i.a` is the head, and the toss of `a` for `i.a` is the tail. ####Examples: @@ -1032,12 +1032,13 @@ Accepts a list `a` and a gate `b`. Produces the list with the gate applied to ea ##++welp -Concatenates two lists without losing their type information to homogenization. +Concatenate two lists without losing their type information to homogenization. Produces a tape when passed two tapes. ####Summary Identical to the internals of `++weld`, except it does not implement the list homogenization. + You probably don't need to understand it right now. ####Examples: @@ -1046,7 +1047,7 @@ Produces a tape when passed two tapes. ##++wild -Concatenates two lists without casting the product back to a list. +Concatenate two lists without casting the product back to a list. Build wet %gold gate with two list sample, labeled `a`, `b`, respectively. Homogenize both lists and make them the subject of the following code. @@ -6902,7 +6903,9 @@ section 2eN, pseudo-cryptography ##++zyr -section 2eO, virtualization +--- +section 2eO, virtualization +--- ##++mack @@ -7098,10 +7101,12 @@ Intelligently render crash annotation. ~zod/try=> (mook [%2 ~[[%spot /b/repl [[1 1] 1 2]] [%mean |.(!!)]]]) [%2 p=~[[%leaf p="/b/repl/:<[1 1].[1 2]>"] [%leaf p="####"]]] +--- + ####++mang -Mang is just like mack, but accepting a sky. -It produces a unit computation result. +Work just like in `++makc`, but accept a `++sky`. +Produce a unit computation result. ####Summary @@ -7111,289 +7116,312 @@ It produces a unit computation result. Let 'ton' be the result of monging the sample. Unless ton has stem 0, produce the empty unit, otherwise produce one containing ton's bulb. +--- ##++mung +--- + ##++mule +--- + ##++mute +--- section 2eP, diff **noted as "(move me)" in source** +--- -++ berk -++ diff -++ loss - ++ abet - ++ hink - ++ lonk - ++ lune - ++ merg - ++ main -++ locz -++ lore -++ role -++ lump -++ lure -++ limp -++ hump -++ husk -++ lurk -++ lusk - ++ abet - ++ done - ++ main -++ nude - ++ axes - ++ tred +##++ berk +##++ diff +##++ loss +## ++ abet +## ++ hink +## ++ lonk +## ++ lune +## ++ merg +## ++ main +##++ locz +##++ lore +##++ role +##++ lump +##++ lure +##++ limp +##++ hump +##++ husk +##++ lurk +##++ lusk +## ++ abet +## ++ done +## ++ main +##++ nude +## ++ axes +## ++ tred +--- section 2eW, lite number theory +--- -++ egcd -++ pram -++ ramp -++ fo - ++ dif - ++ exp - ++ fra - ++ inv - ++ pro - ++ sit - ++ sum -++ ga - ++ dif - ++ dub - ++ pro - ++ toe - ++ sit - ++ fra - ++ inv - ++ pow - ++ pro +##++ egcd +##++ pram +##++ ramp +##++ fo +## ++ dif +## ++ exp +## ++ fra +## ++ inv +## ++ pro +## ++ sit +## ++ sum +##++ ga +## ++ dif +## ++ dub +## ++ pro +## ++ toe +## ++ sit +## ++ fra +## ++ inv +## ++ pow +## ++ pro -section 2eX, jetted crypto +--- +section 2eX, jetted crypto +--- -++ aesc - ++ en - ++ de -++ ahem - ++ cipa - ++ co - ++ ix - ++ ro - ++ su - ++ pen - ++ co - ++ ix - ++ ro - ++ su - ++ pin - ++ co - ++ ix - ++ ro - ++ su - ++ mcol - ++ pode - ++ sube - ++ be - ++ ankh - ++ sark - ++ srow - ++ subs - ++ ex - ++ ix -++ curt - ++ cla - ++ sqr - ++ inv - ++ cad - ++ cub -++ ed - ++ norm - ++ xrec - ++ ward - ++ scam - ++ etch - ++ curv - ++ deco - ++ bb - ++ puck - ++ suck - ++ sign - ++ veri +##++ aesc +## ++ en +## ++ de +##++ ahem +## ++ cipa +## ++ co +## ++ ix +## ++ ro +## ++ su +## ++ pen +## ++ co +## ++ ix +## ++ ro +## ++ su +## ++ pin +## ++ co +## ++ ix +## ++ ro +## ++ su +## ++ mcol +## ++ pode +## ++ sube +## ++ be +## ++ ankh +## ++ sark +## ++ srow +## ++ subs +## ++ ex +## ++ ix +##++ curt +## ++ cla +## ++ sqr +## ++ inv +## ++ cad +## ++ cub +##++ ed +## ++ norm +## ++ xrec +## ++ ward +## ++ scam +## ++ etch +## ++ curv +## ++ deco +## ++ bb +## ++ puck +## ++ suck +## ++ sign +## ++ veri -section 2eY, SHA-256 +--- +section 2eY, SHA-256 +--- -++ shad -++ shaf -++ shak -++ sham -++ shas -++ shax -++ shaw -++ og - ++ rad - ++ raw -++ shaz -++ shal -++ shan +##++ shad +##++ shaf +##++ shak +##++ sham +##++ shas +##++ shax +##++ shaw +##++ og +## ++ rad +## ++ raw +##++ shaz +##++ shal +##++ shan +--- section 2eZ, OLD rendering +--- -++ show - ++ shep - ++ shop -++ at - ++ r - ++ rf - ++ rn - ++ rt - ++ rta - ++ rtam - ++ rub - ++ rud - ++ rum - ++ rup - ++ ruv - ++ rux +##++ show +## ++ shep +## ++ shop +##++ at +## ++ r +## ++ rf +## ++ rn +## ++ rt +## ++ rta +## ++ rtam +## ++ rub +## ++ rud +## ++ rum +## ++ rup +## ++ ruv +## ++ rux +--- chapter 2f, Hoon proper +--- -section 2fA, miscellaneous funs +--- +section 2fA, miscellaneous funs +--- -++ bull -++ cain -++ cell -++ core -++ cube -++ face -++ bean -++ flay -++ flee -++ foil -++ fork -++ cove -++ comb -++ cond -++ cons -++ fitz -++ flan -++ flip -++ flor -++ hike -++ hoax -++ hoof -++ jock -++ look -++ make -++ noah -++ onan -++ rain -++ ream -++ reck -++ seed -++ seem -++ seer -++ sell -++ pave -++ loot -++ slam -++ slim -++ slit -++ slym -++ slap -++ slop -++ skol -++ spat -++ spuc -++ spec -++ spud -++ slot -++ slum -++ stab -++ wash +##++ bull +##++ cain +##++ cell +##++ core +##++ cube +##++ face +##++ bean +##++ flay +##++ flee +##++ foil +##++ fork +##++ cove +##++ comb +##++ cond +##++ cons +##++ fitz +##++ flan +##++ flip +##++ flor +##++ hike +##++ hoax +##++ hoof +##++ jock +##++ look +##++ make +##++ noah +##++ onan +##++ rain +##++ ream +##++ reck +##++ seed +##++ seem +##++ seer +##++ sell +##++ pave +##++ loot +##++ slam +##++ slim +##++ slit +##++ slym +##++ slap +##++ slop +##++ skol +##++ spat +##++ spuc +##++ spec +##++ spud +##++ slot +##++ slum +##++ stab +##++ wash -section 2fB, macro expansion +--- +section 2fB, macro expansion +--- -++ ah - ++ blue - ++ gray - ++ puce -++ al - ++ blah - ++ home - ++ bunt - ++ clam - ++ cloq - ++ whip -++ ap - ++ etch - ++ feck - ++ hock - ++ open - ++ rake - ++ rusk +##++ ah +## ++ blue +## ++ gray +## ++ puce +##++ al +## ++ blah +## ++ home +## ++ bunt +## ++ clam +## ++ cloq +## ++ whip +##++ ap +## ++ etch +## ++ feck +## ++ hock +## ++ open +## ++ rake +## ++ rusk -section 2fC, compilation proper +--- +section 2fC, compilation proper +--- -++ ut - ++ burn - ++ busk - ++ conk - ++ crop - ++ dext - ++ sint - ++ cool - ++ dank - ++ dart - ++ deal - ++ dial - ++ dish - ++ doge - ++ dole - ++ duck - ++ dune - ++ dunk - ++ fino - ++ fink - ++ finq - ++ fire - ++ firm - ++ fish - ++ fuse - ++ gain - ++ hang - ++ harp - ++ lose - ++ chip - ++ heal - ++ mint - ++ nice - ++ grow - ++ moot - ++ mull - ++ both - ++ nice - ++ grow - ++ bake - ++ meet - ++ nest - ++ cong - ++ cram - ++ dext - ++ sint - ++ park - ++ peek - ++ play - ++ reco - ++ repo - ++ rest - ++ seek - ++ seep - ++ sift - ++ snub - ++ tack - ++ tock - ++ wrap +##++ ut +## ++ burn +## ++ busk +## ++ conk +## ++ crop +## ++ dext +## ++ sint +## ++ cool +## ++ dank +## ++ dart +## ++ deal +## ++ dial +## ++ dish +## ++ doge +## ++ dole +## ++ duck +## ++ dune +## ++ dunk +## ++ fino +## ++ fink +## ++ finq +## ++ fire +## ++ firm +## ++ fish +## ++ fuse +## ++ gain +## ++ hang +## ++ harp +## ++ lose +## ++ chip +## ++ heal +## ++ mint +## ++ nice +## ++ grow +## ++ moot +## ++ mull +## ++ both +## ++ nice +## ++ grow +## ++ bake +## ++ meet +## ++ nest +## ++ cong +## ++ cram +## ++ dext +## ++ sint +## ++ park +## ++ peek +## ++ play +## ++ reco +## ++ repo +## ++ rest +## ++ seek +## ++ seep +## ++ sift +## ++ snub +## ++ tack +## ++ tock +## ++ wrap section 2fD, grammar @@ -7713,9 +7741,12 @@ section 2fD, grammar ifix slammed with [pel per], more slammed with ace, bet. --- - ++ pep - Wrapper tuna. - --- +##++ pep + +Wrapper tuna. + +####Summary + Slam cook with: Build dry %gold gate with sample list of tuna `a` which produces `a` Gonadify pose with: @@ -7730,12 +7761,15 @@ section 2fD, grammar Gonadify plug with bat, easy slammed with null. Terminate plug gonadification. Terminate pose gonadification. - --- - - ++ puv - Wide/tall flow. Parse wide form interpolated Hoon code in any tag, + +--- + +##++ puv + +Wide/tall flow. Parse wide form interpolated Hoon code in any tag, - --- +###Summary + Slam cook with: Build dry %gold with samlpe list of beets `a` which produces `a` The slam of star with: @@ -7760,10 +7794,15 @@ section 2fD, grammar Just slammed with '\0a' Stag slammed with %a, sump Terminate pose gonadification. - --- - ++ rab - Beet to tuna. - --- + +--- + +##++ rab + +Beet to tuna. + +####Summary + Build a dry %gold gate with sample list of beets, `reb` Yield list of tuna. Push bunt of [sim=(list ,@) tuz=(list tuna)] @@ -7776,9 +7815,15 @@ section 2fD, grammar Else: Push `zut` is the toss of `reb` for the tail of `reb`, `sim` for null If: `sim` is null, Then: Produce [i.reb zut], Else: Produce [[%a %smdq (flop sim)] i.reb zut] - ++ sag - Produce a twig from a tuna. - --- + +--- + +##++ sag + +Produce a twig from a tuna. + +####Summary + Build dry %gold gate with sample list of tunas, `lut` Yield twig. Pair %cltr and, @@ -7802,90 +7847,340 @@ section 2fD, grammar if %f, produce where $(lut, t.lut) is the toss of `lut` for the tail of `lut`. Terminate switch statement. - --- - ++ scat - ++ soil - ++ sump - ++ noil - ++ toad - ++ rung - ++ gunk - ++ muck - ++ butt - ++ loaf - ++ lobe - ++ exqa - ++ exqb - ++ exqc - ++ exqd - ++ exqe - ++ norm - ++ boog - ++ wisp - ++ toad - ++ rune - ++ glop - ++ gunk - ++ butt - ++ ulva - ++ hank - ++ loaf - ++ lobe - ++ mash - ++ muck - ++ teak - ++ race - ++ rack - ++ rick - ++ expa - ++ expb - ++ expc - ++ expd - ++ expe - ++ expf - ++ expg - ++ exph - ++ expi - ++ expj - ++ expk - ++ expm - ++ expn - ++ expo - ++ expp - ++ expq - ++ expr - ++ exps - ++ expt - ++ expu - ++ expv - ++ expw - ++ expx - ++ expy - ++ expz - ++ hina - ++ hinb - ++ hinc - ++ hind - ++ hine - ++ hinf - ++ hing - ++ bonk - ++ bont - ++ bony - ++ bonz - ++ lung - ++ long - ++ lobo - ++ loon - ++ lute - ++ rope - ++ tall - ++ wide - ++ hill - ++ howl - ++ toil - ++ wart -++ vest -++ vice +--- +## ++ scat +--- + +## ++ soil + +--- + +## ++ sump + +--- + +## ++ noil + +--- + +## ++ toad + +--- + +## ++ rung + +--- + +## ++ gunk + +--- + +## ++ muck + +--- + +## ++ butt + +--- + +## ++ loaf + +--- + +## ++ lobe + +--- + +## ++ exqa + +--- + +## ++ exqb + +--- + +## ++ exqc + +--- + +## ++ exqd + +--- + +## ++ exqe + +--- + +## ++ norm + +--- + +## ++ boog + +--- + +## ++ wisp + +--- + +## ++ toad + +--- + +## ++ rune + +--- + +## ++ glop + +--- + +## ++ gunk + +--- + +## ++ butt + +--- + +## ++ ulva + +--- + +## ++ hank + +--- + +## ++ loaf + +--- + +## ++ lobe + +--- + +## ++ mash + +--- + +## ++ muck + +--- + +## ++ teak + +--- + +## ++ race + +--- + +## ++ rack + +--- + +## ++ rick + +--- + +## ++ expa + +--- + +## ++ expb + +--- + +## ++ expc + +--- + +## ++ expd + +--- + +## ++ expe + +--- + +## ++ expf + +--- + +## ++ expg + +--- + +## ++ exph + +--- + +## ++ expi + +--- + +## ++ expj + +--- + +## ++ expk + +--- + +## ++ expm + +--- + +## ++ expn + +--- + +## ++ expo + +--- + +## ++ expp + +--- + +## ++ expq + +--- + +## ++ expr + +--- + +## ++ exps + +--- + +## ++ expt + +--- + +## ++ expu + +--- + +## ++ expv + +--- + +## ++ expw + +--- + +## ++ expx + +--- + +## ++ expy + +--- + +## ++ expz + +--- + +## ++ hina + +--- + +## ++ hinb + +--- + +## ++ hinc + +--- + +## ++ hind + +--- + +## ++ hine + +--- + +## ++ hinf + +--- + +## ++ hing + +--- + +## ++ bonk + +--- + +## ++ bont + +--- + +## ++ bony + +--- + +## ++ bonz + +--- + +## ++ lung + +--- + +## ++ long + +--- + +## ++ lobo + +--- + +## ++ loon + +--- + +## ++ lute + +--- + +## ++ rope + +--- + +## ++ tall + +--- + +## ++ wide + +--- + +## ++ hill + +--- + +## ++ howl + +--- + +## ++ toil + +--- + +## ++ wart + +--- + +##++ vest + +--- + +##++ vice + +--- From 3ee6aafaa693c1ed9b03a3dd8fc61e0958d79a82 Mon Sep 17 00:00:00 2001 From: Galen Wolfe-Pauly Date: Fri, 8 Aug 2014 22:48:51 -0400 Subject: [PATCH 09/34] no double underlines --- main/pub/src/site/res/styles.css | 1 + 1 file changed, 1 insertion(+) diff --git a/main/pub/src/site/res/styles.css b/main/pub/src/site/res/styles.css index 3743b51161..dedf19c5e0 100644 --- a/main/pub/src/site/res/styles.css +++ b/main/pub/src/site/res/styles.css @@ -48,6 +48,7 @@ a:focus { li a:hover, p a:hover, li a:hover, p a:focus { + text-decoration: none; border-bottom: 2px solid #555; } From be038f4c1148bf599fbd3e0d93aa42c9473baf97 Mon Sep 17 00:00:00 2001 From: johncburnham Date: Fri, 8 Aug 2014 20:36:35 -0700 Subject: [PATCH 10/34] reworked the site --- main/pub/fab/site/documentation/hymn.hook | 75 - main/pub/fab/site/hymn.hook | 71 +- main/pub/fab/site/ref/foreword/hymn.hook | 6 +- main/pub/fab/site/ref/vol0/hymn.hook | 6 +- main/pub/fab/site/ref/vol1/hymn.hook | 6 +- main/pub/fab/site/ref/vol2/hymn.hook | 6 +- main/pub/fab/site/ref/vol3/hymn.hook | 8 +- main/pub/fab/site/ref/vol4/hymn.hook | 8 +- main/pub/fab/site/tut/arvo1/hymn.hook | 6 +- main/pub/fab/site/tut/arvo2/hymn.hook | 6 +- main/pub/fab/site/tut/hoon1/hymn.hook | 6 +- main/pub/fab/site/tut/hoon2/hymn.hook | 6 +- main/pub/fab/site/tut/hoon3/hymn.hook | 6 +- main/pub/fab/site/tut/hoon4/hymn.hook | 6 +- main/pub/fab/site/tut/hoon5/hymn.hook | 6 +- main/pub/fab/site/tut/hoon6/hymn.hook | 6 +- main/pub/fab/site/tut/hoon7/hymn.hook | 6 +- main/pub/fab/site/tut/nock1/hymn.hook | 6 +- main/pub/fab/site/tut/nock2/hymn.hook | 6 +- main/pub/fab/site/tut/nock3/hymn.hook | 6 +- main/pub/src/doc/intro.md | 55 - main/pub/src/doc/ref/vol2.md | 1314 +---------------- main/pub/src/doc/ref/vol3.md | 170 +-- .../doc/say/2013-09-24-urbit-intro.markdown | 391 ----- main/pub/src/doc/say/arvo/1.md | 8 +- main/pub/src/doc/say/arvo/2.md | 13 +- main/pub/src/doc/say/hoon/1.md | 8 +- main/pub/src/doc/say/hoon/2.md | 8 +- main/pub/src/doc/say/hoon/3.md | 8 +- main/pub/src/doc/say/hoon/4.md | 8 +- main/pub/src/doc/say/hoon/5.md | 8 +- main/pub/src/doc/say/hoon/6.md | 10 +- main/pub/src/doc/say/hoon/7.md | 11 +- main/pub/src/doc/say/nock/1.md | 8 +- main/pub/src/doc/say/nock/2.md | 8 +- main/pub/src/doc/say/nock/3.md | 9 +- main/pub/src/site/res/footer.html | 15 - main/pub/src/site/res/head.html | 39 - main/pub/src/site/res/logo.png | Bin 1040 -> 0 bytes main/pub/src/site/res/sidebar.html | 21 - main/pub/src/site/res/styles.css | 596 -------- 41 files changed, 187 insertions(+), 2779 deletions(-) delete mode 100644 main/pub/fab/site/documentation/hymn.hook delete mode 100644 main/pub/src/doc/intro.md delete mode 100644 main/pub/src/doc/say/2013-09-24-urbit-intro.markdown delete mode 100644 main/pub/src/site/res/footer.html delete mode 100644 main/pub/src/site/res/head.html delete mode 100644 main/pub/src/site/res/logo.png delete mode 100644 main/pub/src/site/res/sidebar.html delete mode 100644 main/pub/src/site/res/styles.css diff --git a/main/pub/fab/site/documentation/hymn.hook b/main/pub/fab/site/documentation/hymn.hook deleted file mode 100644 index 2ed8ddc6fc..0000000000 --- a/main/pub/fab/site/documentation/hymn.hook +++ /dev/null @@ -1,75 +0,0 @@ -:: -:: -:::: - :: -/= sid /^ manx /: /===/pub/src/site/res/sidebar /hymn/ -/= fot /^ manx /: /===/pub/src/site/res/footer /hymn/ -/= sty /^ @t /: /===/pub/src/site/res/styles /css/ -:: -:::: ~tomsyt-balsen - :: -;html - ;head - ;title: Urbit: Personal Cloud Computing - ;style:"{(trip sty)}" - == - ;body - ;+ sid - ;div(class "content container") - ;div(class "page documentation") - ;h1(class "page-title"): Documentation - ;p ; If you want to build a deep understanding of how Urbit works, - ; start with Nock. If you would prefer to just try stuff - ; out, start with Arvo. - == - ;p ; This documentation is a work in progress. Feedback and corrections - ; are welcome. Pull requests are encouraged. The repo for this site - ; lives ;{a(href "https://github.com/urbit/urbit.github.io") "here"}. - ; We would love your help in making this reference more useful. - == - ;p ; Arvo is still actively being changed and updated. - ; As Arvo development cools, more documentation will emerge. - == - ;ul - ;li - ;p:(h2:"Tutorial") - ;strong: Nock - ;ol - ;li:(p:(a/"/gen/main/pub/fab/site/tut/nock1":"Intro to Nock")) - ;li:(p:(a/"/gen/main/pub/fab/site/tut/nock2":"Nock is Easy")) - ;li:(p:(a/"/gen/main/pub/fab/site/tut/nock3":"Using Nock")) - == - ;strong: Hoon - ;ol - ;li:(p:(a/"/gen/main/pub/fab/site/tut/hoon1":"Intro to Hoon")) - ;li:(p:(a/"/gen/main/pub/fab/site/tut/hoon2":"Types")) - ;li:(p:(a/"/gen/main/pub/fab/site/tut/hoon3":"Hoon Computes")) - ;li:(p:(a/"/gen/main/pub/fab/site/tut/hoon4":"Gates")) - ;li:(p:(a/"/gen/main/pub/fab/site/tut/hoon5":"Tiles")) - ;li:(p:(a/"/gen/main/pub/fab/site/tut/hoon6":"Type Inference")) - ;li:(p:(a/"/gen/main/pub/fab/site/tut/hoon7":"Odds, Ends, Quirks")) - == - ;strong: Arvo - ;ol - ;li:(p:(a/"/gen/main/pub/fab/site/tut/arvo1":"Basic Arvo")) - ;li:(p:(a/"/gen/main/pub/fab/site/tut/arvo2":"More Basic Arvo")) - == - == - ;li - ;p:(h2:"Reference") - ;ul - ;li:(p:(a/"/gen/main/pub/fab/site/ref/foreword":";{strong "Foreword"}: Nock")) - ;li:(p:(a/"/gen/main/pub/fab/site/ref/preface":";{strong "Preface"}: Hoon Abstract")) - ;li:(p:(a/"/gen/main/pub/fab/site/ref/vol0":";{strong "Volume 0"}: Version Stub")) - ;li:(p:(a/"/gen/main/pub/fab/site/ref/vol1":";{strong "Volume 1"}: Hoon Structures")) - ;li:(p:(a/"/gen/main/pub/fab/site/ref/vol2":";{strong "Volume 2"}: Hoon Compiler")) - ;li:(p:(a/"/gen/main/pub/fab/site/ref/vol3":";{strong "Volume 3"}: Arvo Core")) - ;li:(p:(a/"/gen/main/pub/fab/site/ref/vol4":";{strong "Volume 4"}: Arvo Vanes")) - ;li:(p:(a/"/gen/main/pub/fab/site/ref/postface":";{strong "Postface"}")) - == - == - == - == - == - == -== diff --git a/main/pub/fab/site/hymn.hook b/main/pub/fab/site/hymn.hook index fab4f8c47b..43383a7979 100644 --- a/main/pub/fab/site/hymn.hook +++ b/main/pub/fab/site/hymn.hook @@ -1,26 +1,73 @@ -:: Top level of the Urbit documentation. :: -:::: /hook/site/src/pub +:: +:::: :: -/= bod /^ manx /: /===/pub/src/doc/intro /psal/ -/= sid /^ manx /: /===/pub/src/site/res/sidebar /hymn/ -/= fot /^ manx /: /===/pub/src/site/res/footer /hymn/ -/= sty /^ @t /: /===/pub/src/site/res/styles /css/ +/= sty /^ @t /: /===/pub/fab/site/styles /css/ :: :::: ~tomsyt-balsen :: ;html ;head - ;title: Urbit + ;title: Urbit: Personal Cloud Computing ;style:"{(trip sty)}" == ;body - ;+ sid ;div(class "content container") - ;div.subpage - ;+ bod + ;div(class "page documentation") + ;h1(class "page-title"): Documentation + ;p ; If you want to build a deep understanding of how Urbit works, + ; start with Nock. If you would prefer to just try stuff + ; out, start with Arvo. + == + ;p ; This documentation is a work in progress. Feedback and corrections + ; are welcome. Pull requests are encouraged. The repo for this site + ; lives ;{a(href "https://github.com/urbit/urbit.github.io") "here"}. + ; We would love your help in making this reference more useful. + == + ;p ; Arvo is still actively being changed and updated. + ; As Arvo development cools, more documentation will emerge. + == + ;ul + ;li + ;p:(h2:"Tutorial") + ;p:(a/"/gen/main/pub/fab/site/tut/setup":"Setup") + ;strong: Nock + ;ol + ;li:(p:(a/"/gen/main/pub/fab/site/tut/nock1":"Intro to Nock")) + ;li:(p:(a/"/gen/main/pub/fab/site/tut/nock2":"Nock is Easy")) + ;li:(p:(a/"/gen/main/pub/fab/site/tut/nock3":"Using Nock")) + == + ;strong: Hoon + ;ol + ;li:(p:(a/"/gen/main/pub/fab/site/tut/hoon1":"Intro to Hoon")) + ;li:(p:(a/"/gen/main/pub/fab/site/tut/hoon2":"Types")) + ;li:(p:(a/"/gen/main/pub/fab/site/tut/hoon3":"Hoon Computes")) + ;li:(p:(a/"/gen/main/pub/fab/site/tut/hoon4":"Gates")) + ;li:(p:(a/"/gen/main/pub/fab/site/tut/hoon5":"Tiles")) + ;li:(p:(a/"/gen/main/pub/fab/site/tut/hoon6":"Type Inference")) + ;li:(p:(a/"/gen/main/pub/fab/site/tut/hoon7":"Odds, Ends, Quirks")) + == + ;strong: Arvo + ;ol + ;li:(p:(a/"/gen/main/pub/fab/site/tut/arvo1":"Basic Arvo")) + ;li:(p:(a/"/gen/main/pub/fab/site/tut/arvo2":"More Basic Arvo")) + ;li:(p:(a/"/gen/main/pub/fab/site/tut/arvo3":"Apps")) + ;li:(p:(a/"/gen/main/pub/fab/site/tut/arvo4":"Functional Publishing I")) + ;li:(p:(a/"/gen/main/pub/fab/site/tut/arvo5":"Functional Publishing II")) + == + == + ;li + ;p:(h2:"Reference") + ;p:(a/"/gen/main/pub/fab/site/ref/foreword":";{strong "Foreword"}: Nock") + ;p:(a/"/gen/main/pub/fab/site/ref/preface":";{strong "Preface"}: Hoon Abstract") + ;p:(a/"/gen/main/pub/fab/site/ref/vol0":";{strong "Volume 0"}: Version Stub") + ;p:(a/"/gen/main/pub/fab/site/ref/vol1":";{strong "Volume 1"}: Hoon Structures") + ;p:(a/"/gen/main/pub/fab/site/ref/vol2":";{strong "Volume 2"}: Hoon Compiler") + ;p:(a/"/gen/main/pub/fab/site/ref/vol3":";{strong "Volume 3"}: Arvo Core") + ;p:(a/"/gen/main/pub/fab/site/ref/vol4":";{strong "Volume 4"}: Arvo Vanes") + == + == == == - ;+ fot == -== +== diff --git a/main/pub/fab/site/ref/foreword/hymn.hook b/main/pub/fab/site/ref/foreword/hymn.hook index 52c5c40ce1..380ebe6fcc 100644 --- a/main/pub/fab/site/ref/foreword/hymn.hook +++ b/main/pub/fab/site/ref/foreword/hymn.hook @@ -1,8 +1,6 @@ +/= sty /^ @t /: /===/pub/fab/site/styles /css/ /= bod /^ manx /: /===/pub/src/doc/ref/nock /psal/ -/= sid /^ manx /: /===/pub/src/site/res/sidebar /hymn/ -/= fot /^ manx /: /===/pub/src/site/res/footer /hymn/ -/= sty /^ @t /: /===/pub/src/site/res/styles /css/ :: :::: ~tomsyt-balsen :: @@ -12,12 +10,10 @@ ;style:"{(trip sty)}" == ;body - ;+ sid ;div(class "content container") ;div.subpage ;+ bod == == - ;+ fot == == diff --git a/main/pub/fab/site/ref/vol0/hymn.hook b/main/pub/fab/site/ref/vol0/hymn.hook index 8dc89978d5..45b53dd323 100644 --- a/main/pub/fab/site/ref/vol0/hymn.hook +++ b/main/pub/fab/site/ref/vol0/hymn.hook @@ -1,7 +1,5 @@ /= bod /^ manx /: /===/pub/src/doc/ref/vol0 /psal/ -/= sid /^ manx /: /===/pub/src/site/res/sidebar /hymn/ -/= fot /^ manx /: /===/pub/src/site/res/footer /hymn/ -/= sty /^ @t /: /===/pub/src/site/res/styles /css/ +/= sty /^ @t /: /===/pub/fab/site/styles /css/ :: :::: ~tomsyt-balsen :: @@ -11,12 +9,10 @@ ;style:"{(trip sty)}" == ;body - ;+ sid ;div(class "content container") ;div.subpage ;+ bod == == - ;+ fot == == diff --git a/main/pub/fab/site/ref/vol1/hymn.hook b/main/pub/fab/site/ref/vol1/hymn.hook index a4eed8b96c..52b4ab01d6 100644 --- a/main/pub/fab/site/ref/vol1/hymn.hook +++ b/main/pub/fab/site/ref/vol1/hymn.hook @@ -1,7 +1,5 @@ +/= sty /^ @t /: /===/pub/fab/site/styles /css/ /= bod /^ manx /: /===/pub/src/doc/ref/vol1 /psal/ -/= sid /^ manx /: /===/pub/src/site/res/sidebar /hymn/ -/= fot /^ manx /: /===/pub/src/site/res/footer /hymn/ -/= sty /^ @t /: /===/pub/src/site/res/styles /css/ :: :::: ~tomsyt-balsen :: @@ -11,12 +9,10 @@ ;style:"{(trip sty)}" == ;body - ;+ sid ;div(class "content container") ;div.subpage ;+ bod == == - ;+ fot == == diff --git a/main/pub/fab/site/ref/vol2/hymn.hook b/main/pub/fab/site/ref/vol2/hymn.hook index dc56256223..2d77aab970 100644 --- a/main/pub/fab/site/ref/vol2/hymn.hook +++ b/main/pub/fab/site/ref/vol2/hymn.hook @@ -1,7 +1,5 @@ +/= sty /^ @t /: /===/pub/fab/site/styles /css/ /= bod /^ manx /: /===/pub/src/doc/ref/vol2 /psal/ -/= sid /^ manx /: /===/pub/src/site/res/sidebar /hymn/ -/= fot /^ manx /: /===/pub/src/site/res/footer /hymn/ -/= sty /^ @t /: /===/pub/src/site/res/styles /css/ :: :::: ~tomsyt-balsen :: @@ -11,12 +9,10 @@ ;style:"{(trip sty)}" == ;body - ;+ sid ;div(class "content container") ;div.subpage ;+ bod == == - ;+ fot == == diff --git a/main/pub/fab/site/ref/vol3/hymn.hook b/main/pub/fab/site/ref/vol3/hymn.hook index 8dc89978d5..b8a6b62edd 100644 --- a/main/pub/fab/site/ref/vol3/hymn.hook +++ b/main/pub/fab/site/ref/vol3/hymn.hook @@ -1,7 +1,5 @@ -/= bod /^ manx /: /===/pub/src/doc/ref/vol0 /psal/ -/= sid /^ manx /: /===/pub/src/site/res/sidebar /hymn/ -/= fot /^ manx /: /===/pub/src/site/res/footer /hymn/ -/= sty /^ @t /: /===/pub/src/site/res/styles /css/ +/= sty /^ @t /: /===/pub/fab/site/styles /css/ +/= bod /^ manx /: /===/pub/src/doc/ref/vol3 /psal/ :: :::: ~tomsyt-balsen :: @@ -11,12 +9,10 @@ ;style:"{(trip sty)}" == ;body - ;+ sid ;div(class "content container") ;div.subpage ;+ bod == == - ;+ fot == == diff --git a/main/pub/fab/site/ref/vol4/hymn.hook b/main/pub/fab/site/ref/vol4/hymn.hook index 8dc89978d5..1a4d79284a 100644 --- a/main/pub/fab/site/ref/vol4/hymn.hook +++ b/main/pub/fab/site/ref/vol4/hymn.hook @@ -1,7 +1,5 @@ -/= bod /^ manx /: /===/pub/src/doc/ref/vol0 /psal/ -/= sid /^ manx /: /===/pub/src/site/res/sidebar /hymn/ -/= fot /^ manx /: /===/pub/src/site/res/footer /hymn/ -/= sty /^ @t /: /===/pub/src/site/res/styles /css/ +/= sty /^ @t /: /===/pub/fab/site/styles /css/ +/= bod /^ manx /: /===/pub/src/doc/ref/vol4 /psal/ :: :::: ~tomsyt-balsen :: @@ -11,12 +9,10 @@ ;style:"{(trip sty)}" == ;body - ;+ sid ;div(class "content container") ;div.subpage ;+ bod == == - ;+ fot == == diff --git a/main/pub/fab/site/tut/arvo1/hymn.hook b/main/pub/fab/site/tut/arvo1/hymn.hook index 2e69ea5c6c..c16d430887 100644 --- a/main/pub/fab/site/tut/arvo1/hymn.hook +++ b/main/pub/fab/site/tut/arvo1/hymn.hook @@ -1,7 +1,5 @@ +/= sty /^ @t /: /===/pub/fab/site/styles /css/ /= bod /^ manx /: /===/pub/src/doc/say/arvo/1 /psal/ -/= sid /^ manx /: /===/pub/src/site/res/sidebar /hymn/ -/= fot /^ manx /: /===/pub/src/site/res/footer /hymn/ -/= sty /^ @t /: /===/pub/src/site/res/styles /css/ :: :::: ~tomsyt-balsen :: @@ -11,12 +9,10 @@ ;style:"{(trip sty)}" == ;body - ;+ sid ;div(class "content container") ;div.subpage ;+ bod == == - ;+ fot == == diff --git a/main/pub/fab/site/tut/arvo2/hymn.hook b/main/pub/fab/site/tut/arvo2/hymn.hook index c7bc9e0d50..1823681ace 100644 --- a/main/pub/fab/site/tut/arvo2/hymn.hook +++ b/main/pub/fab/site/tut/arvo2/hymn.hook @@ -1,7 +1,5 @@ +/= sty /^ @t /: /===/pub/fab/site/styles /css/ /= bod /^ manx /: /===/pub/src/doc/say/arvo/2 /psal/ -/= sid /^ manx /: /===/pub/src/site/res/sidebar /hymn/ -/= fot /^ manx /: /===/pub/src/site/res/footer /hymn/ -/= sty /^ @t /: /===/pub/src/site/res/styles /css/ :: :::: ~tomsyt-balsen :: @@ -11,12 +9,10 @@ ;style:"{(trip sty)}" == ;body - ;+ sid ;div(class "content container") ;div.subpage ;+ bod == == - ;+ fot == == diff --git a/main/pub/fab/site/tut/hoon1/hymn.hook b/main/pub/fab/site/tut/hoon1/hymn.hook index 89cabc5465..73ec84e94c 100644 --- a/main/pub/fab/site/tut/hoon1/hymn.hook +++ b/main/pub/fab/site/tut/hoon1/hymn.hook @@ -1,7 +1,5 @@ +/= sty /^ @t /: /===/pub/fab/site/styles /css/ /= bod /^ manx /: /===/pub/src/doc/say/hoon/1 /psal/ -/= sid /^ manx /: /===/pub/src/site/res/sidebar /hymn/ -/= fot /^ manx /: /===/pub/src/site/res/footer /hymn/ -/= sty /^ @t /: /===/pub/src/site/res/styles /css/ :: :::: ~tomsyt-balsen :: @@ -11,12 +9,10 @@ ;style:"{(trip sty)}" == ;body - ;+ sid ;div(class "content container") ;div.subpage ;+ bod == == - ;+ fot == == diff --git a/main/pub/fab/site/tut/hoon2/hymn.hook b/main/pub/fab/site/tut/hoon2/hymn.hook index e168149669..cbf2441d49 100644 --- a/main/pub/fab/site/tut/hoon2/hymn.hook +++ b/main/pub/fab/site/tut/hoon2/hymn.hook @@ -1,7 +1,5 @@ +/= sty /^ @t /: /===/pub/fab/site/styles /css/ /= bod /^ manx /: /===/pub/src/doc/say/hoon/2 /psal/ -/= sid /^ manx /: /===/pub/src/site/res/sidebar /hymn/ -/= fot /^ manx /: /===/pub/src/site/res/footer /hymn/ -/= sty /^ @t /: /===/pub/src/site/res/styles /css/ :: :::: ~tomsyt-balsen :: @@ -11,12 +9,10 @@ ;style:"{(trip sty)}" == ;body - ;+ sid ;div(class "content container") ;div.subpage ;+ bod == == - ;+ fot == == diff --git a/main/pub/fab/site/tut/hoon3/hymn.hook b/main/pub/fab/site/tut/hoon3/hymn.hook index ba2ee8c855..91432fab6e 100644 --- a/main/pub/fab/site/tut/hoon3/hymn.hook +++ b/main/pub/fab/site/tut/hoon3/hymn.hook @@ -1,7 +1,5 @@ +/= sty /^ @t /: /===/pub/fab/site/styles /css/ /= bod /^ manx /: /===/pub/src/doc/say/hoon/3 /psal/ -/= sid /^ manx /: /===/pub/src/site/res/sidebar /hymn/ -/= fot /^ manx /: /===/pub/src/site/res/footer /hymn/ -/= sty /^ @t /: /===/pub/src/site/res/styles /css/ :: :::: ~tomsyt-balsen :: @@ -11,12 +9,10 @@ ;style:"{(trip sty)}" == ;body - ;+ sid ;div(class "content container") ;div.subpage ;+ bod == == - ;+ fot == == diff --git a/main/pub/fab/site/tut/hoon4/hymn.hook b/main/pub/fab/site/tut/hoon4/hymn.hook index 4bf7e5c091..9dc9197ac8 100644 --- a/main/pub/fab/site/tut/hoon4/hymn.hook +++ b/main/pub/fab/site/tut/hoon4/hymn.hook @@ -1,7 +1,5 @@ +/= sty /^ @t /: /===/pub/fab/site/styles /css/ /= bod /^ manx /: /===/pub/src/doc/say/hoon/4 /psal/ -/= sid /^ manx /: /===/pub/src/site/res/sidebar /hymn/ -/= fot /^ manx /: /===/pub/src/site/res/footer /hymn/ -/= sty /^ @t /: /===/pub/src/site/res/styles /css/ :: :::: ~tomsyt-balsen :: @@ -11,12 +9,10 @@ ;style:"{(trip sty)}" == ;body - ;+ sid ;div(class "content container") ;div.subpage ;+ bod == == - ;+ fot == == diff --git a/main/pub/fab/site/tut/hoon5/hymn.hook b/main/pub/fab/site/tut/hoon5/hymn.hook index 72391f7746..794bc7770d 100644 --- a/main/pub/fab/site/tut/hoon5/hymn.hook +++ b/main/pub/fab/site/tut/hoon5/hymn.hook @@ -1,7 +1,5 @@ +/= sty /^ @t /: /===/pub/fab/site/styles /css/ /= bod /^ manx /: /===/pub/src/doc/say/hoon/5 /psal/ -/= sid /^ manx /: /===/pub/src/site/res/sidebar /hymn/ -/= fot /^ manx /: /===/pub/src/site/res/footer /hymn/ -/= sty /^ @t /: /===/pub/src/site/res/styles /css/ :: :::: ~tomsyt-balsen :: @@ -11,12 +9,10 @@ ;style:"{(trip sty)}" == ;body - ;+ sid ;div(class "content container") ;div.subpage ;+ bod == == - ;+ fot == == diff --git a/main/pub/fab/site/tut/hoon6/hymn.hook b/main/pub/fab/site/tut/hoon6/hymn.hook index 14ee228af7..e6faf2f273 100644 --- a/main/pub/fab/site/tut/hoon6/hymn.hook +++ b/main/pub/fab/site/tut/hoon6/hymn.hook @@ -1,7 +1,5 @@ +/= sty /^ @t /: /===/pub/fab/site/styles /css/ /= bod /^ manx /: /===/pub/src/doc/say/hoon/6 /psal/ -/= sid /^ manx /: /===/pub/src/site/res/sidebar /hymn/ -/= fot /^ manx /: /===/pub/src/site/res/footer /hymn/ -/= sty /^ @t /: /===/pub/src/site/res/styles /css/ :: :::: ~tomsyt-balsen :: @@ -11,12 +9,10 @@ ;style:"{(trip sty)}" == ;body - ;+ sid ;div(class "content container") ;div.subpage ;+ bod == == - ;+ fot == == diff --git a/main/pub/fab/site/tut/hoon7/hymn.hook b/main/pub/fab/site/tut/hoon7/hymn.hook index 3e1301ded6..63043ec28f 100644 --- a/main/pub/fab/site/tut/hoon7/hymn.hook +++ b/main/pub/fab/site/tut/hoon7/hymn.hook @@ -1,7 +1,5 @@ +/= sty /^ @t /: /===/pub/fab/site/styles /css/ /= bod /^ manx /: /===/pub/src/doc/say/hoon/7 /psal/ -/= sid /^ manx /: /===/pub/src/site/res/sidebar /hymn/ -/= fot /^ manx /: /===/pub/src/site/res/footer /hymn/ -/= sty /^ @t /: /===/pub/src/site/res/styles /css/ :: :::: ~tomsyt-balsen :: @@ -11,12 +9,10 @@ ;style:"{(trip sty)}" == ;body - ;+ sid ;div(class "content container") ;div.subpage ;+ bod == == - ;+ fot == == diff --git a/main/pub/fab/site/tut/nock1/hymn.hook b/main/pub/fab/site/tut/nock1/hymn.hook index 8acfdb1d9d..3379b66e57 100644 --- a/main/pub/fab/site/tut/nock1/hymn.hook +++ b/main/pub/fab/site/tut/nock1/hymn.hook @@ -1,7 +1,5 @@ /= bod /^ manx /: /===/pub/src/doc/say/nock/1 /psal/ -/= sid /^ manx /: /===/pub/src/site/res/sidebar /hymn/ -/= fot /^ manx /: /===/pub/src/site/res/footer /hymn/ -/= sty /^ @t /: /===/pub/src/site/res/styles /css/ +/= sty /^ @t /: /===/pub/fab/site/styles /css/ :: :::: ~tomsyt-balsen :: @@ -11,12 +9,10 @@ ;style:"{(trip sty)}" == ;body - ;+ sid ;div(class "content container") ;div.subpage ;+ bod == == - ;+ fot == == diff --git a/main/pub/fab/site/tut/nock2/hymn.hook b/main/pub/fab/site/tut/nock2/hymn.hook index 0735a0865c..74357b2698 100644 --- a/main/pub/fab/site/tut/nock2/hymn.hook +++ b/main/pub/fab/site/tut/nock2/hymn.hook @@ -1,7 +1,5 @@ /= bod /^ manx /: /===/pub/src/doc/say/nock/2 /psal/ -/= sid /^ manx /: /===/pub/src/site/res/sidebar /hymn/ -/= fot /^ manx /: /===/pub/src/site/res/footer /hymn/ -/= sty /^ @t /: /===/pub/src/site/res/styles /css/ +/= sty /^ @t /: /===/pub/fab/site/styles /css/ :: :::: ~tomsyt-balsen :: @@ -11,12 +9,10 @@ ;style:"{(trip sty)}" == ;body - ;+ sid ;div(class "content container") ;div.subpage ;+ bod == == - ;+ fot == == diff --git a/main/pub/fab/site/tut/nock3/hymn.hook b/main/pub/fab/site/tut/nock3/hymn.hook index 4a3702c035..9a2df6246e 100644 --- a/main/pub/fab/site/tut/nock3/hymn.hook +++ b/main/pub/fab/site/tut/nock3/hymn.hook @@ -1,7 +1,5 @@ +/= sty /^ @t /: /===/pub/fab/site/styles /css/ /= bod /^ manx /: /===/pub/src/doc/say/nock/3 /psal/ -/= sid /^ manx /: /===/pub/src/site/res/sidebar /hymn/ -/= fot /^ manx /: /===/pub/src/site/res/footer /hymn/ -/= sty /^ @t /: /===/pub/src/site/res/styles /css/ :: :::: ~tomsyt-balsen :: @@ -11,12 +9,10 @@ ;style:"{(trip sty)}" == ;body - ;+ sid ;div(class "content container") ;div.subpage ;+ bod == == - ;+ fot == == diff --git a/main/pub/src/doc/intro.md b/main/pub/src/doc/intro.md deleted file mode 100644 index 80a2908db0..0000000000 --- a/main/pub/src/doc/intro.md +++ /dev/null @@ -1,55 +0,0 @@ -#What is Urbit? - -We got tired of system software from the 1970s. So we wrote our own. From scratch. - -##Nock, a minimal virtual machine - -[Nock](https://github.com/urbit/urbit/blob/master/urb/zod/spec/nock/5.txt) is a homoiconic combinator algebra, not much fancier than SKI combinators. The spec fits on a T-shirt and gzips to 340 bytes. Nock's data model is simple: a noun is an atom or a cell. An atom is any natural number. A cell is an ordered pair of any two nouns. - -Nock cannot create cycles and needs no GC. Its only arithmetic operator is increment, so it is not inherently efficient; an efficient Nock interpreter works by recognizing standard Nock formulas and matching them to pre-written manual optimizations. We never extend Nock or call out to Unix from it. - -##Hoon, a typed functional language - -Hoon is a strict, typed, functional language that compiles itself to Nock. The Hoon compiler is 4000 lines of Hoon. Adding standard libraries, the self-compiling kernel is 8000 lines. - -Hoon has no particular familial relationship to other languages you may know. It uses its own type inference algorithm and is as different from Haskell as from Lisp. Hoon syntax is also completely unfamiliar. Hoon has the same relationship to Nock that C has to assembly; as thin a layer as possible. It is possible to learn Hoon without Nock, but it's probably not a good idea. - -As a functional systems language, Hoon is especially good at metaprogramming, self-virtualization, hotpatching; marshalling and validating untyped data; decoding and encoding binary message formats. Hoon is designed for event programming, so there is no concurrency model. - -##Arvo, a functional operating system - -Arvo is an event-driven server OS built on the same event library as node.js (libuv). Unlike node.js, Arvo is written in Hoon, isolated from Unix and a persistent single-level store. Arvo can update itself and its data and programs indefinitely from its own state. After the image is created, it lives indefinitely and is never modified externally. - -Arvo is modular. Present modules provide a network messaging protocol, a REPL and task manager, a revision-controlled filesystem, a text console, and an HTTP server. The Arvo codebase is about 6500 lines, which is probably too big. - -##Clay, a global immutable namespace - -Clay is a feature of Arvo: a secure, referentially transparent and decentralized filesystem. The root of the namespace is a global PKI. Each identity serves its own filesystem tree. Files are nouns, not atoms, with arbitrary tree structure. - -Identities, which are also routable addresses, are either key fingerprints or hierarchically assigned short numbers. All numbers are mapped to phonemic strings for memorability. Identities are transferrable and irrevocable; ownership is established by key pinning. The system has a superficial resemblance to Bitcoin, but works more like land than money. It does not use mining or a blockchain. - -Since Clay is immutable, all paths contain a revision, which is either a change number, a date, or a label. A request is a special case of a subscription, so syndication is straightforward. Clay also has a synthesis mode which computes a functional namespace on the client side. - -##What is Urbit good for? - -Urbit is good for everything, of course! It is a new general-purpose computing layer. We look forward to a future where the current Internet exists only as an underground series of tubes which transports you to your Urbit. - -More specifically, Urbit is a personal cloud computer. Right now, the cloud computers we use run OSes designed for minicomputers in the '70s. An ordinary user can no more drive a Linux box in the cloud than fly an A320. So she has to sit in coach class as a row in someone else's database. It's definitely air travel. It's not exactly flying. - -The user of the future will fly her own computer. She will own and control her own identity and her own data. She will even host her own apps. She will not be part of someone else's Big Data. She will be her own Little Data. Unless she's a really severe geek, she will pay some service to store and execute her Urbit ship - but she can move it anywhere else, anytime, for the cost of the bandwidth. - -A user can't manage a general-purpose computer unless she basically understands what it's doing. She may not be a programmer, but she needs at least a rough mental model of her computer's state. - -A personal computer has to be a *simple* computer. This is why we built a new system software stack from scratch, with the goal of bringing it in under 10,000 lines of code. Urbit is about 50% over this complexity budget, but nobody's perfect. - -##What can it do now? - -Urbit at present is not good for anything but screwing around. For screwing around, it answers all your needs and is happy to consume any amount of unwanted time. - -It does basically work as described above, though. Urbit at present propagates all its updates through its own filesystem, runs its own chat server over its own network protocol, etc. As of early 2014, it is an interesting prototype, not a useful device. - -##How can I join the revolution? - -Just wait. If you're cool enough, someone will send you an invitation. - -Psych! No, actually, you can go here. diff --git a/main/pub/src/doc/ref/vol2.md b/main/pub/src/doc/ref/vol2.md index addf5c131d..9d72218119 100644 --- a/main/pub/src/doc/ref/vol2.md +++ b/main/pub/src/doc/ref/vol2.md @@ -1,6 +1,6 @@ -volume 2, Hoon libraries and compiler +#volume 2, Hoon libraries and compiler - chapter 2a, basic unsigned math +##chapter 2a, basic unsigned math ##++add @@ -1017,8 +1017,8 @@ Accepts a list `a` and a gate `b`. Produces the list with the gate applied to ea Activate jet. Build wet %gold gate that accepts two lists, `a` and `b`. Homogenizes both lists and makes them the subject of the following code. - Kick dry %gold trap. - Cast the resulting list to the type of list `b`. + Kick dry %gold trap + Cast the resulting list to the type of list `b`. If: a is null, Then: produce `b`. Else: produce the tuple where `i.a` is the head, and the toss of `a` for `i.a` is the tail. @@ -6583,1309 +6583,3 @@ Produce the cord of a tape. ##++wood -section 2eK, formatting (layout) - -##++re - -##++ram - -##++win - -##++din - -##++fit - -##++rig - -##++wig - -section 2eL, formatting (path) - -##++ab - -##++bix - -##++hif - -##++huf - -##++hyf - -##++pev - -##++pew - -##++piv - -##++piw - -##++qeb - -##++qex - -##++qib - -##++qix - -##++seb - -##++sed - -##++sev - -##++sew - -##++sex - -##++sib - -##++siq - -##++sid - -##++siv - -##++siw - -##++six - -##++sov - -##++sow - -##++sox - -##++ted - -##++tip - -##++tiq - -##++tid - -##++til - -##++urs - -##++urt - -##++voy - -##++vym - -##++vyn - -##++ag - -##++ape - -##++bay - -##++bip - -##++dem - -##++dim - -##++dum - -##++fed - -##++hex - -##++lip - -##++qut - -##++sym - -##++tyq - -##++viz - -##++vum - -##++wiz - -##++co - -##++rear - -##++rent - -##++rend - -##++a-co - -##++d-co - -##++r-co - -##++s-co - -##++v-co - -##++w-co - -##++x-co - -##++y-co - -##++z-co - -##++em-co - -##++ox-co - -##++ro-co - -##++ne - -##++d - -##++x - -##++v - -##++w - -##++mu - -##++zag - -##++zig - -##++zug - -##++so - -##++bisk - -##++crub - -##++nuck - -##++nusk - -##++perd - -##++royl - -##++tash - -##++twid - -##++zust - -##++scot - -##++scow - -##++slav - -##++slaw - -##++slay - -##++smyt - -section 2eM, regular-expressions - -##++pars - -##++nor - -##++les -##++lep - -##++alm - -##++alb - -##++mis - -##++anns - -##++mall - -##++bets - -##++ranc - -##++flap - -##++rang - -##++chun - -##++seac - -##++sead - -##++sade - -##++seap - -##++cape - -##++lower - -##++upper - -##++digit - -##++print - -##++graph - -##++blank - -##++space - -##++cntrl - -##++alpha - -##++alnum - -##++punct - -##++wordc - -##++white - -##++xdigi - -##++chad - -##++escd - -##++escp - -##++unid - -##++proc - -##++cont - -##++abor - -##++matc - -##++chet - -##++blak - -##++deep - -##++rexp - -##++repg - -section 2eN, pseudo-cryptography - -##++un - -##++wre - -##++wre - -##++xaf - -##++xar - -##++zaf - -##++zar - -##++zyf - -##++zyr - -section 2eO, virtualization - -##++mack - -Accpet a nock subject-formula cell. -Produce a unit result, treating 11 as a crash (i.e. pure nock). - -####Summary - - Creates a dry %gold gate accepting cell ['sub' 'fol']. - Its output is a unit (of a noun). - Let 'ton' be the result of minking the sample, with a sky that produces - ~ on any input, halting interpretation. - Unless ton has stem 0, produce the empty unit, otherwise produce one - containing ton's bulb. - -####Examples - - ~zod/try=> (mack [[1 2 3] [0 1]]) - [~ [1 2 3]] - ~zod/try=> (mack [41 4 0 1]) - [~ 42] - ~zod/try=> (mack [4 0 4]) - ~ - ~zod/try=> (mack [[[0 2] [1 3]] 4 4 4 4 0 5]) - [~ 6] - ~zod/try=> ;;((unit ,@tas) (mack [[1 %yes %no] 6 [0 2] [0 6] 0 7])) - [~ %no] - -##++mink - -Bottom-level mock (virtual nock) interpreter. - -####Summary - - Accepts a nock subject-formula cell, and an %iron gate which - accepts any noun and produces a unit, which is defined to be mock 11. - Produces a ++tone, which is the result of the virtualized computation. - --- - For clarity, a ++tone with stem %0 will be referred to as a "success", - one with stem %1 as a "block", and one with stem %2 as a "crash". - --- - Activate jet. - Creates a dry %gold gate accepting cell ['sub' 'fol'] and gate 'sky'. - Let 'tax' be a statically bunted list of term-noun pairs. (hint list) - Do (recursion point) produce a tone: - If fol is an atom - Produce a crash of fol. - Else if the head of fol is a cell - Let hed be the result of recurring with fol replaced by its head. - If hed is a crash - Yield it - Otherwise let 'tal' be the result of recurring with fol replaced - by its tail. - Switch on the type of tal by stem: - If tal is a success - If hed is a block produce hed. - Else (success) produce a success of a cell of the bulbs of hed - and tal. - If tal is a block - If hed is a success produce tal. - Else (block) produce a block of welding the bulbs of hed and tal. - Else (crash) produce tal - Otherwise (the head of fol is an atom) switch on fol, - by default producing a crash of tax. - If fol has stem 0 and an atom bulb we name 'b' - If b is 0 produce a crash of tax. - If b is 1 produce a success of sub. - If sub is an atom produce a crash of tax - Otherwise let 'now' be the cap of b, and 'lat' be the mas of b - Tail-recur with b replaced by lat, and sub replaced by: if now is 2, - its head, else its tail. - If fol has stem 1 and a bulb we name 'b' - Produce a success of b - If fol has stem 2 and a bulb whose head is a cell. - Let 'ben' be the result of recurring with fol replaced by its bulb. - Unless ben is a success, produce ben. - Else assert that ben contains a cell, and tail-recur with - sub and fol replaced by the head and tail of ben's bulb - If fol has stem 3 and a bulb we name 'b' - Let 'ben' be the result of recurring with fol replaced by b. - Unless ben is a success, produce ben. - Else produce a success of (loobean) whether ben contains a cell. - If fol has stem 4 and a bulb we name 'b' - Let 'ben' be the result of recurring with fol replaced by b. - Unless ben is a success, produce ben. - Else unless ben contains an atom produce a crash of tax. - Otherwise produce a success of ben's contents, incremented. - If fol has stem 5 and a bulb we name 'b' - Let 'ben' be the result of recurring with fol replaced by b. - Unless ben is a success, produce ben. - Else unless ben contains a cell produce a crash of tax. - Otherwise produce a success of (loobean) whether the bulb of ben has - a tail equal to its head. - If fol has stem 6, 7, 8, or 9 - Tail-recur with its bulb expanded per nock specification. - If fol has stem 10 and a cell bulb whose head is an atom - Tail-recur with for replaced by its bulb's tail - If fol has stem 10 and a bulb that can be destructured as [[b c] d] - Let ben be the result of recurring with fol replaced by v. - Unless ben is a success, produce ben. - If b is %hunk, %lose, %mean, or %spot - Tail-recur with fol replaced by d and tax prepended with a pair of - b and the bulb of ben. - Else tail-recur with just fol replaced by d. - -####Examples - - XX - -##++mock - -Accepts a nock subject-formula cell and an %iron gate which -accepts any noun and produces a unit (this is used as nock 11). -Produces a ++toon, which is a sucesful, blocked, or crashed result. - -####Summary - - Compose ++mook and ++mink. - -####Examples - - ~zod/try=> (mock [5 4 0 1] ,~) - [%0 p=6] - ~zod/try=> (mock [~ 11 1 0] |=(* `999)) - [%0 p=999] - ~zod/try=> (mock [~ 0 1.337] ,~) - [%2 p=~] - ~zod/try=> (mock [~ 11 1 1.337] ,~) - [%1 p=~[1.337]] - ~zod/try=> (mock [[[4 4 4 4 0 3] 10] 11 9 2 0 1] |=(* `[+<])) - [%0 p=14] - ~zod/try=> (mock [[[4 4 4 4 0 3] 10] 11 9 2 0 1] |=(* `[<+<>])) - [%0 p=[49 52 0]] - ~zod/try=> ;;(tape +:(mock [[[4 4 4 4 0 3] 10] 11 9 2 0 1] |=(* `[<+<>]))) - "14" - -####++mook - -Intelligently render crash annotation. - -####Summary - - Accepts a ++tone, produces a ++toon - --- - Create a dry %gold gate accepting a tone we name 'ton' - Its output is a toon. - Unless the stem of ton is %2, produce ton. - Produce a frond with a stem of 2 and the following bulb: - Let yel be the length of ton's bulb. - Replace the bulb of ton, - If yel > 256 (otherwise keep it static) - With the weld of - its top 128 elements - And a list of term-noun pairs: - The last 128 elements of ton's bulb - Preceded by a %lose-stemmed frond of - A cord from the tape - "[skipped " - A @ud rendering of yel - 256 - " frames]" - Do (*recursion point*) produce a list of tanks: - For each element in the bulb of ton - Switch on its leaf, by default leaving the element out of the product - For each %hunk, clam it to a tank - For each %lose, produce a leaf with the element clammed to an atom - and tripped (to a tape). - For each %mean, if the elment is an atom treat it as a %lose - Otherwise let mac be the element macked by its tail. - If the computation fails, produce a "####" leaf, else clam - the result to a tank. - For each %spot, let sot be the element clammed to a spot. - Produce a leaf with - The weld of - The path in sot converted to a tank and then a tape - ":<[" - [[p.p ] ] in the pint in sot rendered as @ud - " " - [[ q.p] ] in the pint in sot rendered as @ud - "].[" - [ [p.q ]] in the pint in sot rendered as @ud - " " - [ [ q.p]] in the pint in sot rendered as @ud - "]>" - -####Examples - - ~zod/try=> (mook [%0 5 4 5 1]) - [%0 p=[5 4 5 1]] - ~zod/try=> (mook [%2 ~[[%hunk %rose ["<" "," ">"] ~[[%leaf "err"]]]]]) - [%2 p=~[[%rose p=[p="<" q="," r=">"] q=[i=[%leaf p="err"] t=~]]]] - ~zod/try=> (mook [%2 ~[[%malformed %elem] [%lose 'do print']]]) - [%2 p=~[[%leaf p="do print"]]] - ~zod/try=> (mook [%2 ~[[%spot /b/repl [[1 1] 1 2]] [%mean |.(!!)]]]) - [%2 p=~[[%leaf p="/b/repl/:<[1 1].[1 2]>"] [%leaf p="####"]]] - -####++mang - -Mang is just like mack, but accepting a sky. -It produces a unit computation result. - -####Summary - - Creates a dry %gold gate accepting cell ['sub' 'fol'] and an - %iron unit-clam 'sky'. - Its output is a unit (of a noun). - Let 'ton' be the result of monging the sample. - Unless ton has stem 0, produce the empty unit, otherwise produce one - containing ton's bulb. - -##++mung - -##++mule - -##++mute - -section 2eP, diff **noted as "(move me)" in source** - -++ berk -++ diff -++ loss - ++ abet - ++ hink - ++ lonk - ++ lune - ++ merg - ++ main -++ locz -++ lore -++ role -++ lump -++ lure -++ limp -++ hump -++ husk -++ lurk -++ lusk - ++ abet - ++ done - ++ main -++ nude - ++ axes - ++ tred - -section 2eW, lite number theory - -++ egcd -++ pram -++ ramp -++ fo - ++ dif - ++ exp - ++ fra - ++ inv - ++ pro - ++ sit - ++ sum -++ ga - ++ dif - ++ dub - ++ pro - ++ toe - ++ sit - ++ fra - ++ inv - ++ pow - ++ pro - -section 2eX, jetted crypto - -++ aesc - ++ en - ++ de -++ ahem - ++ cipa - ++ co - ++ ix - ++ ro - ++ su - ++ pen - ++ co - ++ ix - ++ ro - ++ su - ++ pin - ++ co - ++ ix - ++ ro - ++ su - ++ mcol - ++ pode - ++ sube - ++ be - ++ ankh - ++ sark - ++ srow - ++ subs - ++ ex - ++ ix -++ curt - ++ cla - ++ sqr - ++ inv - ++ cad - ++ cub -++ ed - ++ norm - ++ xrec - ++ ward - ++ scam - ++ etch - ++ curv - ++ deco - ++ bb - ++ puck - ++ suck - ++ sign - ++ veri - -section 2eY, SHA-256 - -++ shad -++ shaf -++ shak -++ sham -++ shas -++ shax -++ shaw -++ og - ++ rad - ++ raw -++ shaz -++ shal -++ shan - -section 2eZ, OLD rendering - -++ show - ++ shep - ++ shop -++ at - ++ r - ++ rf - ++ rn - ++ rt - ++ rta - ++ rtam - ++ rub - ++ rud - ++ rum - ++ rup - ++ ruv - ++ rux - -chapter 2f, Hoon proper - -section 2fA, miscellaneous funs - -++ bull -++ cain -++ cell -++ core -++ cube -++ face -++ bean -++ flay -++ flee -++ foil -++ fork -++ cove -++ comb -++ cond -++ cons -++ fitz -++ flan -++ flip -++ flor -++ hike -++ hoax -++ hoof -++ jock -++ look -++ make -++ noah -++ onan -++ rain -++ ream -++ reck -++ seed -++ seem -++ seer -++ sell -++ pave -++ loot -++ slam -++ slim -++ slit -++ slym -++ slap -++ slop -++ skol -++ spat -++ spuc -++ spec -++ spud -++ slot -++ slum -++ stab -++ wash - -section 2fB, macro expansion - -++ ah - ++ blue - ++ gray - ++ puce -++ al - ++ blah - ++ home - ++ bunt - ++ clam - ++ cloq - ++ whip -++ ap - ++ etch - ++ feck - ++ hock - ++ open - ++ rake - ++ rusk - -section 2fC, compilation proper - -++ ut - ++ burn - ++ busk - ++ conk - ++ crop - ++ dext - ++ sint - ++ cool - ++ dank - ++ dart - ++ deal - ++ dial - ++ dish - ++ doge - ++ dole - ++ duck - ++ dune - ++ dunk - ++ fino - ++ fink - ++ finq - ++ fire - ++ firm - ++ fish - ++ fuse - ++ gain - ++ hang - ++ harp - ++ lose - ++ chip - ++ heal - ++ mint - ++ nice - ++ grow - ++ moot - ++ mull - ++ both - ++ nice - ++ grow - ++ bake - ++ meet - ++ nest - ++ cong - ++ cram - ++ dext - ++ sint - ++ park - ++ peek - ++ play - ++ reco - ++ repo - ++ rest - ++ seek - ++ seep - ++ sift - ++ snub - ++ tack - ++ tock - ++ wrap - -section 2fD, grammar - -++ vang -++ vast - ++ gash - ++ gasp - ++ glam - ++ hasp - ++ mota - ++ plex - ++ pray - ++ prey - ++ phax - ++ posh - ++ poof - ++ poon - ++ poor - ++ porc - ++ rump - ++ rood - ++ rupl - ++ sail - Templating language for rendering HTML web documents. - --- - Build dry %gold gate with sample bean `tol`. - Push bunt of bean `lin` onto the core below. - Build core, - --- - ++ ape - The apex node of - --- - Slam cook with: - The reverse of `amp` and the following gate: - Build dry %gold gate with sample tuna `tum`. Yield twig. - If: `tum` is [%e *], an element, - Then: Produce the twig of twig `p.tum` and sag slammed with `q.tum` - Else: Produce the sag slammed with `tum` and null, the twig of `tum` - --- - ++ amp - Entry point of the XML tree. Start parsing a template at `sem`. - Continue to parse with ++ba if in tall form and ++bat if in wide form. - --- - Gonadify pfix with: - sem, - If: tol, - Then: bam, - Else: bat - --- - ++ bam - Begin to parse the template in tall form. - --- - Slam knee with: - The bunt of tuna. - Build dry %gold trap which is cached (memoized) - Gonadify pose with: - Stag slammed with %f, pfix gonadified with: - (plus ace), 1 or whitespaces, - Cook slammed with rab, puv - Stag slammed with %e, pfix gonadified with: - `ag, - nal - Stag slammed with %e, hul, - Stag slammed with %f, nup, - Gonadify pfix with: - tis, - Stag slammed with %f, nol - Gonadify pfix with: - hep - Stag slammed with: - %a, - Gonadify pfix with gap, talL - Gonadify pfix with: - lus - Stag slammed with: - %b, - Gonadiffy pfix with gap, tall - Gonadify pfix with: - tar - Stag slammed with: - %c, - Gonadify pfix with gap, tall - Gonadify pfix with: - cen - Stag slammed with: - %d, - Gonadify pfix with gap, tall - Slam easy with [%f [%a [%smdq 10 ~]] ~] - --- - ++ bat - Begin to parse an entire template line in wide form. - --- - Slam knee with: - The bunt of tuna - Build dry %gold trap which is cached (memoized) - Gonadify pose with: - Stag slammed with %f, nup - Stag slammed with %f, ped - Stag slammed with: - %e, - Gonadify plug with hip, lif - Terminate pose gonadification. - --- - ++ bet - Begin to parse an inner line section in wide form. - --- - Slam knee with: - The bunt of tuna - Build dry %gold trap which is cached (memoized) - Gonadify pose with: - bat, - Gonadify pfix with: - hep - Stag slammed with %a, wide - Gonadify pfix with: - lus - Stag slammed with %b, wide - Gonadify pfix with: - tar - Stag slammed with %c, wide - Gonadify pfix with: - cen - Stag slammed with %d, wide - Terminate pose gonadification. - --- - ++ fry - Element or attribute name. - May contain '_', signifying ':', optionally followed by - class and/org id - --- - Slam cook with: - Build dry %gold gate with sample term `a`, unit term `b`: - If: `b` is null, - Then: Produce [%dtzz %tas a], - Else: Produce [[%dtzz %tas a] [%dtzz %tas u.b]] - Gonadify plug with: - sym, - Gonadify pose with: - Stag slammed with null, pfix gonadified with cab, sym. - Easy slammed with null. - ++ hag - Tag head - --- - Slam cook with: - Build dry %gold gate with sample twig `a` and produces `a`. - Gonadify plug with: - Stag slammed with: - %dtzz, - Stag slammed with: - %tas - Pose gonadified with: - Jest slammed with %script, - Jest slammed with %style, - Stag slammed with %clsg, jaw - Terminate plug gonadification. - ++ hig - Simple tag head. - --- - Slam cook with: - Build dry %gold gate with sample twig `a`, list of twigs `b`. Produce [a %clsg b]. - hog. - ++ hog - Tag head. - --- - Slam cook with: - Build dry %gold gate with sample tile: - twig `a` - unit term `b` - unit term `c` - unit twig `d` - list of twigs `e` - Terminate tile construction. - Yield pair of twig, list of twigs. - Set `e` to: If: `b` is null, - Then: Produce `e`, - Else: Produce [[[%dtzz %tas %class] [%smdq (trip u.b)]] e] - Set `e` to: If: `c` is null, - Then: Produce `e`, - Else: Produce [[[%dtzz %tas %id] [%smdq (trip u.c)]] e] - Set `e` to: If: `d` is null, - Then: Produce `e`, - Else: Produce [[[%dtzz %tas %href] u.d] e] - Produce pair [a e]. - Gonadify plug with: - fry, - Pose gonadified with: - Stag slammed with null, pfix gonadified with dot, sym - Easy slammed with null, - Pose gonadified with stag slammed with - Stag slammed with null, pfix gonadified with hax, sym - Easy slammed with null, - Pose gonadified with stag slammed with - Stag slammed with null, pfix gonadified with dot, stag slammed with %smdg, soil - Easy slammed with null, - Pose gonadified with: - ifix slammed with [pel per] and, - More slammed with plug gonadified with com, ace and, - Plug gonadified with fry, pfix gonadified with ace, wide - Easy slammed with null - Terminate pose gonadification. - Terminate plug gonadification. - ++ hoy - Tail attributes. - --- - Star slammed with: - pfix gonadified with: - plug gonadified with gap, tis - plug gonadified with fry, pfix gonadified with gap, tall - Terminate pfix gonadification. - ++ hul - Tall preface. - --- - Cook slammed with: - Build dry %gold gate with sample element tuna `a`, list twig `b`, list tuna `c`, - Yield [twig (list tuna)] element tuna. - Produce [[p.a %clsg (weld q.a b)] c] - Gonadify plug with hog, hoy, nol - ++ jaw - Wide attributes - --- - Gonadify pose with: - ifix slammed with [pel per] and, - More slammed with plug gonadified with com, ace, and, - plug gonadified fry, pfix gonadified with ace, wide - Easy slammed with null. - Terminate pose gonadification. - ++ lif - Wide elements. - --- - Slam cook with: - Build dry %gold gate with sample list of tuna `a` which produces `a` - Gonadify pose with: - pfix gonadied with col, pep - cold slammed with null, sem - easy slammed with null - --- - ++ luf - Wide elements. - --- - Slam cook with: - Build dry %gold gate with sample list of tuna `a` which produces `a` - Star slammed with: - Gonadify pfix with ace, bet. - --- - ++ nal - Unescaped tall tail. - --- - Slam cook with sample: - Build dry %gold gate with sample list of tuna `a` which produces `a`, - Slam ifix with: - Tile autoons gap and plug gonadified with gap, duz, - Slam most with: - gap, - Gonadify pfix with: - Gonadify pose with: - Gonadify pfix with: - ace, - Cook slammed with: - Build dry %gold gate with sample tape `a` which produces: - [%a %smdq (weld a `tape`[`@`10 ~])], - where (weld a `tape`[`@`10 ~] is the concatenation - of tape `a` with the newline character. - Star slammed with shim slamme with 32, 255. - Terminate pfix gonadification. - Terminate pose gonadification. - Terminate pfix gonadification. - - --- - ++ nol - Tall tail. - --- - Assert that tol is true, that we are parsing a tall form part of the template. - Slam cook with: - Build dry %gold gate with sample list of tuna `a` which produces `a`, - Gonadify pose with: - Slam cold with null, sem - pfix gonadified with col, pep called with tol replaced by false, to continue to parse in wide form. - pfix gonadified with: - Gonadify plug with col, ace. - Slam cook with rab called with tol replaced by false, to continue to parse in wide form, and puv. - ifix slammed with: - [gap :~(plug gap duz)], which disregards non-code before plug gonadifed with gap and duz. - Most slammed with gap, amp. - Temrinate pose gonadification. - --- - ++ nup - Wide quote. - --- - Slam cook with: - Build dry %gold gate with sample list of tuna `a` which produces `a` - Gonadify pose with: - Gonadify less with: - jest slammed with '"""'< - ifix slammed with: - [doq doq] - Cook slammed with rab, puv - inde slammed with: - ifix slammed with: - Jest slammed with '"""\0a' and jest slammed with '\0a"""', - Cook slammed with rab, puv called with `lin` tossed for false. - Terminate pose gonnadification. - --- - - ++ pab - Bracketed element. - --- - Slam ifix with [kel ker], plug gonadified with: - hig, to parse an uppercase letter followed by, - luf, to parse wide elements. - --- - - ++ ped - Wide flow. - --- - Slam cook with: - Dry %gold gate with sample list of tuna `a` which produces `a` - ifix slammed with [pel per], more slammed with ace, bet. - --- - - ++ pep - Wrapper tuna. - --- - Slam cook with: - Build dry %gold gate with sample list of tuna `a` which produces `a` - Gonadify pose with: - ped, - ifix slammed with: - [pel per], - More slammed with ace, bet - cook slammed with: - Build dry %gold gate with sample cord, - Which produces list of element [%a %smdg (trip +<)]. - qut - Gonadify plug with bat, easy slammed with null. - Terminate plug gonadification. - Terminate pose gonadification. - --- - - ++ puv - Wide/tall flow. Parse wide form interpolated Hoon code in any tag, - - --- - Slam cook with: - Build dry %gold with samlpe list of beets `a` which produces `a` - The slam of star with: - Gonadify pose with: - pfix gonadified with: - bas, - pose slammed with: - mask slammed with tape "-+*%;\{", - bas, doq, bix:ab. - pfix gonadified with hep, stag slammed with %a, sump - pfix gonadified with lus, stag slammed with %b, sump - pfix gonadified with tar, stag slammed with %c, sump - pfix gonadified with cen, stag slammed with %d, sump - pfix gonadified with sem, stag slammed with %e, - less gonadified with: - bas, kel, - If: tol, Then: fail, Else: doq - prn - If: lin, Then: fail, - Else: Gonadify less with: - Jest slammed with '\0a"""', - Just slammed with '\0a' - Stag slammed with %a, sump - Terminate pose gonadification. - --- - ++ rab - Beet to tuna. - --- - Build a dry %gold gate with sample list of beets, `reb` - Yield list of tuna. - Push bunt of [sim=(list ,@) tuz=(list tuna)] - Kick dry %gold trap. Yield list of tuna. - If: `reb` is null, - Then: Set `sim` to Unless: tol, Then: Produce sim, - Else: Produce [10 |-(?~(sim sim ?:(=(32 i.sim) $(sim t.tim) sim)))] - Else: If: The head of `reb` is an atom, - Then: Produce the toss `reb` for the tail of `reb`, `sim` for [i.reb sim] - Else: Push `zut` is the toss of `reb` for the tail of `reb`, `sim` for null - If: `sim` is null, Then: Produce [i.reb zut], - Else: Produce [[%a %smdq (flop sim)] i.reb zut] - ++ sag - Produce a twig from a tuna. - --- - Build dry %gold gate with sample list of tunas, `lut` - Yield twig. - Pair %cltr and, - Build dry %gold trap. Yield list of twigs. - If: `lut` is null, - Then: Produce [[%dtzz %n ~] ~], - Else: Switch on the head of the head of `lut`, - if %a, produce [[%clfs p.i.lut] $(lut, t.lut)], - if %b, produce [p.i.lut $(lut t.lut)] - if %c, produce the reverse cell of null and, - Triple %cndt, cast of [p.i.lut $(lut t.lut)] to a twig and, - Triple %tsbr, cast of [[%axil %noun] [%axil %noun]] to a tile and, - Pair %brcn and, - Yield a map of terms to feet, - Reverse cell of [~ ~] and, - Push `sug` is [[%& 12] ~] - Triple %$, %elm, and, - Quad %wtsg, `sug`, [%cnts `sug` [[[%& 1] ~] [~ 13]]] - if %d, produce [%cnhp] - if %e, produce - if %f, produce - where $(lut, t.lut) is the toss of `lut` for the tail of `lut`. - Terminate switch statement. - --- - ++ scat - ++ soil - ++ sump - ++ noil - ++ toad - ++ rung - ++ gunk - ++ muck - ++ butt - ++ loaf - ++ lobe - ++ exqa - ++ exqb - ++ exqc - ++ exqd - ++ exqe - ++ norm - ++ boog - ++ wisp - ++ toad - ++ rune - ++ glop - ++ gunk - ++ butt - ++ ulva - ++ hank - ++ loaf - ++ lobe - ++ mash - ++ muck - ++ teak - ++ race - ++ rack - ++ rick - ++ expa - ++ expb - ++ expc - ++ expd - ++ expe - ++ expf - ++ expg - ++ exph - ++ expi - ++ expj - ++ expk - ++ expm - ++ expn - ++ expo - ++ expp - ++ expq - ++ expr - ++ exps - ++ expt - ++ expu - ++ expv - ++ expw - ++ expx - ++ expy - ++ expz - ++ hina - ++ hinb - ++ hinc - ++ hind - ++ hine - ++ hinf - ++ hing - ++ bonk - ++ bont - ++ bony - ++ bonz - ++ lung - ++ long - ++ lobo - ++ loon - ++ lute - ++ rope - ++ tall - ++ wide - ++ hill - ++ howl - ++ toil - ++ wart -++ vest -++ vice - - diff --git a/main/pub/src/doc/ref/vol3.md b/main/pub/src/doc/ref/vol3.md index 80cfc9dfc3..2a7ec09a88 100644 --- a/main/pub/src/doc/ref/vol3.md +++ b/main/pub/src/doc/ref/vol3.md @@ -1,90 +1,90 @@ -volume 3, Arvo models and skeleton +#volume 3, Arvo models and skeleton -++ arch -++ bead -++ care -++ case -++ desk -++ cage -++ chop -++ curd -++ disk -++ duct -++ gene -++ glob -++ herd -++ hilt -++ hypo -++ khan -++ lens - ++ v - ++ w - ++ x - ++ y - ++ z -++ logo -++ lode -++ mark -++ mill -++ milt -++ monk -++ mold -++ muse -++ mosh -++ move -++ ovum -++ pane -++ pone -++ ship -++ sled -++ slut -++ vile -++ wire -++ slod -++ slub + ++ arch + ++ bead + ++ care + ++ case + ++ desk + ++ cage + ++ chop + ++ curd + ++ disk + ++ duct + ++ gene + ++ glob + ++ herd + ++ hilt + ++ hypo + ++ khan + ++ lens + ++ v + ++ w + ++ x + ++ y + ++ z + ++ logo + ++ lode + ++ mark + ++ mill + ++ milt + ++ monk + ++ mold + ++ muse + ++ mosh + ++ move + ++ ovum + ++ pane + ++ pone + ++ ship + ++ sled + ++ slut + ++ vile + ++ wire + ++ slod + ++ slub -section 3bE, Arvo core +##section 3bE, Arvo core -++ vent - ++ ruck - ++ wink - ++ doze - ++ sike - ++ souk - ++ sunk - ++ song - ++ spuc - ++ sump - ++ said - ++ scry - ++ soar - ++ swim -++ vint -++ viol -++ is - ++ beck - ++ dink - ++ dint - ++ doos - ++ hurl - ++ race - ++ fire - ++ jack - ++ kick + ++ vent + ++ ruck + ++ wink + ++ doze + ++ sike + ++ souk + ++ sunk + ++ song + ++ spuc + ++ sump + ++ said + ++ scry + ++ soar + ++ swim + ++ vint + ++ viol + ++ is + ++ beck + ++ dink + ++ dint + ++ doos + ++ hurl + ++ race + ++ fire + ++ jack + ++ kick -Postface +##Postface - ++ come - ++ keep - ++ load - ++ peek - ++ poke - ++ wish -++ come -++ keep -++ load -++ peek -++ poke -++ vega -++ veer -++ wish + ++ come + ++ keep + ++ load + ++ peek + ++ poke + ++ wish + ++ come + ++ keep + ++ load + ++ peek + ++ poke + ++ vega + ++ veer + ++ wish diff --git a/main/pub/src/doc/say/2013-09-24-urbit-intro.markdown b/main/pub/src/doc/say/2013-09-24-urbit-intro.markdown deleted file mode 100644 index 5b27cf9947..0000000000 --- a/main/pub/src/doc/say/2013-09-24-urbit-intro.markdown +++ /dev/null @@ -1,391 +0,0 @@ ---- -layout: post -category: blog -author: cgy -title: Welcome to Urbit -date: 2013-9-24 15:00 ---- -But wait - what the hell is Urbit? - -One of Urbit's problems is that we don't exactly have a word for -what Urbit is. If there is such a word, it somehow means both -"operating system" and "network protocol," while somehow also -implying "functional" and "deterministic." - -Not only is there no such word, it's not even clear there -_should_ be one. And if there was, could we even hear it? -As Wittgenstein said: if a lion could talk, we would not -understand him. But heck, let's try anyway. - -As a network protocol, we could call Urbit a "seven-layer -protocol" - that is, a protocol that specifies the complete -semantics of the general-purpose computer that processes it. As -any decent IETF ninja will tell you, this is a very bad idea for -all sorts of extremely obvious reasons. - -And from the OS perspective, Urbit is yet another slice of -userspace crap with the temerity to call itself an "operating -system." Urbit is not actually an OS in the bare-metal sense. -It's a VM that runs on Linux or OS X. Someday it might be so -daring as to descend to Xen. Urbit has no interest at all in -drivers, peripherals, etc. It is just a UDP transceiver in the -cloud. Worst of all - Urbit is not even preemptive. A poser! -(Actually all the real work, as in node, is done by libuv.) - -Moreover, this VM is formally isolated from your actual OS. And -everything that uses it. Nothing in Urbit can request system -services or call existing libraries. So Urbit is not only badly -designed and fraudulently hyped. It's also profoundly useless. - -Well... your browser has been reasonably successful with this -restriction. But your browser was never designed to be any kind -of OS. To the extent that it's sort of become an OS, it is -specialized for the very undemanding job of being a client. A -general-purpose client, which is neat. But not a general-purpose -server - which is a much harder problem. - -A general-purpose server is a slab of code that feels totally -confident when faced with the problem of storing _all your -personal and/or corporate data_, across _arbitrary functional -upgrades_, for _all time forever_, while efficiently executing -and managing _any useful program or programs, transient or -persistent_. Yeah, that's a server OS. - -So, conventionally, this industrial strength slab of code is -written with conventional OS techniques involving (a) bare metal -and (b) like, semaphores and shit. The kernel alone is like 12 -million lines of code. Not that a browser is any much smaller. - -And so, 20th-century network computing is the world's most -beautiful wire, between two dumpsters of shit spaghetti. Two -_completely different_ dumpsters. It turns out that with a big -enough dumpster of shit spaghetti, you can feed the world. And -why not two? Incompatibility creates jobs, you know. - -Oh, and you can have a client without an identity. But you can't -have a _server_ without an identity. So Urbit has to solve _that_ -problem. Unless it's just going to be a Web server. (Urbit is -actually a perfectly decent Web server.) Unless it has an actual -identity model, your general-purpose server - presumably a -_network_ server - has no network effect. No identity, no -network. No network, who the hell cares? - -And unlike your ordinary, common or garden Web application -server, Urbit does need that network effect. You see, it's not -even our own work. It's something we found. On an unmarked USB -stick by the side of the road three kilometers from Area 51. - -We think it's probably still human engineering. First of all, -there are no aliens. Second, Urbit uses Unicode. Do the aliens -have Unicode? Or SHA-256? _Where did Unicode come from, -anyway?_ And at the I/O level, we see UDP, HTTP, etc. The -command line does Emacs keys. At the very least, someone on -Earth (or at least _from_ Earth) has done some porting. - -But other than these cosmetic details, there's not much sign of a -connection to ordinary Earth computing. For instance, Urbit -isn't written in any of our Earth languages. It is written in -something called Hoon, which is a strict, higher-order, typed -functional language - but has nothing in else in common with -other Earth languages, functional or not. Hoon does not even -use standard PL theory. And its syntax is just as alien, although -at least it confines itself to the ASCII plane. (And you -probably thought the "A" in "ASCII" stood for "American.") - -Worse yet, Hoon is not written in anything normal. It's written -in Hoon. To be precise - the Hoon compiler compiles itself to a -much simpler automaton, Nock. Besides machine language itself, -and its various bytecode homages, there are three simple formal -models of computing - Turing machines, lambda calculus, and Chuck -Moore. There is also a fourth which no one has ever found useful -for anything: combinators. Nock is a combinator automaton. - -While nowhere near the simplest such automaton known, and -certainly not of any _theoretical_ interest, Nock is so stupid -that if you gzip the spec, it's only 374 bytes. Nock's only -arithmetic operation is increment. So decrement is an `O(n)`, -operation; add is `O(m*n)`... - -Clearly not a practical system. Even if this... _thing_... that -sits on top of it was in any way, shape or form remotely sane. - -So why not try it? Heck, why not at least check it out? Strange -and foolish dreamers may hie themselves to teh github: - -[https://github.com/urbit](https://github.com/urbit) - -Various people have built and run Urbit on Ubuntu, Homebrew and -MacPorts. It's possible that all these people were stone cold -ninjas. Urbit is a pretty cool toy, I think, if you're a ninja. -Unfortunately it is not really ready for ordinary rice farmers. -If you can't resolve build dependencies by hand, we're sorry. -Urbit is probably not yet ready for you. - -Where should you run Urbit? Ideally, in the cloud. Urbit can -punch a decent NAT hole. It doesn't like to, though - what does? -Bear in mind that your Urbit instance is a single-level store - -your state is saved as a log and a checkpoint (as in Redis - -except that Redis is both fast and reliable). This will work -much better on server hardware. That said, there are plenty of -good reasons to keep your servers in the closet with the plants. - -Next, you need a ticket. Or not. You at least need to decide -whether you want a ticket or not. Actually, the answer is -simple. You do want one. But you don't need one - not yet. - -Because Urbit, the OS, never depends on Earth semantics, it needs -its own network protocol - Ames. Ames is a P2P protocol with its -own public-key infrastructure. (Ames is encrypted, but the -current cryptosuite, suite A, is worthless snakeoil. Don't trust -it with your Trader Joe receipts.) Ames runs over UDP, and pays -as little attention to IP routing as possible. Needless to say, -Urbit does not use the DNS at all. - -To sling packets on Ames, you need an identity. Needless to say, -there are a lot of ways to do distributed cryptographic identity, -all of them bad. - -The general reason all PKIs suck is called "Zooko's Triangle." -Your identities can be distributed, secure, or human-meaningful - -pick any two. There is no way to solve Zooko's Triangle. The -only way to attack it is to compromise on at least one vertex. - -To see how Urbit works, let's start with a standard solution. An -Urbit identity is called a "ship." You can launch your own ship -by generating a 2048-bit RSA key and hashing it to a 128-bit -fingerprint, which is your identity. This trivial design is the -basis of all distributed, secure PKIs. - -Unfortunately, an identity should be above all a _name_. A -128-bit fingerprint looks like this: - - 316.931.986.049.624.498.975.974.005.376.666.572.699 - -which isn't a name. For no better reason than the fact that, -unless you're an autistic savant, you are basically a monkey with -an overgrown monkey brain. A name is something that fits in a -register. Your monkey brain doesn't have 128-bit registers. - -Suppose we could use 64-bit fingerprints? At first this seems -even less promising. First of all, your monkey brain doesn't -have 64-bit registers, either. Second, at 64 bits, collisions -are already a real problem. - -But we can solve both these problems. Your monkey brain doesn't -have 64-bit registers. But anything that lets us do 64-bit -identities might stretch down to 32 bits. And at 64 or 32 bits, -we can't assign identities by random hash. So we'll have to find -another way of distributing them. - -A 32-bit identity - or even a 16-bit identity - will still never -be human-meaningful. Perhaps we can make it human-memorable. -Meaningful addresses are a nice feature in a social network, but -memorable addresses are essential. And if we have memorable -addresses, perhaps we can build meaningful names on top. - -The classic example of a memorable address is a street address. -Your street address identifies you precisely, using a name. You -have this great brain hardware for remembering names. But what -does the name of your street _mean_? Nothing at all, usually. -And even if it does mean something, by accident or design, that -meaning has nothing at all to do with you. (One of us grew up in -Columbia, Maryland, which has street names like "Greek Boy -Place.") - -So all we need is a simple, tasteful, memorable way to remember -32 bits - and we're on our way to approximating the Triangle. - -Decimal notation is the worst way of remembering a 32-bit number. -IP notation is a little better. Urbit has a typically crude -approach: we map every byte to a CVC phoneme, making names like: - - ~tasfyn-partyv - ~sivbud-barnel - ~tomsyt-balsen - -These strings, while quite meaningless, are no less memorable -than real human names in many a language. Moreover, they form a -language of their own, and become more memorable as you use them. -And there are 4 billion of them, which (as we'll see) is almost -exactly the right number. - -But how do we distribute them? One obvious solution is a proof -of work scheme, as in Bitcoin. Coordinating a global -proof-of-work scheme is quite nontrivial, however. Also, there -is a second reason to compromise 100% decentralization: packet -routing. It might be possible to use a blockchain as a global -routing table. It would take some thinking about. - -Furthermore, there's a clue here that the Bitcoin approach just -isn't getting. The limited subspace of short names, within the -general space of 128-bit names, is essentially _real estate_. -There is absolutely no reason, moral or practical, to give this -real estate away for free to people whose only contribution is -generating CO2 on their GPUs. Mining is not in any way a -productive activity. - -Rather, initially, this real estate belongs to Urbit itself. If -Urbit has value, its real estate has value. If Urbit has no -value, its so-called real estate is a bunch of worthless bits. -Therefore, any value in the real estate can, should, and will be -used to bootstrap the system from an economic perspective. Ie, -it belongs to and will be captured by Urbit's developers and/or -early adopters. If you find this morally wrong, sorry. You're -probably some kind of a communist. - -But because Urbit is a free republican society - not (ahem) a -fascist corporate dictatorship like Google, Facebook or Twitter - -a crucial aspect of launching or transferring a ship is that the -decision is irreversible. - -As the master of an Urbit ship, your informal title is -cryptographic and _allodial_ - no one, not the government and -certainly not us, can challenge it. Unless the attacker can -steal your secrets. In which case, of course, she might as well -be you. That's like Bitcoin too. - -If Bitcoin is money, Urbit is land. (Floating land is still -land, if there's a limited amount of it.) You own both in the -same way, by proving you can keep a secret. A Bitcoin is not -useful for anything, except selling to a greater fool. (We're -just kidding - we're huge Bitcoin fans.) But an Urbit ship is -directly useful, so long as Urbit itself is useful. - -You fill your Bitcoin wallet either by creating new coins, or -buying old ones from Satoshi and his cronies. You build your -Urbit fleet by buying ships from us and our cronies. (Don't ask -what we had to do to get them from the aliens. Those aliens are -into a lot of strange shit, man.) Ships are transferable, but -Urbit is not designed to be a digital currency. Transaction -overhead is artificially high. Again, as in real estate. - -Urbit at present is empty and worthless. So 32-bit ships - -destroyers - are $0. Launch a 128-bit ship (a submarine) and -ask me, ~tasfyn-partyv, for one. We'll send you one, two, or a -dozen. You can be as anonymous as you want, if you're polite. -But, if the network lives, a destroyer price will develop. It -will be very low at first, but not zero. Urbit is designed to be -free as in speech. It's not designed to be free as in beer. - -How, cryptographically, are cloud ships distributed? And how are -packets routed? The answer is the same - the prefix hierarchy. - -In Urbit's naval terminology, ships above 64 bits are -"submarines." 64-bit ships are "yachts." 32-bit, "destroyers." -16-bit, "cruisers." 8-bit, "carriers." This also resembles a -feudal hierarchy, so it comes with a feudal terminology. There -are 256 imperial carriers, 65.280 royal cruisers, 4.294.901.760 -rebel destroyers, uncounted scads of private yachts, and more or -less infinitely many rogue submarines. - -Every ship but a submarine has a "will," or certificate chain - a -linked list of "deeds." The first deed in this list is signed by -the ship's hierarchical prefix, or "flagship." Mere submarine are -independent; carriers create cruisers; cruisers create -destroyers; destroyers create yachts. - -A submarine is the fingerprint of its own public key; a carrier's -fingerprint is predefined in the kernel. Anyone can create any -number of 128-bit submarines, whose free and independent -society the 64-bit naval hierarchy cannot interfere with. And -of course, since Urbit is (a) in the public domain and (b) not -patented, anyone can fork Urbit and change the carrier -fingerprints. Anyone can also create his own independent and -incompatible DNS, but efforts in this direction have not been -crowned with great success. In general, the easier it is -technically to fork open-source code or an open standard, the -less likely a fork is to actually happen. - -An independent ship is an independent reputation. Your flagship -hierarchy, though it created your ship, has no control over it - -so your reputations are and should be separate. But there are -not 2^64 independent reputations in Urbit, only 2^32. Cruisers -have no control over the destroyers they create, but yachts have -no independence from the destroyers that created them. - -The reason for this is simple - a destroyer corresponds not to a -person, but to any institution with its own independent -reputation. Yachts are for users, bots, or other sub-identities -of this institution. Each destroyer has 2^32 of them, which is, -of course, a lot. - -How does independence work in practice? By pinning/TOFU. For -any deed number, or "life," the first instance is accepted. Thus -when changing secrets, perhaps to transfer a ship, the donor -signs a new deed created by the recipient. Once any ship sees -this deed, it will never accept another signed by the old owner. -Thus, a cruiser cannot sell the same new destroyer twice. -Similarly, deed 7 of ~tasfyn-partyv signs deed 8; but no ship -which has a deed 8 for ~tasfyn-partyv will either accept deed 7, -or any other purported deed 8 which deed 7 later signs. - -Preventing a "double spend" thus depends on propagating the -latest deed. For this purpose, the ocean is divided into two -kinds of ships: friends and non-friends of the ship being -transferred. The ship has a list of its cryptographic partners, -or "neighbors," for which it holds a symmetric key and a routing -(IP) address. - -The new owner sends the new deed to all the neighbors, thus -locking the old owner out of them. Future new friends will get -the new owner's will the same way they get the new owner's IP -address - by a lookup through the flagship hierarchy. Thus if we -update both neighbors and flagship, the old owner is locked out -and the new owner is locked in. - -Technically, this is very much an imperfect procedure. It relies -on social trust to make it effective. For example, a malicious -seller could edit his neighbor list before delivering the ship. -You probably don't want to buy a used destroyer from someone you -distrust. Of course, the same is true of cars. - -And more broadly, the naval hierarchy can and should provide -general administrative support. For one thing, the big ships -route your packets, at least when establishing contact with your -fellow destroyers. - -So - do you want an Urbit destroyer? You know you do. Moreover, -they're free. Of course, if you are satisfied with a name that -looks like - - ~machec-binnev-dordeb-sogduc--dosmul-sarrum-faplec-nidted - -you can keep swimming around Urbit in your submarine. - -For a while, anyway. Because, besides memorability, there is -another reason for short names. - -What's neat about short names is that there's a finite number of -them. This is not a bug, but a feature. Essentially, to borrow -the thinking of political scientist James Scott, a finite space -is _governable_. An infinite space is ungovernable. - -If there are an infinite number of identities, there is no way -for anyone to distinguish between a new user and a banned user. -A reputation can be punished by destroying it, but anyone can -start again at zero. A parasite whose only reason to use the -network is to abuse it can keep coming back for more. An email -spammer will never run out of addresses to spam from. - -IPv4 is a limited space, which almost but doesn't cure spam. The -problem is that IPv4 addresses are neither personal nor property, -so there is generally no easy way to punish a spammer as he -deserves through IP blacklisting. He is very unlikely to be in -any sense the owner of the IP address on his packets. - -But if the email address and the IP address were the same thing, -and the present fuzzy economic relationship between the user of -an IP address were clear and simple, killing spam would become -easy. You spam from a destroyer; you go on a list of spammers; -no one will accept your unsolicited messages, ever. - -You can get around this. You can buy a new destroyer. But the -thing is - it costs you *money*. You're not spamming for the -fun of it. If a destroyer costs a mere $1, the spam you send -from it needs to earn you $1. - -This does not make it trivial for the forces of light to hunt you -down and render you into processed meat clippings. But it sure -as heck evens the game. Who will win? I guess we'll see. - -So do you want an Urbit destroyer? Read the [documentation](/2013/11/18/urbit-is-easy-ch1.html) for instructions. Come on, they're free... diff --git a/main/pub/src/doc/say/arvo/1.md b/main/pub/src/doc/say/arvo/1.md index ab8e7a7a43..4cb9ee19e3 100644 --- a/main/pub/src/doc/say/arvo/1.md +++ b/main/pub/src/doc/say/arvo/1.md @@ -1,10 +1,4 @@ ---- -layout: tutpage -axis: doc-arvo -categories: tut -sort: 1 -title: I - Basic Arvo ---- +#Basic Arvo These sections assume you've gotten Arvo up and running; if not, [do so](/setup) first. diff --git a/main/pub/src/doc/say/arvo/2.md b/main/pub/src/doc/say/arvo/2.md index 409949e4cf..886601b8fb 100644 --- a/main/pub/src/doc/say/arvo/2.md +++ b/main/pub/src/doc/say/arvo/2.md @@ -1,11 +1,6 @@ ---- -layout: tutpage -axis: doc-arvo -categories: tut -sort: 1 -title: II - More Basic Arvo ---- -#Local revision control +#More Basic Arvo + +##Local revision control Now you're ready to see the full power of this fully armed and operational revision-controlled filesystem. @@ -146,7 +141,7 @@ But one could argue that it's just a party trick. But once your revision control system and your scheduler are jammed into one phone booth... why not jam networking in there too? -#Network revision control# +##Network revision control# Arvo is the OS. Urbit is the network. In theory you could write an Urbit client that wasn't Arvo, though it's hard to see why. diff --git a/main/pub/src/doc/say/hoon/1.md b/main/pub/src/doc/say/hoon/1.md index c77ff50d06..67c2bb3d0e 100644 --- a/main/pub/src/doc/say/hoon/1.md +++ b/main/pub/src/doc/say/hoon/1.md @@ -1,10 +1,4 @@ ---- -layout: tutpage -axis: doc-hoon -categories: tut -sort: 1 -title: I - Intro To Hoon ---- +#Intro to Hoon > Like all men in Babylon, I have been proconsul; like all, a slave. > - The Lottery in Babylon diff --git a/main/pub/src/doc/say/hoon/2.md b/main/pub/src/doc/say/hoon/2.md index e16de0d134..10b607a0c2 100644 --- a/main/pub/src/doc/say/hoon/2.md +++ b/main/pub/src/doc/say/hoon/2.md @@ -1,10 +1,4 @@ ---- -layout: tutpage -axis: doc-hoon -categories: tut -sort: 2 -title: II - Moar Hoon Types ---- +#Types > What good is a phone call if you're unable to speak? > - The Matrix diff --git a/main/pub/src/doc/say/hoon/3.md b/main/pub/src/doc/say/hoon/3.md index 1e0237b0fb..b92aa0451f 100644 --- a/main/pub/src/doc/say/hoon/3.md +++ b/main/pub/src/doc/say/hoon/3.md @@ -1,10 +1,4 @@ ---- -layout: tutpage -axis: doc-hoon -categories: tut -sort: 3 -title: III - Hoon Computes ---- +#Hoon Computes > I've only been in love with a beer bottle and a mirror. > - Sid Vicious diff --git a/main/pub/src/doc/say/hoon/4.md b/main/pub/src/doc/say/hoon/4.md index 8838ad6cce..7fa4958d3b 100644 --- a/main/pub/src/doc/say/hoon/4.md +++ b/main/pub/src/doc/say/hoon/4.md @@ -1,10 +1,4 @@ ---- -layout: tutpage -axis: doc-hoon -categories: tut -sort: 4 -title: IV - Gates ---- +#Gates > Anyone who thinks he's original is merely ignorant. > - Nicolás Gómez Dávila diff --git a/main/pub/src/doc/say/hoon/5.md b/main/pub/src/doc/say/hoon/5.md index 8e093a6119..a52f4c54b2 100644 --- a/main/pub/src/doc/say/hoon/5.md +++ b/main/pub/src/doc/say/hoon/5.md @@ -1,10 +1,4 @@ ---- -layout: tutpage -axis: doc-hoon -categories: tut -sort: 5 -title: V - Tiles ---- +#Tiles > Not to get knowledge, but to save yourself from having > ignorance foisted upon you. diff --git a/main/pub/src/doc/say/hoon/6.md b/main/pub/src/doc/say/hoon/6.md index 182b7ba6da..866f547dff 100644 --- a/main/pub/src/doc/say/hoon/6.md +++ b/main/pub/src/doc/say/hoon/6.md @@ -1,10 +1,4 @@ ---- -layout: tutpage -axis: doc-hoon -categories: tut -sort: 6 -title: VI - Type Inference ---- +#Type Inference > Ever, as before, does Madness remain a mysterious-terrific, > altogether infernal boiling-up of the Nether Chaotic Deep, @@ -961,4 +955,4 @@ perfectly capable of inferring that when you weld `(list a)` and change might confuse. In short: generic polymorphism is cool but wacky. Leave it to -the experts, please! \ No newline at end of file +the experts, please! diff --git a/main/pub/src/doc/say/hoon/7.md b/main/pub/src/doc/say/hoon/7.md index 54b383de53..fe5bef9662 100644 --- a/main/pub/src/doc/say/hoon/7.md +++ b/main/pub/src/doc/say/hoon/7.md @@ -1,10 +1,5 @@ ---- -layout: tutpage -axis: doc-hoon -categories: tut -sort: 7 -title: VII - Odds, Ends, Quirks ---- +#Odds, Ends, Quirks + ##A bestiary of cores## @@ -1214,4 +1209,4 @@ In freehand mode (F-Hoon), do whatever the heck you want. Note that while uppercase is not permitted in a symbol, `-` is, suggesting a generally Lisp-like state of gross hyphenated disorder. F-mode is best used for top-layer software which -nothing else is based on; prototyping and casual coding; etc. \ No newline at end of file +nothing else is based on; prototyping and casual coding; etc. diff --git a/main/pub/src/doc/say/nock/1.md b/main/pub/src/doc/say/nock/1.md index 59db351b78..18f452f3b0 100644 --- a/main/pub/src/doc/say/nock/1.md +++ b/main/pub/src/doc/say/nock/1.md @@ -1,10 +1,4 @@ ---- -layout: tutpage -axis: doc-nock -categories: tut -sort: 1 -title: I - Intro To Nock ---- +#Intro to Nock > What one fool can do, another can. > - Ancient Simian proverb diff --git a/main/pub/src/doc/say/nock/2.md b/main/pub/src/doc/say/nock/2.md index 60946b6d5c..48d6a4e39b 100644 --- a/main/pub/src/doc/say/nock/2.md +++ b/main/pub/src/doc/say/nock/2.md @@ -1,10 +1,4 @@ ---- -layout: tutpage -axis: doc-nock -categories: tut -sort: 2 -title: II - Nock Is Easy ---- +#Nock is Easy > You get used to it. I don't even see the code. All I see is blonde, brunette, redhead. > - The Matrix diff --git a/main/pub/src/doc/say/nock/3.md b/main/pub/src/doc/say/nock/3.md index 573cc04b91..7df460e13e 100644 --- a/main/pub/src/doc/say/nock/3.md +++ b/main/pub/src/doc/say/nock/3.md @@ -1,10 +1,5 @@ ---- -layout: tutpage -axis: doc-nock -categories: tut -sort: 3 -title: III - Using Nock ---- +#Using Nock + > But are you crazy enough? > - Point Break diff --git a/main/pub/src/site/res/footer.html b/main/pub/src/site/res/footer.html deleted file mode 100644 index 394f1087e9..0000000000 --- a/main/pub/src/site/res/footer.html +++ /dev/null @@ -1,15 +0,0 @@ - diff --git a/main/pub/src/site/res/head.html b/main/pub/src/site/res/head.html deleted file mode 100644 index 8b1756ac2e..0000000000 --- a/main/pub/src/site/res/head.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - {% if page.title == "Home" %} - {{ site.title }} · {{ site.tagline }} - {% else %} - {{ page.title }} · {{ site.title }} - {% endif %} - - - - - - - - - - - - - - - - - - - diff --git a/main/pub/src/site/res/logo.png b/main/pub/src/site/res/logo.png deleted file mode 100644 index 130275c9984087445d8d82ff2f99412ba3d4ebff..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1040 zcmeAS@N?(olHy`uVBq!ia0vp^6(G#P1|%(0%q{^b$r9IylHmNblJdl&R0hYC{G?O` z&)mfH)S%SFl*+=BsWuD@%$q!2978H@y_wtS``AFFjdvI0jfPE*Ga3vWcQd|a+ra2E zp{%K_84Q_sG2T^}-d@77(78-%d0pL4J544>J(<6sa{eDHT>om}orosX7=a zNC@z7u(2>VF&>0c;;Gwj@4Wo7C1LfMG~@5zzO^NEpLt$fZX>tfj<0pK;-8%Xv!3qW zy?gz$ojTsz@8+#c(DvB;XYc!|`y%+XZZKSu@&5WR#YAf7_wVIe7Ugkqado2le+@($vbXV&LJ-S6JNk3Mf1-Rt{I>&NpYZnLEiKeE}nlIz=1C3&&r%Uid;dTV82 zEIxZlQ#SLO>#w8g=1Lr|+rNHo!m`e35l?;_KPa*Kdum^Er>~gSkFQ^^Mo;zKA5~vd zbH!Kw_s^a0|2!?qT-3B#T<4Ng%Sqo0&)PDQE!uP?~jcLinUPm!IA@XEtV8zCiLRTj=^Z-=&4xcf~Ouv=zM6 z?x!aFzI2Jx?k!9l?;0ok3+|in&$vWnUUtqYzYmrhHQf5nnVO}l?>M`}?TwoK@f%a7 zKDZDO5*qqCyZv11bFtZ*gk+2qCV9OvE^FnvBQQrp?B@oF*_#CKlm;oMX$Ok1Hf=q& zXyMUiIxOuy1<8Jz-%NwtH!Kpr?UfUxyQAN;_eQhT+l`)EAM8uMD3CNc>fpkOOV1zl zdvT=e*^MP(AC@Lf?4Ka2JS%y!*TLyCu5{S)S)^B$Y-rM#?XKzA6O%mI>Y$>2TGz$w z6Ta$acbbLh*6`P^3!lgGXM4xrN#|`_-<(lCZ+7y3f9v~nzpM=VExPXml`TvrJt@fO z^39s3x8+O7{5PGR!nJNXr(RwVnjONkDdjY4w)NeN${9A5!nvi=%AQPG+gdzsy0qJ| zO#3|XSK_B7qB^%_Bk%9F{QBUd|0#Jpx&FI{4>vdelQ`1$z`3nF))6(i8oSI~HRWg6 z>HM6DO^Y;QLPM=sy6-I96Ds3t0#DY0pw#WG6j9>N3QFS*3E(8(1Exd-axc!!FSp8Q z&$*|ht!*uw+}}50ZN25CH#6LYedS^K0;H$uAWz^jt@-oj#Y9fqGfQyi-o3p=veV99 oa=|oIq4?q(rK}nInRplyfB!68;-I+{n8g`9UHx3vIVCg!00u_X>i_@% diff --git a/main/pub/src/site/res/sidebar.html b/main/pub/src/site/res/sidebar.html deleted file mode 100644 index c303a645e6..0000000000 --- a/main/pub/src/site/res/sidebar.html +++ /dev/null @@ -1,21 +0,0 @@ - diff --git a/main/pub/src/site/res/styles.css b/main/pub/src/site/res/styles.css deleted file mode 100644 index 3743b51161..0000000000 --- a/main/pub/src/site/res/styles.css +++ /dev/null @@ -1,596 +0,0 @@ - - -* { - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; -} - -html, -body { - margin: 0; - padding: 0; -} - -html { - font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; - font-size: 14px; - line-height: 1.5; -} -@media (min-width: 38rem) { - html { - font-size: 16px; - } -} - -body { - color: #515151; - background-color: #fff; - -webkit-text-size-adjust: 100%; - -ms-text-size-adjust: 100%; -} - -/* No `:visited` state is required by default (browsers will use `a`) */ -a { - line-height: 1.1rem; - color: #555; - text-decoration: none; -} -li a, p a { - display: inline-block; - border-bottom: 2px solid #ccc; -} -/* `:focus` is linked to `:hover` for basic accessibility */ -a:hover, -a:focus { - text-decoration: underline; -} - -li a:hover, p a:hover, -li a:hover, p a:focus { - border-bottom: 2px solid #555; -} - -/* Headings */ -h1, h2, h3, h4, h5, h6 { - margin-bottom: .5rem; - font-weight: bold; - line-height: 1.25; - color: #313131; - text-rendering: optimizeLegibility; -} -h1 { - font-size: 1.2rem; -} -h2 { - margin-top: 1rem; - font-size: 1rem; -} -h3 { - margin-top: 1.5rem; - font-size: .9rem; -} -h4, h5, h6 { - margin-top: .9rem; - font-size: .9rem; - font-weight: 500; - letter-spacing: .03rem; -} - -/* Body text */ -p { - max-width: 42rem; - margin-top: 0; - margin-bottom: 1rem; -} - -strong { - color: #303030; -} - - -/* Lists */ -ul, ol, dl { - margin-top: 0; - margin-bottom: 1rem; -} - -dt { - font-weight: bold; -} -dd { - margin-bottom: .5rem; -} - -/* Misc */ -hr { - position: relative; - margin: 1.5rem 0; - border: 0; - border-top: 1px solid #eee; - border-bottom: 1px solid #fff; -} - -abbr { - font-size: 85%; - font-weight: bold; - color: #555; - text-transform: uppercase; -} -abbr[title] { - cursor: help; - border-bottom: 1px dotted #e5e5e5; -} - -/* Code */ -code, -pre, .codeblock { - font-family: Menlo, Monaco, "Courier New", monospace; -} -code { - padding: .25em .5em; - font-size: 90%; - background-color: #f9f9f9; - border-radius: none; -} -pre, .codeblock { - display: block; - margin-top: 0; - margin-bottom: 1rem; - padding: 1rem; - font-size: .9rem; - line-height: 1.4; - white-space: pre; - white-space: pre-wrap; - word-break: break-all; - word-wrap: break-word; - width: 42rem; - background-color: #f9f9f9; -} -pre code, .codeblock code { - padding: 0; - font-size: 90%; - color: inherit; - background-color: transparent; -} -.highlight { - margin-bottom: 1rem; - border-radius: none; -} -.highlight pre { - margin-bottom: 0; -} - -/* Quotes */ -blockquote { - padding: .5rem 1rem; - padding-left: 0; - max-width: 32rem; - margin: .8rem 0; - color: #7a7a7a; -} -blockquote p:last-child { - margin-bottom: 0; -} -@media (min-width: 30rem) { - blockquote { - padding-right: 5rem; - padding-left: 0; - } -} - -img { - display: block; - margin: 0 0 1rem; - border-radius: none; - min-width:100%; - max-width:100%; - height:auto; -} - -/* Tables */ -table { - margin-bottom: 1rem; - width: 100%; - border: 1px solid #e5e5e5; - border-collapse: collapse; -} -td, -th { - padding: .25rem .5rem; - border: 1px solid #e5e5e5; -} -tbody tr:nth-child(odd) td, -tbody tr:nth-child(odd) th { - background-color: #f9f9f9; -} - - -/* - * Custom type - * - * Extend paragraphs with `.lead` for larger introductory text. - */ - -.lead { - font-size: 1.25rem; - font-weight: 300; -} - - -/* - * Messages - * - * Show alert messages to users. You may add it to single elements like a `

`, - * or to a parent if there are multiple elements to show. - */ - -.message { - margin-bottom: 1rem; - padding: 1rem; - color: #717171; - background-color: #f9f9f9; -} - - -/* - * Container - * - * Center the page content. - */ - -.container { - max-width: 42rem; - padding-left: 1rem; - padding-right: 1rem; - margin-left: auto; - margin-right: auto; -} - - -/* - * Masthead - * - * Super small header above the content for site name and short description. - */ - -.masthead { - padding-top: 1rem; - padding-bottom: 1rem; - margin-bottom: 3rem; -} -.masthead-title { - margin-top: 0; - margin-bottom: 0; - color: #505050; -} -.masthead-title a { - color: #505050; -} -.masthead-title small { - font-size: 75%; - font-weight: 400; - color: #c0c0c0; - letter-spacing: 0; -} - - -/* - * Posts and pages - * - * Each post is wrapped in `.post` and is used on default and post layouts. Each - * page is wrapped in `.page` and is only used on the page layout. - */ - -.page, -.subpage, -.post { - margin-top: 2rem; - margin-bottom: 4em; -} - -/* Blog post or page title */ -.page-title, -.post-title, -.post-title a { - color: #303030; -} - -/* Meta data line below post title */ -.post-date { - display: block; - margin-top: -.5rem; - margin-bottom: 1rem; - color: #9a9a9a; -} - -/* Related posts */ -.related { - padding-top: 2rem; - padding-bottom: 2rem; - border-top: 1px solid #eee; -} -.related-posts { - padding-left: 0; - list-style: none; -} -.related-posts h3 { - margin-top: 0; -} -.related-posts li small { - font-size: 75%; - color: #999; -} -.related-posts li a:hover { - color: #268bd2; - text-decoration: none; -} -.related-posts li a:hover small { - color: inherit; -} - - -/* - * Pagination - * - * Super lightweight (HTML-wise) blog pagination. `span`s are provide for when - * there are no more previous or next posts to show. - */ - -.pagination { - overflow: hidden; /* clearfix */ - margin-left: -1rem; - margin-right: -1rem; - font-family: "PT Sans", Helvetica, Arial, sans-serif; - color: #ccc; - text-align: center; -} - -/* Pagination items can be `span`s or `a`s */ -.pagination-item { - display: block; - padding: 1rem; - border: 1px solid #eee; -} -.pagination-item:first-child { - margin-bottom: -1px; -} - -/* Only provide a hover state for linked pagination items */ -a.pagination-item:hover { - background-color: #f5f5f5; -} - -@media (min-width: 30rem) { - .pagination { - margin: 3rem 0; - } - .pagination-item { - float: left; - width: 50%; - } - .pagination-item:first-child { - margin-bottom: 0; - border-top-left-radius: 4px; - border-bottom-left-radius: 4px; - } - .pagination-item:last-child { - margin-left: -1px; - border-top-right-radius: 4px; - border-bottom-right-radius: 4px; - } -} - -.hll { background-color: #ffffcc } - - -.css .o, -.css .o + .nt, -.css .nt + .nt { color: #999; } - -.toggle { - display: none; -} -.subnav li.active .toggle, .toggle.active { - display: block; -} - -.setup .subnav li.active > a { - border-color: #000; - font-weight: bold; - color: #000; -} - -.sidebar-about { - height: 3rem; -} - -.sidebar-about h1 { - font-size: 1rem; - font-weight: 500; - display: inline-block -} - -.sidebar-about > a:focus, -.sidebar-about > a:hover { - border: none; - text-decoration: none; -} - -.sidebar-about h1.title { - border-bottom: 3px solid transparent; -} - -.sidebar-about h1.logo { - margin-top: .6rem; - margin-right: .6rem; - margin-left: -2rem; - margin-bottom: 0; - height: 1rem; - float: left; -} - -@media only screen and (max-width: 500px) { - .sidebar-about h1.logo { - margin-left: 0; - } -} - -img.logo { - width: 1.2rem; - height: 1.2rem; -} - -.sidebar-about p.lead { - font-size: .8rem; - font-weight: normal; -} - -.sidebar-nav { - margin: 0; - padding: 0; -} - -.sidebar-nav li > a { - border: none; - border-bottom: 3px solid #fff; -} - -.sidebar-about h1.title:focus, -.sidebar-about h1.title:hover, -.sidebar-nav li > a.active, -.sidebar-nav li > a:focus, -.sidebar-nav li > a:hover { - text-decoration: none; - border-bottom: 3px solid #555; -} - -.sidebar-about > a > img { - width: 30px; -} - -.sidebar-nav-item { - display: inline-block; - min-width: 13rem; - font-size: 1rem; -} - -.footer { - margin-bottom: 4rem; -} - -.footer .sidebar-nav-item { - margin-top: 4rem; -} - -ul,ol { - padding-left: 2rem; -} - -ol { - list-style-type: upper-roman; -} - -ul { - list-style-type: circle; -} - -ul.chat { - list-style-type: none; -} - -ul.chat li { - margin-bottom: 2rem; -} - -.doc-hoon h1, .doc-hoon h2 { - margin-top: 3rem; -} - -.documentation > ul { - list-style-type: none; - padding-left: 0; - float: left; -} - -.documentation ul > li { - float: left; - width: 13rem; -} - -code, .subnav > ul > li > ul { - font-family: "Menlo", "Courier New", courier, monospace; - color: inherit; -} - -.subnav > ul > li > ul { - font-size: .9rem; - overflow: hidden; - height: 0; - margin-right: 2rem; -} - -.subnav > ul > li.active > ul { - overflow: visible; - height: auto; -} - -.subnav > ul > li .section { - display: inline-block; -} - -.setup .subnav li > a.expand, .subnav > ul > li .expand { - font-size: .6rem; - border: 0; -} - -.setup .subnav li > a.expand:before, .subnav > ul > li .expand:before { - content: "\25B6"; - font-size: .6rem; -} - -.setup .subnav li > a.expand:before { - margin-right: .6rem; -} - -.setup .subnav li.active > a.expand:before, .subnav > ul > li.active .expand:before { - content: "\25BC"; - font-size: .6rem; -} - -.subnav, .subnav ul { - list-style-type: none; - padding: 0; - margin: 0 0 .6rem 0; -} - -.subnav ul > li > ul > li { - margin-bottom: .3rem; -} - -.subnav a.active { - font-size: 1rem; - font-weight: 700; - color: #333; - border-bottom: 2px solid #555; -} - -.page.setup .subnav .toggle { - margin: 1rem 0 2rem 1.6rem; -} - -@media only screen and (min-width: 54rem) { - .doc-hoon .subnav.arms a{ - font-size: .8rem; - } - .doc-hoon .subnav.runes, .doc-hoon .subnav.arms { - position: fixed; - top: 8rem; - left: 50%; - margin-left: -30rem; - overflow-y: scroll; - } - .subnav > ul > li > ul { - margin-right: 0; - } -} From 438732a67076ab1c7ee76d80c66c8753e04e3466 Mon Sep 17 00:00:00 2001 From: johncburnham Date: Fri, 8 Aug 2014 20:55:42 -0700 Subject: [PATCH 11/34] more sitework --- main/pub/fab/site/hymn.hook | 10 +- main/pub/fab/site/styles.css | 596 +++++++++++ main/pub/fab/site/tut/arvo3/hymn.hook | 18 + main/pub/fab/site/tut/arvo4/hymn.hook | 18 + main/pub/fab/site/tut/arvo5/hymn.hook | 18 + main/pub/fab/site/tut/setup/hymn.hook | 18 + main/pub/src/doc/ref/vol4.md | 987 ++++++++++++++++++ main/pub/src/doc/say/arvo/app.md | 1379 +++++++++++++++++++++++++ main/pub/src/doc/say/arvo/pub2.md | 522 ++++++++++ main/pub/src/doc/say/arvo/pub3.md | 515 +++++++++ main/pub/src/doc/say/intro.md | 29 + main/pub/src/doc/say/setup.md | 463 +++++++++ 12 files changed, 4565 insertions(+), 8 deletions(-) create mode 100644 main/pub/fab/site/styles.css create mode 100644 main/pub/fab/site/tut/arvo3/hymn.hook create mode 100644 main/pub/fab/site/tut/arvo4/hymn.hook create mode 100644 main/pub/fab/site/tut/arvo5/hymn.hook create mode 100644 main/pub/fab/site/tut/setup/hymn.hook create mode 100644 main/pub/src/doc/ref/vol4.md create mode 100644 main/pub/src/doc/say/arvo/app.md create mode 100644 main/pub/src/doc/say/arvo/pub2.md create mode 100644 main/pub/src/doc/say/arvo/pub3.md create mode 100644 main/pub/src/doc/say/intro.md create mode 100644 main/pub/src/doc/say/setup.md diff --git a/main/pub/fab/site/hymn.hook b/main/pub/fab/site/hymn.hook index 43383a7979..f8b80afb9a 100644 --- a/main/pub/fab/site/hymn.hook +++ b/main/pub/fab/site/hymn.hook @@ -2,6 +2,7 @@ :: :::: :: +/= bod /^ manx /: /===/pub/src/doc/say/intro /psal/ /= sty /^ @t /: /===/pub/fab/site/styles /css/ :: :::: ~tomsyt-balsen @@ -14,18 +15,11 @@ ;body ;div(class "content container") ;div(class "page documentation") + ;+ bod ;h1(class "page-title"): Documentation - ;p ; If you want to build a deep understanding of how Urbit works, - ; start with Nock. If you would prefer to just try stuff - ; out, start with Arvo. - == ;p ; This documentation is a work in progress. Feedback and corrections ; are welcome. Pull requests are encouraged. The repo for this site ; lives ;{a(href "https://github.com/urbit/urbit.github.io") "here"}. - ; We would love your help in making this reference more useful. - == - ;p ; Arvo is still actively being changed and updated. - ; As Arvo development cools, more documentation will emerge. == ;ul ;li diff --git a/main/pub/fab/site/styles.css b/main/pub/fab/site/styles.css new file mode 100644 index 0000000000..3743b51161 --- /dev/null +++ b/main/pub/fab/site/styles.css @@ -0,0 +1,596 @@ + + +* { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +html, +body { + margin: 0; + padding: 0; +} + +html { + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + font-size: 14px; + line-height: 1.5; +} +@media (min-width: 38rem) { + html { + font-size: 16px; + } +} + +body { + color: #515151; + background-color: #fff; + -webkit-text-size-adjust: 100%; + -ms-text-size-adjust: 100%; +} + +/* No `:visited` state is required by default (browsers will use `a`) */ +a { + line-height: 1.1rem; + color: #555; + text-decoration: none; +} +li a, p a { + display: inline-block; + border-bottom: 2px solid #ccc; +} +/* `:focus` is linked to `:hover` for basic accessibility */ +a:hover, +a:focus { + text-decoration: underline; +} + +li a:hover, p a:hover, +li a:hover, p a:focus { + border-bottom: 2px solid #555; +} + +/* Headings */ +h1, h2, h3, h4, h5, h6 { + margin-bottom: .5rem; + font-weight: bold; + line-height: 1.25; + color: #313131; + text-rendering: optimizeLegibility; +} +h1 { + font-size: 1.2rem; +} +h2 { + margin-top: 1rem; + font-size: 1rem; +} +h3 { + margin-top: 1.5rem; + font-size: .9rem; +} +h4, h5, h6 { + margin-top: .9rem; + font-size: .9rem; + font-weight: 500; + letter-spacing: .03rem; +} + +/* Body text */ +p { + max-width: 42rem; + margin-top: 0; + margin-bottom: 1rem; +} + +strong { + color: #303030; +} + + +/* Lists */ +ul, ol, dl { + margin-top: 0; + margin-bottom: 1rem; +} + +dt { + font-weight: bold; +} +dd { + margin-bottom: .5rem; +} + +/* Misc */ +hr { + position: relative; + margin: 1.5rem 0; + border: 0; + border-top: 1px solid #eee; + border-bottom: 1px solid #fff; +} + +abbr { + font-size: 85%; + font-weight: bold; + color: #555; + text-transform: uppercase; +} +abbr[title] { + cursor: help; + border-bottom: 1px dotted #e5e5e5; +} + +/* Code */ +code, +pre, .codeblock { + font-family: Menlo, Monaco, "Courier New", monospace; +} +code { + padding: .25em .5em; + font-size: 90%; + background-color: #f9f9f9; + border-radius: none; +} +pre, .codeblock { + display: block; + margin-top: 0; + margin-bottom: 1rem; + padding: 1rem; + font-size: .9rem; + line-height: 1.4; + white-space: pre; + white-space: pre-wrap; + word-break: break-all; + word-wrap: break-word; + width: 42rem; + background-color: #f9f9f9; +} +pre code, .codeblock code { + padding: 0; + font-size: 90%; + color: inherit; + background-color: transparent; +} +.highlight { + margin-bottom: 1rem; + border-radius: none; +} +.highlight pre { + margin-bottom: 0; +} + +/* Quotes */ +blockquote { + padding: .5rem 1rem; + padding-left: 0; + max-width: 32rem; + margin: .8rem 0; + color: #7a7a7a; +} +blockquote p:last-child { + margin-bottom: 0; +} +@media (min-width: 30rem) { + blockquote { + padding-right: 5rem; + padding-left: 0; + } +} + +img { + display: block; + margin: 0 0 1rem; + border-radius: none; + min-width:100%; + max-width:100%; + height:auto; +} + +/* Tables */ +table { + margin-bottom: 1rem; + width: 100%; + border: 1px solid #e5e5e5; + border-collapse: collapse; +} +td, +th { + padding: .25rem .5rem; + border: 1px solid #e5e5e5; +} +tbody tr:nth-child(odd) td, +tbody tr:nth-child(odd) th { + background-color: #f9f9f9; +} + + +/* + * Custom type + * + * Extend paragraphs with `.lead` for larger introductory text. + */ + +.lead { + font-size: 1.25rem; + font-weight: 300; +} + + +/* + * Messages + * + * Show alert messages to users. You may add it to single elements like a `

`, + * or to a parent if there are multiple elements to show. + */ + +.message { + margin-bottom: 1rem; + padding: 1rem; + color: #717171; + background-color: #f9f9f9; +} + + +/* + * Container + * + * Center the page content. + */ + +.container { + max-width: 42rem; + padding-left: 1rem; + padding-right: 1rem; + margin-left: auto; + margin-right: auto; +} + + +/* + * Masthead + * + * Super small header above the content for site name and short description. + */ + +.masthead { + padding-top: 1rem; + padding-bottom: 1rem; + margin-bottom: 3rem; +} +.masthead-title { + margin-top: 0; + margin-bottom: 0; + color: #505050; +} +.masthead-title a { + color: #505050; +} +.masthead-title small { + font-size: 75%; + font-weight: 400; + color: #c0c0c0; + letter-spacing: 0; +} + + +/* + * Posts and pages + * + * Each post is wrapped in `.post` and is used on default and post layouts. Each + * page is wrapped in `.page` and is only used on the page layout. + */ + +.page, +.subpage, +.post { + margin-top: 2rem; + margin-bottom: 4em; +} + +/* Blog post or page title */ +.page-title, +.post-title, +.post-title a { + color: #303030; +} + +/* Meta data line below post title */ +.post-date { + display: block; + margin-top: -.5rem; + margin-bottom: 1rem; + color: #9a9a9a; +} + +/* Related posts */ +.related { + padding-top: 2rem; + padding-bottom: 2rem; + border-top: 1px solid #eee; +} +.related-posts { + padding-left: 0; + list-style: none; +} +.related-posts h3 { + margin-top: 0; +} +.related-posts li small { + font-size: 75%; + color: #999; +} +.related-posts li a:hover { + color: #268bd2; + text-decoration: none; +} +.related-posts li a:hover small { + color: inherit; +} + + +/* + * Pagination + * + * Super lightweight (HTML-wise) blog pagination. `span`s are provide for when + * there are no more previous or next posts to show. + */ + +.pagination { + overflow: hidden; /* clearfix */ + margin-left: -1rem; + margin-right: -1rem; + font-family: "PT Sans", Helvetica, Arial, sans-serif; + color: #ccc; + text-align: center; +} + +/* Pagination items can be `span`s or `a`s */ +.pagination-item { + display: block; + padding: 1rem; + border: 1px solid #eee; +} +.pagination-item:first-child { + margin-bottom: -1px; +} + +/* Only provide a hover state for linked pagination items */ +a.pagination-item:hover { + background-color: #f5f5f5; +} + +@media (min-width: 30rem) { + .pagination { + margin: 3rem 0; + } + .pagination-item { + float: left; + width: 50%; + } + .pagination-item:first-child { + margin-bottom: 0; + border-top-left-radius: 4px; + border-bottom-left-radius: 4px; + } + .pagination-item:last-child { + margin-left: -1px; + border-top-right-radius: 4px; + border-bottom-right-radius: 4px; + } +} + +.hll { background-color: #ffffcc } + + +.css .o, +.css .o + .nt, +.css .nt + .nt { color: #999; } + +.toggle { + display: none; +} +.subnav li.active .toggle, .toggle.active { + display: block; +} + +.setup .subnav li.active > a { + border-color: #000; + font-weight: bold; + color: #000; +} + +.sidebar-about { + height: 3rem; +} + +.sidebar-about h1 { + font-size: 1rem; + font-weight: 500; + display: inline-block +} + +.sidebar-about > a:focus, +.sidebar-about > a:hover { + border: none; + text-decoration: none; +} + +.sidebar-about h1.title { + border-bottom: 3px solid transparent; +} + +.sidebar-about h1.logo { + margin-top: .6rem; + margin-right: .6rem; + margin-left: -2rem; + margin-bottom: 0; + height: 1rem; + float: left; +} + +@media only screen and (max-width: 500px) { + .sidebar-about h1.logo { + margin-left: 0; + } +} + +img.logo { + width: 1.2rem; + height: 1.2rem; +} + +.sidebar-about p.lead { + font-size: .8rem; + font-weight: normal; +} + +.sidebar-nav { + margin: 0; + padding: 0; +} + +.sidebar-nav li > a { + border: none; + border-bottom: 3px solid #fff; +} + +.sidebar-about h1.title:focus, +.sidebar-about h1.title:hover, +.sidebar-nav li > a.active, +.sidebar-nav li > a:focus, +.sidebar-nav li > a:hover { + text-decoration: none; + border-bottom: 3px solid #555; +} + +.sidebar-about > a > img { + width: 30px; +} + +.sidebar-nav-item { + display: inline-block; + min-width: 13rem; + font-size: 1rem; +} + +.footer { + margin-bottom: 4rem; +} + +.footer .sidebar-nav-item { + margin-top: 4rem; +} + +ul,ol { + padding-left: 2rem; +} + +ol { + list-style-type: upper-roman; +} + +ul { + list-style-type: circle; +} + +ul.chat { + list-style-type: none; +} + +ul.chat li { + margin-bottom: 2rem; +} + +.doc-hoon h1, .doc-hoon h2 { + margin-top: 3rem; +} + +.documentation > ul { + list-style-type: none; + padding-left: 0; + float: left; +} + +.documentation ul > li { + float: left; + width: 13rem; +} + +code, .subnav > ul > li > ul { + font-family: "Menlo", "Courier New", courier, monospace; + color: inherit; +} + +.subnav > ul > li > ul { + font-size: .9rem; + overflow: hidden; + height: 0; + margin-right: 2rem; +} + +.subnav > ul > li.active > ul { + overflow: visible; + height: auto; +} + +.subnav > ul > li .section { + display: inline-block; +} + +.setup .subnav li > a.expand, .subnav > ul > li .expand { + font-size: .6rem; + border: 0; +} + +.setup .subnav li > a.expand:before, .subnav > ul > li .expand:before { + content: "\25B6"; + font-size: .6rem; +} + +.setup .subnav li > a.expand:before { + margin-right: .6rem; +} + +.setup .subnav li.active > a.expand:before, .subnav > ul > li.active .expand:before { + content: "\25BC"; + font-size: .6rem; +} + +.subnav, .subnav ul { + list-style-type: none; + padding: 0; + margin: 0 0 .6rem 0; +} + +.subnav ul > li > ul > li { + margin-bottom: .3rem; +} + +.subnav a.active { + font-size: 1rem; + font-weight: 700; + color: #333; + border-bottom: 2px solid #555; +} + +.page.setup .subnav .toggle { + margin: 1rem 0 2rem 1.6rem; +} + +@media only screen and (min-width: 54rem) { + .doc-hoon .subnav.arms a{ + font-size: .8rem; + } + .doc-hoon .subnav.runes, .doc-hoon .subnav.arms { + position: fixed; + top: 8rem; + left: 50%; + margin-left: -30rem; + overflow-y: scroll; + } + .subnav > ul > li > ul { + margin-right: 0; + } +} diff --git a/main/pub/fab/site/tut/arvo3/hymn.hook b/main/pub/fab/site/tut/arvo3/hymn.hook new file mode 100644 index 0000000000..1c09ece979 --- /dev/null +++ b/main/pub/fab/site/tut/arvo3/hymn.hook @@ -0,0 +1,18 @@ +/= sty /^ @t /: /===/pub/fab/site/styles /css/ +/= bod /^ manx /: /===/pub/src/doc/say/arvo/app /psal/ +:: +:::: ~tomsyt-balsen + :: +;html + ;head + ;title: Urbit: Personal Cloud Computing + ;style:"{(trip sty)}" + == + ;body + ;div(class "content container") + ;div.subpage + ;+ bod + == + == + == +== diff --git a/main/pub/fab/site/tut/arvo4/hymn.hook b/main/pub/fab/site/tut/arvo4/hymn.hook new file mode 100644 index 0000000000..496fded934 --- /dev/null +++ b/main/pub/fab/site/tut/arvo4/hymn.hook @@ -0,0 +1,18 @@ +/= sty /^ @t /: /===/pub/fab/site/styles /css/ +/= bod /^ manx /: /===/pub/src/doc/say/arvo/pub2 /psal/ +:: +:::: ~tomsyt-balsen + :: +;html + ;head + ;title: Urbit: Personal Cloud Computing + ;style:"{(trip sty)}" + == + ;body + ;div(class "content container") + ;div.subpage + ;+ bod + == + == + == +== diff --git a/main/pub/fab/site/tut/arvo5/hymn.hook b/main/pub/fab/site/tut/arvo5/hymn.hook new file mode 100644 index 0000000000..6285c4a28c --- /dev/null +++ b/main/pub/fab/site/tut/arvo5/hymn.hook @@ -0,0 +1,18 @@ +/= sty /^ @t /: /===/pub/fab/site/styles /css/ +/= bod /^ manx /: /===/pub/src/doc/say/arvo/pub3 /psal/ +:: +:::: ~tomsyt-balsen + :: +;html + ;head + ;title: Urbit: Personal Cloud Computing + ;style:"{(trip sty)}" + == + ;body + ;div(class "content container") + ;div.subpage + ;+ bod + == + == + == +== diff --git a/main/pub/fab/site/tut/setup/hymn.hook b/main/pub/fab/site/tut/setup/hymn.hook new file mode 100644 index 0000000000..6fa6622689 --- /dev/null +++ b/main/pub/fab/site/tut/setup/hymn.hook @@ -0,0 +1,18 @@ +/= bod /^ manx /: /===/pub/src/doc/say/setup /psal/ +/= sty /^ @t /: /===/pub/fab/site/styles /css/ +:: +:::: ~tomsyt-balsen + :: +;html + ;head + ;title: Urbit: Personal Cloud Computing + ;style:"{(trip sty)}" + == + ;body + ;div(class "content container") + ;div.subpage + ;+ bod + == + == + == +== diff --git a/main/pub/src/doc/ref/vol4.md b/main/pub/src/doc/ref/vol4.md new file mode 100644 index 0000000000..27511c000e --- /dev/null +++ b/main/pub/src/doc/ref/vol4.md @@ -0,0 +1,987 @@ +Ames +==== + +Ames is our networking protocol. + +data models +----------- + +###`++fort`, formal state + +``` +++ fort :: formal state + $: %0 :: version + gad=duct :: client interface + hop=@da :: network boot date + ton=town :: security + zac=(map ship corn) :: flows by server + == :: +``` + +This is the state of our vane. Anything that must be remembered between +calls to ames must be stored in this state. + +`%0` is the version of the ames state model itself. If the data model `++fort` +changes, then this number needs to be incremented, and an adapter must be +written to upgrade the old state into the new state. Note that this is the +version number of the model itself, not the contents. When the data changes, +there is of course no need to change this. + +`gad` is a `duct` over which we send `%send` cards to unix. This card is +initialized when unix sends a `%barn` card as vere starts up. Vere treats this +duct specially -- don't send anything weird over it. + +`hop` is the network boot date. This is set when the `%kick` card is sent by +vere on start up. + +`ton` is a `++town`, where we store all of our security/encryption state. Note +that this is shared across all ships on a pier. + +`zac` is a map of ships to `++corn`. This stores all the per-ship state. The +keys to this map are the ships on the current pier. + +###`++town`, all security state + +``` +++ town :: all security state + $: lit=@ud :: imperial modulus + any=@ :: entropy + urb=(map ship sufi) :: all keys and routes + fak=? :: + == :: +``` + +This is the security state of our pier. + +`lit` is unused. + +`any` is 256 bits of entropy. This entropy is used and updated in exactly two +places: when we send a `%junk` card, and when we generate a new symmetric key +in `++griz:lax:as:go`. When it is updated, it is updated by a SHA-256 hash of +the current time and the old value of the entropy. + +`urb` is a map of ships to `++sufi`. This is where we store all the per-ship +state for the pier. The keys to this map are the ships on the current pier. + +`fak` is true if we are on a fake network. This disables certain security +checks so that anyone may run a fake `~zod`. This is used only for development. +To use, run vere with the `-F` option (and the `-I ~zod` option for a fake +`~zod`). + +###`++sufi`, domestic host + +``` +++ sufi :: domestic host + $: hoy=(list ship) :: hierarchy + val=wund :: private keys + law=will :: server will + seh=(map hand ,[p=ship q=@da]) :: key cache + hoc=(map ship dore) :: neighborhood + == :: +``` + +This is the security state of a domestic server. + +`hoy` is a list of the ships directly above us in the hierarchy of ships. For +example, for `~hoclur-bicrel`, this would be `~tasruc` and `~tug`. See +`++sein`. + +`val` is a list of our private keys. + +`law` is our certificate, which is a list of the XXX + +`seh` + +`hoc` is a map of ships to `++dore`. The stores all the security informatoin +about foreign ships. The keys to this map are the neighbors (ships we have +been in contact with) of this domestic server. + +###`++wund`, private keys + +``` +++ wund (list ,[p=life q=ring r=acru]) :: mace in action +``` + +This is a list of our own private keys, indexed by life. The key itself is +the `++ring`, and the `++acru` is the encryption engine. We generate the +`++acru` from the private key by calling `++weur`. Thus, we can at any time +regenerate our `++wund` from a `++mace`. The current crypto is at the head of +the list and can be accessed with +`++sen:as:go`. + +###`++ring`, private key + +``` +++ ring ,@ :: private key +``` + +This is a private key. The first byte is reserved to identify the type of +cryptography. Lower-case means public key, upper-case means public key, and +the letter identifies which `++acru` to use. + +###`++pass`, public key + +``` +++ pass ,@ :: public key +``` + +This is a public key. The first byte is reserved to identify the type of +cryptography. Lower-case means public key, upper-case means public key, and +the letter identifies which `++acru` to use. + +###`++mace`, private secrets + +``` +++ mace (list ,[p=life q=ring]) :: private secrets +``` + +This is a list of the our private keys, indexed by life. From this we can +generate a `++wund` for actual use. + +###`++skin`, encoding stem + +``` +++ skin ?(%none %open %fast %full) :: encoding stem +``` + +This defines the type of encryption used for each message. `%none` refers +to messages sent in the clear, `%open` refers to signed messages, `%full` +refers to sealed messages, and `%fast` refers to symmetrically encrypted +messages. See `++acru` for details. + +###`++acru`, asymmetric cryptosuite + +``` +++ acru :: asym cryptosuite + $_ ^? |% :: opaque object + ++ as ^? :: asym ops + |% ++ seal |=([a=pass b=@ c=@] _@) :: encrypt to a + ++ sign |=([a=@ b=@] _@) :: certify as us + ++ sure |=([a=@ b=@] *(unit ,@)) :: authenticate from us + ++ tear |= [a=pass b=@] :: accept from a + *(unit ,[p=@ q=@]) :: + -- :: + ++ de |+([a=@ b=@] *(unit ,@)) :: symmetric de, soft + ++ dy |+([a=@ b=@] _@) :: symmetric de, hard + ++ en |+([a=@ b=@] _@) :: symmetric en + ++ ex ^? :: export + |% ++ fig _@uvH :: fingerprint + ++ pac _@uvG :: default passcode + ++ pub *pass :: public key + ++ sec *ring :: private key + -- + ++ nu ^? :: reconstructors + |% ++ pit |=([a=@ b=@] ^?(..nu)) :: from [width seed] + ++ nol |=(a=@ ^?(..nu)) :: from naked ring + ++ com |=(a=@ ^?(..nu)) :: from naked pass + -- + -- +``` + +This is an opaque interface for a general asymmetric cryptosuite. Any form +of asymmetric cryptography can be dropped in to be used instead of the default. +Right now, there are two cryptosuites, `++crua`, which is your standard RSA, +and `++crub`, which is elliptic curve crypto but is mostly stubbed out at the +moment. + +####`++as:acru`, asymmetric operations + +``` + ++ as ^? :: asym ops + |% ++ seal |=([a=pass b=@ c=@] _@) :: encrypt to a + ++ sign |=([a=@ b=@] _@) :: certify as us + ++ sure |=([a=@ b=@] *(unit ,@)) :: authenticate from us + ++ tear |= [a=pass b=@] :: accept from a + *(unit ,[p=@ q=@]) :: + -- :: +``` + +This is the core that defines the standard asymmetric cryptography +operations. + +`++seal:as:acru` allows us to send a message encrypted with someone's public +key so that only they may read it. If Alice seals a message with Bob's public +key, then she can be sure that Bob is the only one who can read it. This is +associated with the `++skin` `%full`. + +`++sign:as:acru` allows us to sign a message with our private key so that +others can verify that we sent the message. If Alice signs a message with her +private key, then Bob can verify with her public key that it was indeed Alice +who sent it. This is associated with the `++skin` `%open`. + +`++sure:as:acru` is the dual to `++sign:as:acru`. It allows us to verify that +a message we have received is indeed from the claimed sender. If Alice sends a +message with her private key, then Bob can use this arm to verify that it was +indeed Alice who sent it. This is associated with the `++skin` `%open`. + +`++tear:as:acru` is the dual to `++seal:as:acru`. It allows us to read a +message that we can be sure is only read by us. If Alice seals a message with +Bob's public key, then Bob can use this arm to read it. This is associated +with the `++skin` `%full`. + +####`++de:acru`, `++dy:acru`, and `++en:acru`, symmetric encryption/decryption + +``` + ++ de |+([a=@ b=@] *(unit ,@)) :: symmetric de, soft + ++ dy |+([a=@ b=@] _@) :: symmetric de, hard + ++ en |+([a=@ b=@] _@) :: symmetric en +``` + +Symmetric encryption is associated with the `++skin` `%fast`. + +`++de:acru` decrypts a message with a symmetric key, returning `~` on failure +and `[~ u=data]` on success. + +`++dy:acru` decrypts a message with a symmetric key, crashing on failure. This +should almost always be defined as, and should always be semantically +equivalent to, `(need (de a b))`. + +`++en:acru` encrypts a message with a symmetric key. + +####`++ex:acru`, exporting data + +``` + ++ ex ^? :: export + |% ++ fig _@uvH :: fingerprint + ++ pac _@uvG :: default passcode + ++ pub *pass :: public key + ++ sec *ring :: private key + -- +``` + +`++fig:ex:acru` is our fingerprint, usually a hash of our public key. This is +used, for example, in `++zeno`, where every carrier owner's fingerprint is +stored so that we can ensure that carriers are indeed owned by their owners + +`++pac:ex:acru` is our default passcode, which is unused at present. + +`++pub:ex:acru` is the `++pass` form of our public key. + +`++sec:ex:acru` is the `++ring` form of our private key. + +####`++nu:acru`, reconstructors + +``` + ++ nu ^? :: reconstructors + |% ++ pit |=([a=@ b=@] ^?(..nu)) :: from [width seed] + ++ nol |=(a=@ ^?(..nu)) :: from naked ring + ++ com |=(a=@ ^?(..nu)) :: from naked pass + -- +``` + +These arms allow us to reconstruct a `++acru` from basic data. + +`++pit:nu:acru` constructs a `++acru` from the width of our intended key and +seed entropy. This is usually used in the initial construction of the +`++acru`. + +`++nol:nu:acru` constructs a `++acru` from a "naked ring", meaning a `++ring` +without the initial byte identifying the type of crypto. There is often a +helper arm that that wraps this; see `++weur` for `++crua` and `++wear` for +`++crub`. + +`++com:nu:acru` constructs a `++acru` from a "naked pass", meaning a `++ring` +without the initial byte identifying the type of crypto. There is often a +helper arm that that wraps this; see `++haul` for `++crua` and `++hail` for +`++crub`. + +###`++will`, certificate + +``` +++ will (list deed) :: certificate +``` + +This is a list of deeds associated with the current ship. There should be +an item in this list for every ship from this point up in the hierarchy times +the number of lives that each ship has had. For example, ~hoclur-bicrel may +have a will with three items: one for itself, one for ~tasruc (who issued +~hoclur-bicrel's deed) and one for ~tug (who issued ~tasruc's deed). + +###`++deed`, identity + +``` +++ deed ,[p=@ q=step r=?] :: sig, stage, fake? +``` + +`p` is the signature of a particular deed, which is a signed copy of `q`. + +`q` is the stage in the identity. + +`r` is true if we're working on a fake network, where we don't check that the +carrier fingerprints are correct. This allows us to create fake networks for +development without interfering with the real network. + +###`++step`, identity stage + +``` +++ step ,[p=bray q=gens r=pass] :: identity stage +``` + +This is a single stage in our identity. Thus, this is specific to a single +life in a single ship. Everything in here may change between lives. + +`p` + +`q` + +`r` is the public key for this stage in the identity. + +###`++bray` + +``` +++ bray ,[p=life q=(unit life) r=ship s=@da] :: our parent us now +``` + +XXX + +###`++gens`, general identity + +``` +++ gens ,[p=lang q=gcos] :: general identity +``` + +`p` is the IETF language code for the preferred language of this identity. +This is unused at the moment, but in the future text should be localized based +on this. + +`q` is the description of the ship. + +###`++gcos`, identity description + +``` +++ gcos :: id description + $% [%czar ~] :: 8-bit ship + [%duke p=what] :: 32-bit ship + [%earl p=@t] :: 64-bit ship + [%king p=@t] :: 16-bit ship + [%pawn p=(unit ,@t)] :: 128-bit ship + == :: +``` + +This is the description of the identity of a ship. Most types of identity have +a `@t` field, which is their human-readable name. The identity of a `%duke` is +more involved. + +A `%czar`, a carrier, is a ship with an 8-bit address. Thus, there are only +256 carriers. These are at the top of the namespace hierarchy, and the +fingerprint of each carrier is stored in `++zeno`. These are the "senators" of +Urbit. + +A `%king`, a cruiser, is a ship with a 16-bit address. Thus, there are 65,536 +cruisers. Each carrier may issue 256 cruisers. These are the infrastructure +of Urbit. + +A `%duke`, a destroyer, is a ship with a 32-bit address. Thus, there are +4,294,967,296 destroyers. Each cruiser may issue 65,536 cruisers. These are +the individuals of Urbit. + +A `%earl`, a yacht, is a ship with a 64-bit address. Thus, there are +18,446,744,073,709,551,616 yachts. Each destroyer may issue 4,294,967,296 +yachts. These are the devices of Urbit. + +A `%pawn`, a submarine, is a ship with a 128-bit address. Thus, there are a +lot of submarines. The chance of random name collision is negligible, so +submarines are not issued by any ship. They must simply assert their presence, +and they are all considered children of ~zod. This is the underworld of Urbit, +where anonymity reigns supreme. + +###`++what`, logical destroyer identity + +``` +++ what :: logical identity + $% [%anon ~] :: anonymous + [%lady p=whom] :: female person () + [%lord p=whom] :: male person [] + [%punk p=sect q=@t] :: opaque handle "" + == :: +``` + +This is the logical identity of a destroyer. + +A `%anon` is a completely anonymous destroyer. The difference between this and +a submarine is that a submarine is ephemeral while a `%anon` destroyer is not. +Thus, we may not know who ~hoclur-bicrel is, but we do know that it's always +the same person. + +A `%lady` is a female person. The name used here should be a real name. + +A `%lord` is a male person. The name used here should be a real name. + +A `%punk` is a person who is identified only by a handle. + +###`++whom`, real person + +``` +++ whom ,[p=@ud q=govt r=sect s=name] :: year/govt/id +``` + +Ths is the information associated with a real person. It is mostly information +that could be observed with the briefest of interactions. + +`p` is the birth year. + +`q` is the location of a user, usually of the form "country/zip". + +`r` is the sect of the user. + +`s` is the real name of the person. + + +###`++govt` + +``` +++ govt path :: country/postcode +``` + +This is the location of the user, usually of the form "country/zip". + +###`++sect` + +``` +++ sect ?(%black %blue %red %orange %white) :: banner +``` + +XXX + +###`++name` + +``` +++ name ,[p=@t q=(unit ,@t) r=(unit ,@t) s=@t] :: first mid/nick last +``` + +This is the given name, possible middle name/initial, possible nickname, and +surname of a user. + +packet format +------------- + +`++go`, PKI engine +------------------ + +###`++as`, per server + +####`++born`, register user + +#####`++lax`, per client + +`++pu`, packet pump +------------------- + +`++am`, protocol engine +----------------------- + +###`++um`, per server + +####`++ho`, per friend + +#####`++la`, per packet + +protocol vane +------------- + +#Batz + +Coming soon + +#Dill + +Coming soon + +#Clay + +Clay +==== + +Clay is our filesystem. + +data models +----------- + +###`++raft`, formal state + +``` +++ raft :: filesystem + $: fat=(map ship room) :: domestic + hoy=(map ship rung) :: foreign + ran=rang :: hashes + == :: +``` + +This is the state of our vane. Anything that must be remembered between calls +to clay must be stored in this state. + +`fat` is the set of domestic servers. This stores all the information that is +specfic to a particular ship on this pier. The keys to this map are the ships +on the current pier. + +`hoy` is the set of foreign servers that we know anything about. This stores +all the information that is specific to a particular foreign ship. The keys to +this map are all the ships whose filesystems we have attempted to access +through clay. + +`ran` is the store of all commits and deltas, keyed by hash. The is where all +the "real" data we know is stored; the rest is "just bookkeeping". + +###`++room`, filesystem per domestic ship + +``` +++ room :: fs per ship + $: hun=duct :: terminal duct + hez=(unit duct) :: sync duch + dos=(map desk dojo) :: native desk + == :: +``` + +This is the representation of the filesystem of a ship on our pier. + +`hun` is the duct that we use to send messages to dill to display notifications +of filesystem changes. Only `%note` gifts should be produced along this duct. +This is set by the `%init` kiss. + +`hez`, if present, is the duct we use to send sync messages to unix so that +they end up in the pier unix directory. Only `%ergo` gifts should be producd +along this duct. This is set by `%into` and `%invo` gifts. + +`dos` is a well-known operating system released in 1981. It is also the set of +desks on this ship, mapped to their data. + +###`++desk`, filesystem branch + +``` +++ desk ,@tas :: ship desk case spur +``` + +This is the name of a branch of the filesystem. The default desks are "arvo", +"main", and "try". More may be created by simply referencing them. Desks have +independent histories and states, and they may be merged into each other. + +###`++dojo`, domestic desk state + +``` +++ dojo ,[p=cult q=dome] :: domestic desk state +``` + +This is the all the data that is specific to a particular desk on a domestic +ship. `p` is the set of subscribers to this desk and `q` is the data in the +desk. + +###`++cult`, subscriptions + +``` +++ cult (map duct rave) :: subscriptions +``` + +This is the set of subscriptions to a particular desk. The keys are the ducts +from where the subscriptions requests came. The results will be produced along +these ducts. The values are a description of the requested information. + +###`++rave`, general subscription request + +``` +++ rave :: general request + $% [& p=mood] :: single request + [| p=moat] :: change range + == :: +``` + +This represents a subscription request for a desk. The request can be for +either a single item in the desk or else for a range of changes on the desk. + +###`++mood`, single subscription request + +``` +++ mood ,[p=care q=case r=path] :: request in desk +``` + +This represents a request for the state of the desk at a particular commit, +specfied by `q`. `p` specifies what kind of information is desired, and `r` +specifies the path we are requesting. + +###`++moat`, range subscription request + +``` +++ moat ,[p=case q=case] :: change range +``` + +This represents a request for all changes between `p` and `q`. Note that there +is currently no way to request to be notified only on changes to particular +paths in the filesystem. You must subscribe to the entire desk. + +###`++care`, clay submode + +``` +++ care ?(%u %v %w %x %y %z) :: clay submode +``` + +This specifies what type of information is requested in a subscription or a +scry. + +`%u` requests the `++rang` at the current moment. Because this information is +not stored for any moment other than the present, we crash if the `++case` is +not a `%da` for now. + +`%v` requests the `++dome` at the specified commit. + +`%w` requests the current revsion number of the desk. + +`%x` requests the file at a specified path at the specified commit. If there +is no node at that path or if the node has no contents (that is, if `q:ankh` is +null), then this produces null. + +`%y` requests a `++arch` of the specfied commit at the specified path. + +`%z` requests the `++ankh` of the specified commit at the specfied path. + +###`++arch`, shallow filesystem node + +``` +++ arch ,[p=@uvI q=(unit ,@uvI) r=(map ,@ta ,~)] :: fundamental node +``` + +This is analogous to `++ankh` except that the we have neither our contents nor +the ankhs of our children. The other fields are exactly the same, so `p` is a +hash of the associated ankh, `u.q`, if it exists, is a hash of the contents of +this node, and the keys of `r` are the names of our children. `r` is a map to +null rather than a set so that the ordering of the map will be equivalent to +that of `r:ankh`, allowing efficient conversion. + +###`++case`, specifying a commit + +``` +++ case :: ship desk case spur + $% [%da p=@da] :: date + [%tas p=@tas] :: label + [%ud p=@ud] :: number + == :: +``` + +A commit can be referred to in three ways: `%da` refers to the commit that was +at the head on date `p`, `%tas` refers to the commit labeled `p`, and `%ud` +refers to the commit numbered `p`. Note that since these all can be reduced +down to a `%ud`, only numbered commits may be referenced with a `++case`. + +###`++dome`, desk data + +``` +++ dome :: project state + $: ang=agon :: pedigree + ank=ankh :: state + let=@ud :: top id + hit=(map ,@ud tako) :: changes by id + lab=(map ,@tas ,@ud) :: labels + == :: +``` + +This is the data that is actually stored in a desk. + +`ang` is unused and should be removed. + +`ank` is the current state of the desk. Thus, it is the state of the +filesystem at revison `let`. The head of a desk is always a numbered commit. + +`let` is the number of the most recently numbered commit. This is also the +total number of numbered commits. + +`hit` is a map of numerical ids to hashes of commits. These hashes are mapped +into their associated commits in `hut:rang`. In general, the keys of this map +are exactly the numbers from 1 to `let`, with no gaps. Of course, when there +are no numbered commits, `let` is 0, so `hit` is null. Additionally, each of +the commits is an ancestor of every commit numbered greater than this one. +Thus, each is a descendant of every commit numbered less than this one. Since +it is true that the date in each commit (`t:yaki`) is no earlier than that of +each of its parents, the numbered commits are totally ordered in the same way +by both pedigree and date. Of course, not every commit is numbered. If that +sounds too complicated to you, don't worry about it. It basically behaves +exactly as you would expect. + +`lab` is a map of textual labels to numbered commits. Note that labels can +only be applied to numbered commits. Labels must be unique across a desk. + +###`++ankh`, filesystem node + +``` +++ ankh :: fs node (new) + $: p=cash :: recursive hash + q=(unit ,[p=cash q=*]) :: file + r=(map ,@ta ankh) :: folders + == :: +``` + +This is a single node in the filesystem. This may be file or a directory or +both. In earth filesystems, a node is a file xor a directory. On mars, we're +inclusive, so a node is a file ior a directory. + +`p` is a recursive hash that depends on the contents of the this file or +directory and on any children. + +`q` is the contents of this file, if any. `p.q` is a hash of the contents +while `q.q` is the data itself. + +`r` is the set of children of this node. In the case of a pure file, this is +empty. The keys are the names of the children and the values are, recursively, +the nodes themselves. + +###`++cash`, ankh hash + +``` +++ cash ,@uvH :: ankh hash +``` + +This is a 128-bit hash of an ankh. These are mostly stored within ankhs +themselves, and they are used to check for changes in possibly-deep +hierarchies. + +###`++rung`, filesystem per neighbor ship + +``` +++ rung $: rus=(map desk rede) :: neighbor desks + == :: +``` + +This is the filesystem of a neighbor ship. The keys to this map are all the +desks we know about on their ship. + +###`++rede`, desk state + +``` +++ rede :: universal project + $: lim=@da :: complete to + qyx=cult :: subscribers + ref=(unit rind) :: outgoing requests + dom=dome :: revision state + == :: +``` + +This is our knowledge of the state of a desk, either foreign or domestic. + +`lim` is the date of the last full update. We only respond to requests for +stuff before this time. + +`qyx` is the list of subscribers to this desk. For domestic desks, this is +simply `p:dojo`, all subscribers to the desk, while in foreign desks this is +all the subscribers from our ship to the foreign desk. + +`ref` is the request manager for the desk. + +`dom` is the actual data in the desk. + +###`++rind`, request manager + +``` +++ rind :: request manager + $: nix=@ud :: request index + bom=(map ,@ud ,[p=duct q=rave]) :: outstanding + fod=(map duct ,@ud) :: current requests + haw=(map mood (unit)) :: simple cache + == :: +``` + +This is the request manager for a desk. + +`nix` is one more than the index of the most recent request. Thus, it is the +next available request number. + +`bom` is the set of outstanding requests. The keys of this map are some subset +of the numbers between 0 and one less than `nix`. The members of the map are +exactly those requests that have not yet been fully satisfied. + +`fod` is the same set as `bom`, but from a different perspective. In +particular, the values of `fod` are the same as the values of `bom`, and the +`p` out of the values of `bom` are the same as the keys of `fod`. Thus, we can +map ducts to their associated request number and `++rave`, and we can map +numbers to their associated duct and `++rave`. + +`haw` is a map from simple requests to their values. This acts as a cache for +requests that have already been made. Thus, the second request for a +particular `++mood` is nearly instantaneous. + +###`++rang`, data store + +``` +++ rang $: hut=(map tako yaki) :: + lat=(map lobe blob) :: + == :: +``` + +This is a set of data keyed by hash. Thus, this is where the "real" data is +stored, but it is only meaningful if we know the hash of what we're looking +for. + +`hut` is a map from hashes to commits. We often get the hashes from +`hit:dome`, which keys them by logical id. Not every commit has an id. + +`lat` is a map from hashes to the actual data. We often get the hashes from a +`++yaki`, a commit, which references this map to get the data. There is no +`++blob` in any `++yaki`. They are only accessible through this map. + +###`++tako`, commit reference + +``` +++ tako ,@ :: yaki ref +``` + +This is a hash of a `++yaki`, a commit. These are most notably used as the +keys in `hut:rang`, where they are associated with the actual `++yaki`, and as +the values in `hit:dome`, where sequential ids are associated with these. + +###`++yaki`, commit + +``` +++ yaki ,[p=(list tako) q=(map path lobe) r=tako t=@da] :: commit +``` + +This is a single commit. + +`p` is a list of the hashes of the parents of this commit. In most cases, this +will be a single commit, but in a merge there may be more parents. In theory, +there may be an arbitrary number of parents, but in practice merges have +exactly two parents. This may change in the future. For commit 1, there is no +parent. + +`q` is a map of the paths on a desk to the data at that location. If you +understand what a `++lobe` and a `++blob` is, then the type signature here +tells the whole story. + +`r` is the hash associated with this commit. + +`t` is the date at which this commit was made. + +###`++lobe`, data reference + +``` +++ lobe ,@ :: blob ref +``` + +This is a hash of a `++blob`. These are most notably used in `lat:rang`, where +they are associated with the actual `++blob`, and as the values in `q:yaki`, +where paths are associated with their data in a commit. + +###`++blob`, data + +``` +++ blob $% [%delta p=lobe q=lobe r=udon] :: delta on q + [%direct p=lobe q=* r=umph] :: + [%indirect p=lobe q=* r=udon s=lobe] :: + == :: +``` + +This is a node of data. In every case, `p` is the hash of the blob. + +`%delta` is the case where we define the data by a delta on other data. In +practice, the other data is always the previous commit, but nothing depends on +this. `q` is the hash of the parent blob, and `r` is the delta. + +`%direct` is the case where we simply have the data directly. `q` is the data +itself, and `r` is any preprocessing instructions. These almost always come +from the creation of a file. + +`%indirect` is both of the preceding cases at once. `q` is the direct data, +`r` is the delta, and `s` is the parent blob. It should always be the case +that applying `r` to `s` gives the same data as `q` directly (with the +prepreprocessor instructions in `p.r`). This exists purely for performance +reasons. This is unused, at the moment, but in general these should be created +when there are a long line of changes so that we do not have to traverse the +delta chain back to the creation of the file. + +###`++udon`, abstract delta + +``` +++ udon :: abstract delta + $: p=umph :: preprocessor + $= q :: patch + $% [%a p=* q=*] :: trivial replace + [%b p=udal] :: atomic indel + [%c p=(urge)] :: list indel + [%d p=upas q=upas] :: tree edit + == :: + == :: +``` + +This is an abstract change to a file. This is a superset of what would +normally be called diffs. Diffs usually refer to changes in lines of text +while we have the ability to do more interesting deltas on arbitrary data +structures. + +`p` is any preprocessor instructions. + +`%a` refers to the trival delta of a complete replace of old data with new +data. + +`%b` refers to changes in an opaque atom on the block level. This has very +limited usefulness, and is not used at the moment. + +`%c` refers to changes in a list of data. This is often lines of text, which +is your classic diff. We, however, will work on any list of data. + +`%d` refers to changes in a tree of data. This is general enough to describe +changes to any hoon noun, but often more special-purpose delta should be +created for different content types. This is not used at the moment, and may +in fact be unimplemented. + +###`++urge`, list change + +``` +++ urge |*(a=_,* (list (unce a))) :: list change +``` + +This is a parametrized type for list changes. For example, `(urge ,@t)` is a +list change for lines of text. + +###`++unce`, change part of a list. + +``` +++ unce |* a=_,* :: change part + $% [%& p=@ud] :: skip[copy] + [%| p=(list a) q=(list a)] :: p -> q[chunk] + == :: +``` + +This is a single change in a list of elements of type `a`. For example, `(unce ,@t)` is +a single change in a lines of text. + +`%&` means the next `p` lines are unchanged. + +`%|` means the lines `p` have changed to `q`. + +###`++umph`, preprocessing information + +``` +++ umph :: change filter + $| $? %a :: no filter + %b :: jamfile + %c :: LF text + == :: + $% [%d p=@ud] :: blocklist + == :: +``` + +This space intentionally left undocumented. This stuff will change once we get +a well-typed clay. + + +###`++upas`, tree change + +``` +++ upas :: tree change (%d) + $& [p=upas q=upas] :: cell + $% [%0 p=axis] :: copy old + [%1 p=*] :: insert new + [%2 p=axis q=udon] :: mutate! + == :: +``` + +This space intentionally left undocumented. This stuff is not known to work, +and will likely change when we get a well-typed clay. Also, this is not a +complicated type; it is not difficult to work out the meaning. + +#Eyre + +Coming soon + +#Ford + +Coming soon + +#Gall + +Coming soon diff --git a/main/pub/src/doc/say/arvo/app.md b/main/pub/src/doc/say/arvo/app.md new file mode 100644 index 0000000000..c1395ee259 --- /dev/null +++ b/main/pub/src/doc/say/arvo/app.md @@ -0,0 +1,1379 @@ +#Application programming in Arvo + + +**NOTE - not everything in this doc matches current reality! +Where this is the case, reality must be changed to match.** + +ERRATUM: the beautiful ~/urb/SHIP... is not real. Reference +your piers in the normal way. + + +## Hello, world. + +Let's write a simple Arvo app, `foobug`. Start Urbit: + + vere + +From Unix, edit `~/urb/SHIP/main/app/foobug/core.hoon`, where +SHIP is your ship *without* the ~ (for me, `tasfyn-partyv`): + + !: + ::::::::: Foobug: a simple application. + :: + |_ [hid=hide vat=~] + ++ peek + |= [you=ship pax=path] + :- %hymn + ;html + ;head + ;title: Foobug! + == + ;body + ;p: Hello, world. + == + == + -- + +In your browser, go to the URL: + + https://SHIP.urbit.org/foobug + +Now you've written and executed your first Urbit app. + +(If you are running `vere` locally, you'll go faster, not to +mention ease up on our servers, by going direct: + + https://localhost:PORT/foobug + +where `PORT` is the HTTP port `vere` prints out when it starts, +usually `8080`.) + +Leave your browser open and resume editing `foobug/core.hoon`. +Change "Hello" to "Goodbye." Save the file. Then, look at your +browser... now you've upgraded your first Urbit app. + + +## Introductory concepts. + +Urbit apps are written in a funny little language called Hoon. +To be exact, you write an app named APPL by putting a Hoon program +in `~/urb/SHIP/main/APPL/core.hoon`. + +How do you start APPL? You don't. Urbit starts it. You also +don't restart it when you change the code; Urbit does that too. + +Urbit loads an application as soon as someone tries to use it; it +tracks dependencies as it builds, and reloads when its source, or +any other hot-linked code or data dependency, local or remote, +changes. + +Type consistency is never broken in this process - if the +app state changes type across the reload, the replacement +brings an adapter function. If the reboot fails, the old app +continues to run. And as you saw, we inject a script which +auto-reloads your application page. Just to be nice. + +And of course, Urbit is a single-level store, so Urbit +applications with live state are inherently persistent and live +forever (or at least, as long as your Urbit ship). Flushing +state to Urbit's %clay revision store - or even more drastically, +to a legacy database outside Urbit - may be desired but is not +required, not even (ideally) for mission-critical data. + + +## What we're doing here. + +Let's look at `foobug` in a little more detail. + +Our `core.hoon` file starts with this boilerplate opening: + + !: + ::::::::: Foobug: a simple application. + :: + +The `!:` enters debug mode. Within the opening, we produce a core +around the sample state + + |_ [hid=hide vat=~] + +This is where all the data in our application lives. `hid` is +the system's data, `vat` is our data. Right now, `vat` is empty, +because our application is trivial. + +Searching for where `hide` comes from, we find in `hoon.hoon`: + + ++ bone ,@ud :: opaque duct + ++ hide :: standard app state + $: $: our=ship :: owner/operator + app=term :: application name + == :: + sup=(map bone (pair ship path)) :: subscription set + $: act=@ud :: change number + eny=@uvI :: entropy + lat=@da :: date of last action + == == :: + +Everything above is easy to explain but `++bone`. Perhaps the +simplest analogy: a Unix file descriptor. + +But this approximation won't really hold up under the crazy stuff +we're about to do. Unfortunately, we can't explain apps without +`++hide`,`++hide` without `++bone` or `++bone` without Arvo. + +## Arvo for undergrads + +If you take an undergraduate OS class, you'll learn that there +are two kinds of general-purpose operating systems: communicating +sequential processes, and asynchronous event-driven actors. Unix +and Go are CSP models; Node and Arvo are event loops. + +Across this pair of equally legitimate alternatives, every +architectural feature has its equivalent. But most programmers +are more familiar with the CSP model. For instance: in a pure +event OS, what's the equivalent of a file descriptor? + +In Arvo the answer is something called a `++duct` - or in +userspace, `++bone`. The actual event data is a `++card`. A +`++move`, or action, is a `(pair duct card)` in + +If you understand ducts, bones +and cards, you understand Arvo. + +(Well, mostly. But it's worth noting that Arvo proper, not the +vanes which actually do stuff, but the stuff in hoon.hoon that +makes everything do stuff, is only about 600 lines of code.) + +Physically, a duct is just a list of a list of symbols. +Semantically, it's the *source* of an event - or even more +philosophically its *cause*. But why do we need a data structure +for this? Shouldn't the effects of an event be, in fact, +*independent* of its cause? + + +### Motivation + +Arvo is a *structured* event system, designed to avoid the usual +state of complex event networks: event spaghetti. In some ways +it seems more complicated than a simple standard approach. It +is, but the systems built on top of it are much simpler. + +"Event," at its worst, is an asynchronous synonym for "goto." +What is the difference between a `goto` and a `gosub`, anyway? +You may not know where your gosub goes. But at least you know it +will in some way return to its caller. Otherwise.. it's a goto. + +In a vanilla functional event system, your application is defined +as an object with methods, one of which is something like "do" - +taking an event, returning a list of side effects and a new +application object. One such side effect, in any reasonably +complex system, is to post an event. Alas, this design - while +admirable on a small or simple scale - in bigger systems enters a +pathological mode in which events pile up in a sort of cascading +event ping-pong. + +This often even works. But as with the old BASIC gotos, when it +doesn't, it's rather hard to figure out why. So we need a gosub, +as it were. A structured event model. Slightly less simple than +nothing, but still not exactly rocket science. + +This is slightly simplified from the actual code, but Arvo's +structured event system is built around these models: + + ++ card (pair term noun) :: event data + ++ duct (list (pair role wire)) :: event source + ++ gift card :: out result <-$ + ++ kiss card :: in request ->$ + ++ mold :: general action + $% [%give (lone gift)] :: + [%pass (pair wire note)] :: + == :: + ++ move (pair duct mold) :: traced action + ++ note (pair term noun) :: out request $-> + ++ noun ,* :: any noun + ++ role ,@tasD :: role byte + ++ term ,@tas :: symbolic name + ++ span ,@ta :: wire segment + ++ sign (pair term noun) :: in result $<- + ++ wire (list span) :: logical location + +What the heck is this stuff? + +Think about a function call in a normal procedural language, +and its physical representation in a stack frame. Wallace +Stevens showed us 24 ways of seeing a blackbird, but there are +only four ways of seeing a stack frame. It can be (a) the +arguments as seen by the caller, (b) the arguments as seen by the +callee, (c) the return value as seen by the callee, (d) the +return value as seen by the caller. + +In Arvo terms, (a) is a `++note`, (b) is a `++kiss`, (c) is +a `++sign`, and (d) is a `++gift`. + +You'll see that `++note` and `++sign` have a different shape from +`++kiss` and `++gift`. The extra `++term` in a note or a sign +identifies the `++role` of the Arvo actor, or `vane`, that we're +calling to or returning from respectively. + + +### Vanes + +A vane is a stateful actor within the Arvo kernel. You are +writing user-level apps; you are not writing Arvo vanes. +But your apps use vane services, are hosted by a vane (`%gall`), +and most important - follow the same general design pattern. + +A vane's function is defined by its `role`, or interface +contract. Te role is a single letter which defines the vane's +interface, and matches the first letter of the module that +implements it - like `e` for `%eyre`, or `c` for `%clay`. + +Eg, `%eyre` (source in `/===/arvo/eyre/hoon`) is a concrete +implementation of the `%e` interface, ie, HTTP. If you change +`eyre.hoon`, `:reload %eyre` will install the new server. + +The vanes at present: + + %a %ames packet networking + %b %batz command line + %c %clay revision control + %d %dill console + %e %eyre HTTP + %f %ford functional construction + %g %gall user-level applications + + +### Vane arms + +An Arvo vane exports this basic interface (again, simplified for +educational purposes): + + |% + ++ call :: accept request + |= [hen=duct hic=kiss] + ^- [p=(list move) q=_+>] !! + :: + ++ take :: handle response + |= [hen=duct way=wire sih=sign] + ^- [p=(list move) q=_+>] !! + -- + +Whereas a hypothetical unstructured Arvo might look like: + + |% + ++ do + |= car=card + ^- [p=(list card) q=_+>] !! + -- + +The vane hears that something happened. It answers with `p`, a +list of more things to make happen, and `q`, the new itself. +This is simpler than Arvo; a `goto` is simpler than a `gosub`. + +In Arvo, your vane exports two gates: `++call` for when another +vane calls you, `++take` for when someone you called returns. + +The vane hears that *one of two* things happened. Either it got +a request (a kiss) or a response (a sign). There is no third +kind of a thing; there is no strange furry thing halfway between +a kiss and a sign. + +Note that `++call` and `++take` produce the same product. This +remains `p`, a list of more things to make happen, and `q`, the +vane's new value. + +But now there are *two* kinds of `++move`, a `%give` and a +`%pass`. If you suspect that `%give` means "return" and `%pass` +means "call", you may be beginning to understand Arvo. But +first, deeper into ducts. + +Arvo's structured events are the dual of procedure calls, but its +ducts are one phenomenon for which there is no exact equivalent +in any language we know. Most procedural languages (sadly) do +not even expose their call stacks as user-level data structures. +The duct is not the full call stack, but something like a call +stack in which each frame is just the procedure name. + +But this is an inexact and meretricious analogy. Let's look +concretely at how Arvo uses `%give` and `%pass` to build ducts. + + +### Ducts, events and types + +Before we continue, it's essential to confess our sins in the +oversimplified models above. + +In actual Arvo, there is no `++card` model at all, and each vane +has its own definition of `++gift`, `++kiss`, `++note`, `++move` +and `++sign`. `++mold` is parameterized for your convenience +(don't use `%slip` or `%sick`, please). + +Why do we have vanes, after all? So they don't have to include +each other. No two large systems can. Thus, it is very much our +desire not to tangle all our vanes together - like a previous +version of Arvo in which *all events were jammed together as a +single `++card` model*. There were almost 100 fronds in this +kelp, and it was just as heinous as it sounds. + +Rather, every vane uses the type system to formally define the +gifts and notes it produces, and the kisses and signs it accepts. +Moreover, Arvo dynamically compiles every event application, and +thus actually uses these types to typecheck its events. Event +data is never, ever de-typed and then re-rectified. Signs and +notes even need to match the roles they come from / go to. + +The downside of this is that it often makes sense to copy card +models from vane to vane, eg, from a service provider to a +service user. Programmers should not feel the slightest +discomfort at this duplication. Anyway, you only need to copy +the API tiles that you actually use. + + +### Duct examples + +A duct is a `(list wire)` in which each `++wire` represents the +*cause* of a a `++call` or `++take` action. The head of each +wire in the duct is a vane role, except for the bottom wire - +which is `%$`, for kisses from Unix to Arvo. + +The rest of the wire represents an abstract location or *place* +within the vane of that role. What does this "place" mean? It +depends on the vane. + +Consider, for instance, the bottom wire in every duct - the +original cause of this event, which is always something that +happened at the Unix layer. But Unix is not just one big blob. +For `%$` wires, the place is the Unix event channel - often +quite directly corresponding to a file descriptor. + +For example, HTTP requests come not from `/$`, and not even from +`/$/http/`, but from (for instance) `/$/http/0vh.ephnu/1/2`, +where `0vh.ephnu` uniquely identifies the current process's HTTP +server instance, `1` is its first connection, and `2` is that +connection's first request. If we reboot the `vere` process, we +know we broke all the sockets of `0vh.ephnu`, which is obvious to +Unix but has to be explained to Arvo. + +Ascending up in this same example, we see the deeper duct + + :~ /g/~zod/foobug/s/peer/~zod/goof + /e/hoop/~zod/pidtyl-danpur-dozted-micsed/1/frog + /$/http/0vh.ephnu/1/2 + == + +From the `/g` and `/e`, we know that the Unix event was sent +first to `%eyre` and then to `%gall`, ie, we seem to be talking +via HTTP to one of our applications. + + +### Duct assembly + +How do we construct ducts? Let's unroll the internal structure +of `++move`. A move is either + + [p=duct q=[%give p=card]] + +or + + [p=duct q=[%pass p=wire q=[p=role q=card]]] + +From this move, we know exactly how Arvo will use what vane. +Suppose `%ford` produces a `%give` move with the duct above, +and the card `[%test ~]`. Where `vay` is `%gall` (`/g`), Arvo +will compute + + (take:vay t.p t.i.p [%f p.q]) + +where `t.p`, the rest of the popped duct, is + + :~ /e/hoop/~zod/pidtyl-danpur-dozted-micsed/1/frog + /$/http/0vh.ephnu/1/2 + == + +`t.i.p` is the location, `/~zod/foobug/s/peer/~zod/goof`, +`%f` is the returning vane (`%ford`), and `p.q` is the result +that `%ford` wants to return to `%gall`. + +Suppose `%gall` wants to call back into `%ford` from exactly the +same location, with the same card. It must produce the move + + [t.p %pass /~zod/foobug/s/peer/~zod/goof %f [%test ~]] + +Where `vay` is `%ford`, Arvo will call + + (call:vay p [%test ~]) + +`p`, of course, being the original duct above. + + +### Duct semantics: independence principle + +Recall the question we asked originally: if we don't intend to +let the programmer use the data in the duct, why is it there? +If we do intend to let the programmer use it, isn't that a +mistake? Isn't there a contradiction here? This duct system +seems reasonably straightforward. But gosh, what is it *for*? + +We now have a concrete answer to what a vane can do with a duct. +The first principle of responsible duct ownership: *a vane is not +allowed to make ducts*. The only ducts a vane may produce are +those that Arvo has passed it. Only Arvo makes ducts - like the +government with dollars. + +The second principle of responsible duct ownership: event +computations must not depend on duct contents. Actually, it is +always wrong to peek into ducts. You can, but don't. + +Naturally, the Hoon type system cannot enforce these contracts. +We enforce the duct handling principles at the vane level by +noting that installing alternate vanes is like putting +aftermarket chips in your engine or overclocking your CPU. +Ma'am, we're sorry, but your warranty is void. + +At the user level (ie, within `%gall`) we enforce the opacity of +ducts by... hiding them behind an opaque atom, the `++bone`. +It is impossible to imagine the variety of "weird machines" that +a malicious actor could otherwise contrive. The wild maelstrom +of event `goto` hell is never far beneath the unrippled surface +of Arvo. + + +### Duct semantics: fool's mate + +One very easy mistake to make is to confuse the call stack of +Arvo itself with the duct. These are often logically aligned, +but by no means always so. + +Recall the vane arms: + + |% + ++ call :: accept request + |= [hen=duct hic=kiss] + ^- [p=(list move) q=_+>] !! + :: + ++ take :: handle response + |= [hen=duct way=wire sih=sign] + ^- [p=(list move) q=_+>] !! + -- + +Each of `++call` and `++take` has `hen=duct` in its sample. +Again, `hen` represents the *logical cause* of this event. + +And the product of each contains a list of `++move`, which as we +recall is (fully expanded): + + $? [p=duct q=[%give p=card]] + [p=duct q=[%pass p=wire q=[p=role q=card]]] + == + +The fool's mate of Arvo is the illusion that, for a call or take +with some `hen` in the sample, `p` in each product move must be +the same duct as that `hen`. Obviously, if this were the case, +`(list mold)` rather than `(list move)` would be the product. + +(Using procedural equivalence, we can see how this error aligns +with the Arvo call stack, or rather something like it. Imagine +if a vane, instead of producing a move when it wanted to "call" +another vane, ie `%pass` to it, actually called it. The call +stack (in this very impractical Arvo) would match the duct.) + +But of course, it is quite common for `p`, the move duct, to +equal `hen`, the event duct. This gives us two categories of +`++move`, for every event: *cis* moves, for moves where `=(p +hen)`, and `*trans*` moves, for everything else. + + +### Duct semantics: cis and trans + +The assembly example above contains only *cis* moves, which are +the typical pattern of a simple synchronous service. In a single +turn of the Arvo main event loop, our HTTP request bounces from +`%eyre` to `%gall` to `%ford` and back again; the request +produces its own response. + +In an asynchronous system like Urbit, synchronous *cis* services +remain the most common form of interaction. But Urbit would be +super boring if it didn't come with a big helping of *trans*. + +Suppose, for instance, we modify the above request pattern. +`%eyre` sends an application request to `%gall`, and `%gall` to +`%ford`, but `%ford` needs some global state not in its cache, +and has to consult `%clay`. `%clay` recognizes the path as a +foreign one and asks `%ames` to send a network request on its +behalf. When the state becomes available, the remote server uses +`%ames` to give a response message back to our `%clay` - which +gives a (confusingly named) `%writ` card back to `%ford`, etc. + +The asynchrony, the *trans* event, in this service path belongs +to `%ames`, because `%ames` matches the outgoing message with +the message response, and sends the response back on the incoming +duct. This process is rather less obvious than it may seem. + +To be exact: when `++call` asks `%ames` to send a message, the +only moves produced *in this event* are a list of packets heading +to the Ethernet port. (Even then, we hardly would send all our +little packetses off at once.) + +Rather, the actual, direct or *cis* cause of the `move` that +responds from `%ames` back to `%clay` is, of course, a packet +that `%ames` gets from the network. How does it get back to +`%clay`? + +Obviously, the outgoing-message `++call` (caused by `%clay`) must +*save* its `hen` duct somewhere in the bowls of %ames, mapped to +a message GUID. When an incoming-packet `++call`, some +milliseconds, seconds, or for that matter months later, produces +a message that decodes to a responding GUID, `%ames` will emit +moves that respond to the original `hen`. + +If we labor much over this concept, which may be seem stone cold +obvious, note that *trans* moves are obviously the converse of +the common CSP concept of blocking requests. (Exercise for the +undergraduate reader: what is the event converse of deadlock?) + + + +### The case against CSP + +Under various names, the war between events and CSP has been +going on at least as long as that between Chevy and Ford, +Makita and Husqvarna, or emacs and vi. + +As in each of these cases, it's quite simple. CSP sucks. It +belongs in a museum of the 20th century, next to T-tops, East +Germany and Windows 3.1. + +Evidence point: every time a platform exports native threads, +which actually have a scheduler like, you know, actual threads, +someone builds "green threads" on top of it - ie, nonpreemptive +threads. One common hint that something you're doing sucks: +every time you do it, someone comes along and feels the need to +do it over in the opposite way. + +Moreover, "nonpreemptive threads" are, with all due respect, a +contradiction in terms. Sirs, you are already halfway to the +devil! I know what's under your "nonpreemptive threads." It's an +event system, isn't it? What else could it be? + +If your underlying event system is of the `goto` school, sure, +it probably pays to keep it under a prophylactic layer. It would +be possible to use the usual functional techniques to make it +look very much like our message event above "blocked," like a +green thread. It would be not much more than a layer of +obscurity, though. Unnecessary layers are considered harmful. + +The case against CSP is that *the state of a CSP system is not +well-defined at any regular point in time*. Eg, there is +(generally) no systematic or well-defined way of stopping a CSP +process and saving it to a file, even with some loss of work. +Not, in any CSP system, that it's impossible to implement a +tool that does this - but that there is generally no +straightforward definition of intermediate state, and certainly +no mapping from any such abstraction to actual internal data. + +This is where a true event system, not even pretending to be a +CSP machine, shines. Not only is its state precisely defined +between events (and if you have to halt an event computer within +an event, you can just throw away the computation) - its *data is +not mixed up with code*. + +Passive data - Hoon nouns without cores in them - is vastly +preferable in almost every context to active data. For example, +it is always a mistake to send active data over the network - +where it is not actively impossible, it is actively idiotic. +Also, it's a relatively common operation to throw away all your +code, while keeping all your data. The more the two are mixed +together, the more fun it is untwingling them apart. + +Note that when `%ames` saves the duct it got from `++call`, +*it is not saving code*. It is not saving a callback, a closure, +a promise or even a continuation. (Uncharitable mockers may +recall the long-running struggle of HN, written in the CSP Lisp +Arc, to manage the limited pool of continuations mapped to URLs, +resulting in the dreaded "expired link" error. This is because a +continuation contains a stack and is more apt than not to be as +big as a bus.) + + +### The case against events + +Obviously, asynchronous events are the future. It's clear that +when the CSP dinosaurs are in the museum, it'll be the event +loops who *visit* that museum. Nonetheless, a few architectural +quirks are worth noticing. + +One of these is that *asynchronous systems have no flow control*, +and as a result *congestion control is an end-to-end problem*. + +Obviously, flow control makes no sense if you can't block a +process. Or rather, the only thing that makes sense is *logical* +flow control. Logical flow control is, always and everywhere, +congestion control. + +End-to-end congestion control is a somewhat harder problem than +classic congestion control. On the downside, E2ECC requires +actual, active compliance with CC logic not just in the stack, +but by the end application. Also, heuristics are considerably +more difficult, because the roundtrip time for a packet that +completes a message includes not just network latency, but also +computation latency for the whole transaction, from business +logic to disk - a metric with considerable variance. + +One mitigating factor: E2ECC is not really a hard problem for +apps to solve. The closer the programmer is to the endpoint, the +easier it is to behave in a sane way. For example, if an app (a) +obeys a simple request-response structure in which only one +request is outstanding at a time, and (b) the size of the +requests is sane, the behavior of the app is sane. + +The first law of E2ECC is: don't try to talk to people who aren't +talking back to you. The second law of E2ECC is: if it is +absolutely necessary to keep buttonholing people who are not +responding, give a neighbor a break and at least practice +exponential backoff. For instance, if my ship has been trying to +send a message to your ship for, say, a year, it is appropriate +for me to send you a packet again, say, every six hours. + +As for the CC algorithms, we are still screwing around... + +And of course, threads (real threads, anyway) excel when it's +time to go parallel. There is an event converse of explicit +parallelism: implicit parallelism. In which we cleverly figure +out that we can use physical parallelism to compute our event +function, which is serial, using these multiple cores. This does +not seem incredibly hard - given the high stability of said event +function, arbitrary amounts of tedious hardcoding become possible. + +## From Arvo to `%gall`, kernel to user. + +The structured event logic which connects the vanes is in fact +repeated at two other layers. At the bottom, the interface Arvo +presents to Unix (or whatever native OS) makes Arvo itself look +like one big vane. + +And on top, `%gall` treats the apps it runs like little vanes. +These analogies are highly imprecise and all details differ. +Even the arm names differ. + +But a vane in this more abstract sense is any object that can (a) +accept requests (`++call`) and handle responses (`++take`), +generating a list of actions (`++move`) and a new state; (b) +expose a namespace (`++scry`); (c) reboot itself safely (`++load` +and `++stay`). So long as you understand all these concepts, +you understand both kernel and user programming in Arvo. + + +## The goals of `%gall`. + +Broadly speaking, `%gall` has two goals: (a) let `%gall` +apps consume and provide kernel vane services; (b) let `%gall` +apps define an event arena, similar to that of kernel Arvo, but +between apps and across the network. + +Thus in (a) we talk to an inner ring, and in (b) we stay in the +outer ring. Applying our CSP metaphor, the good old "system +call" can be recognized in (a), though the system-call model does +not work so well if the kernel wants to call application +services; (b) is obviously some sort of RPC, or at least IPC. + +(The main challenge in `%gall` is maintaining type integrity +without revalidation (except of course for network data), for +both (a) and (b). Even with the tools Hoon provides, this is +difficult. The best way to understand how it works is to read +the code, especially `++song`.) + + +## Back to our application. + +We're now in a position to explain `++hide`, the standard state. + +This is the `%gall` equivalent of Unix's "u area": the kernel state +specific to your application. `%gall` resets the hide every time +it calls you. You can change it or not; `%gall` does not notice. + + + ++ hide :: standard app state + $: $: our=ship :: owner/operator + app=term :: application name + == :: + sup=(map bone (pair ship path)) :: subscription set + pus=(jug path bone) :: noitpircsbus set + $: act=@ud :: change number + eny=@uvI :: entropy + lat=@da :: date of last action + == == :: + +Let's run quickly through the meaning of these legs: + +`our.hid` is the host identity, ie, ~SHIP or `~tasfyn-partyv`. +`app.hid` is the formal name of the application, ie, APPL or +`%foobug`. `our` and `app` never change. + +`sup.hid` is a map from a communication channel, or `bone`, to a +user identity and a subscription path. `pus.hid` maps each path +back to a set of bones. This internal `%gall` state is also +useful to your app, as we'll see soon. otherwise get sweaty +maintaining it. + +`act.hid` is the change number - ie, the number of times the +application's state (ie, `vat`) has changed in any way. +`lat.hid` is the date of the last change. `eny.hid` is at least +256 bits of entropy, not detectably reused after this +construction. + +`vat` is your application state. Your goal and ours is to +serve, preserve and improve it. `foobug` has nothing in +there right now, of course, but watch out! + + +## The application core. + +Your job as a programmer is to (a) define the `vat`, ie, your +state, and fill in the various arms of the core. + +Because `%gall` uses dynamic compilation on your core, there is +no strict tile that it has to match. In fact, %gall can even +decide how to call you based on what arms your core exports, a +very un-Hoon-like reflexive behavior. + +Below you'll find definitions of each standard arm. For your +convenience, they all have four letters and start with `p`. + + +## Application gates: `++peek`. + +`++peek` is the one gate in Foobug so far. Abstractly: + + ++ peek + |= [you=ship pax=path] + ^- [mark noun] !! + +## Example: `++peek`. + +A `noun` in our abstract arm definitions doesn't mean we don't +use the type system - it means each app uses it differently. +For instance, as we wrote above: + + ++ peek + |= [you=ship pax=path] + ^- [mark manx] + :- %hymn + ;html + ;title: Foobug! + ;body + ;p: Hello, world. + == + == + +`++peek` is simply a view function. `you` is the user doing +the viewing, and `pax` is a path which represents what she's +looking at. + +In the example so far, we ignore both `pax` and `you`. Actually, +The uses you make of `you` and `pax` are entirely up to you. +Broadly speaking, `pax` represents a path, place, channel, +folder, or other subcontext within your application. + +But what does `++peek` produce? A... `[mark manx]`? Alas, this +requires another small digression. + + +## Content types and XML; ++mark and ++manx. + +In `foobug`, the product of `++peek` is a cell `[mark manx]`: + + ++ mark term :: content type + ++ manx $|(@tas [t=marx c=marl]) :: XML node + ++ mane $|(@tas [@tas @tas]) :: XML name/space + ++ manx $|(@tas [t=marx c=marl]) :: XML node + ++ marl (list manx) :: XML node list + ++ mars ,[t=[n=%$ a=[i=[n=%$ v=tape] t=~]] c=~] :: XML cdata + ++ mart (list ,[n=mane v=tape]) :: XML attributes + ++ marx $|(@tas [n=mane a=mart]) :: XML tag + +`++manx` is not of course a complete and perfect representation +of XML. But in most cases, it will do. Sorry, XML. + +`++mark` is a *mark*, or simplified content type. We ditch the +elaborate and bizarre hierarchical scheme of MIME, and stick with +a flat terminal that in general should equal the Unix file +extension. `Marks` can also be called `protocols`, as they are +formats for typed data being sent over the network. + +Our marks here is `%hymn`, which is logically an HTML noun. +Right now the `%hymn` mark is just an arbitrary `manx`, though it +really should reflect the DTD to at least some level. + +(It is important to recognize that although we can and do +construct both a rectifier and a type (the type being just the +range of the rectifier) for any working mark, the type is often +more general than the marks. It is ideal for them to match +exactly. But while every noun within the marks must be within +the type, not every noun within the type is within the marks - +just as not every valid `++manx` is a proper HTML5 noun.) + +One useful service that the build vane, `%ford`, provides: +automatic rectification (conversion of untyped to typed nouns) of +marks, and automatic translation between them. + +For instance, your browser showed you "Hello, world" as the +above. This came across as an HTTP, ie MIME, response. We had +to translate %hymn into (flat textual) %html, then %html to +%mime. All of these are trivial translations, which makes their +implementations ideal for educational purposes: + + ~/=main=/sys/hymn/ref/gate/hoon + ~/=main=/sys/hymn/tan/html/gate/hoon + ~/=main=/sys/html/ref/gate/hoon + ~/=main=/sys/html/tan/mime/gate/hoon + ~/=main=/sys/mime/ref/gate/hoon + +As for the Hoon syntax used to build HTML (or any XML, although +Hoon interpolation is disabled for the special cases of +`