on master help sign in
Merge remote-tracking branch 'origin/cleanorg' into cleanorg
5a8de88Philip C Monk
docs/programming/core.md+8−10
@@ -4,21 +4,19 @@ sort: 1
4
4
5# Core Hoon
5# Core Hoon
6
6
7−Hoon is strict, typed functional programming without math.
7+Hoon is strict, typed functional programming without category
8+theory.
8
9
9Hoon is named after a Wallace Stevens poem. Coincidentally, it
10Hoon is named after a Wallace Stevens poem. Coincidentally, it
10means "hooligan" in Australian. Practically, "Hoon" is a short
11means "hooligan" in Australian. Practically, "Hoon" is a short
11punchy name which search engines handle well.
12punchy name which search engines handle well.
12
13
13−This manual defines a practical Hoon subset we call Core Hoon.
14+Hoon has simple principles and a lot of details. To keep the
15+details from getting overwhelming, we start out learning a
16+simplified subset called Core Hoon. (Note that some of the
14−Some of the internal structures we present are simplified to
17+internal structures we show are simplified to match the subset.
15−reflect the Core subset.
18+These simplifications are corrected under Advanced Types.)
16
19
17−To read it for the first time, read these links in order:
20+To learn Hoon, traverse this tree in depth-first order:
18
21
19<list/>
22<list/>
20−
21−The Core manual is as terse as possible and written from a
22−top-down reference perspective. This will suit some and not others. For a
23−more narrative, bottom-up analysis, read [Deep Hoon](deep).
24−
docs/programming/core/demo.md+20−16
@@ -13,17 +13,18 @@ line is commented with its number:
13:gate end/atom :: 1
13:gate end/atom :: 1
14:var count 1 :: 2
14:var count 1 :: 2
15:loop :: 3
15:loop :: 3
16+:cast (list tape) :: 4
16−:if =(end count) :: 4
17+:if =(end count) :: 5
17− ~ :: 5
18+ ~ :: 6
18−:cons :: 6
19+:cons :: 7
19− :if =(0 (mod count 15)) :: 7
20+ :if =(0 (mod count 15)) :: 8
20− "FizzBuzz" :: 8
21+ "FizzBuzz" :: 9
21− :if =(0 (mod count 5)) :: 9
22+ :if =(0 (mod count 5)) :: 10
22− "Fizz" :: 10
23+ "Fizz" :: 11
23− :if =(0 (mod count 3)) :: 11
24+ :if =(0 (mod count 3)) :: 12
24− "Buzz" :: 12
25+ "Buzz" :: 13
25− (text :wrap(count)) :: 13
26+ (text :wrap(count)) :: 14
26−:moar(count (add 1 count)) :: 14
27+:moar(count (add 1 count)) :: 15
27```
28```
28
29
29Can you understand this code by just looking at it? Hopefully,
30Can you understand this code by just looking at it? Hopefully,
@@ -40,16 +41,19 @@ Line 2 declares a variable, `count`, with initial value `1`.
40
41
41Line 3 begins a loop.
42Line 3 begins a loop.
42
43
44+Line 4 casts the product of the loop to a list of `tape`
45+(string as a character list).
46+
43−Line 4 checks if `count` equals `end`. If so, line 5 (and the
47+Line 5 checks if `count` equals `end`. If so, line 6 (and the
44−whole loop) produces the value `~`, null. If not, line 6 begins
48+whole loop) produces the value `~`, null, the empty list. If
45−an ordered pair.
49+not, line 7 begins an ordered pair.
46
50
47The head of the pair is "FizzBuzz", or "Fizz", or "Buzz", if the
51The head of the pair is "FizzBuzz", or "Fizz", or "Buzz", if the
48−respective tests hit. If not, line 13 wraps a runtime type
52+respective tests hit. If not, line 14 wraps a runtime type
49around `count`, then prints the type-value pair to a string (like
53around `count`, then prints the type-value pair to a string (like
50C `sprintf()`). This string is the first item in the output list.
54C `sprintf()`). This string is the first item in the output list.
51
55
52−The tail of the pair is line 14, which repeats the loop (like
56+The tail of the pair is line 15, which repeats the loop (like
53Clojure `recur`), with `count` incremented. This list of strings
57Clojure `recur`), with `count` incremented. This list of strings
54is the rest of the output list.
58is the rest of the output list.
55
59
docs/using/install.md+3
@@ -51,6 +51,9 @@ Which can usually be installed with the following one-liners:
51 # FreeBSD
51 # FreeBSD
52 pkg install git gmake gmp libsigsegv openssl automake autoconf ragel cmake re2c libtool
52 pkg install git gmake gmp libsigsegv openssl automake autoconf ragel cmake re2c libtool
53
53
54+ # Arch
55+ pacman -S gcc gmp libsigsegv openssl automake autoconf ragel cmake re2c libtool ncurses
56+
54 # AWS
57 # AWS
55 sudo yum —enablerepo epel install gcc gcc-c++ git gmp-devel openssl-devel ncurses-devel libsigsegv-devel ctags automake autoconf libtool cmake re2c
58 sudo yum —enablerepo epel install gcc gcc-c++ git gmp-devel openssl-devel ncurses-devel libsigsegv-devel ctags automake autoconf libtool cmake re2c
56
59