diff --git a/docs/reference/le.md b/docs/reference/le.md index 9b9d5a5..cc95121 100644 --- a/docs/reference/le.md +++ b/docs/reference/le.md @@ -2,28 +2,22 @@ ## le -Basis Function Combinator +Basis Function -Same as a \<= b. -Gentzen diagram. +Less-Than-or-Equal-to comparison of the two items on the top of the +stack, replacing them with a Boolean value. -### Definition - -if not basis. - -### Derivation - -if not basis. - -### Source - -if basis - -### Discussion - -Lorem ipsum. + a b eq + ------------- + Boolean + (a <= b) ### Crosslinks -Lorem ipsum. +[cmp] +[eq] +[ge] +[gt] +[lt] +[ne] diff --git a/docs/reference/loop.md b/docs/reference/loop.md index fa661fa..c6a6cf5 100644 --- a/docs/reference/loop.md +++ b/docs/reference/loop.md @@ -2,36 +2,35 @@ ## loop -Basis Function Combinator +Basis Combinator -Basic loop combinator. : +Expect a quoted program `Q` and a Boolean value on the stack. If the value is false +discard the quoted program, otherwise run a copy of `Q` and `loop` again. - ... True [Q] loop - ----------------------- - ... Q [Q] loop + false [Q] loop + -------------------- - ... False [Q] loop - ------------------------ - ... -Gentzen diagram. - -### Definition - -if not basis. - -### Derivation - -if not basis. - -### Source - -if basis + true [Q] . loop + -------------------------- + . Q [Q] loop ### Discussion -Lorem ipsum. +This, along with [branch] and [fork], is one of the four main combinators +of all programming. The fourth, sequence, is implied by juxtaposition. +That is to say, in Joy `F G` is like `G(F(...))` in a language bassed on +function application. Or again, to quote the [Joy Wikipedia +entry](https://en.wikipedia.org/wiki/Joy_(programming_language)#Mathematical_purity), + +> In Joy, the meaning function is a homomorphism from the syntactic monoid onto the semantic monoid. That is, the syntactic relation of concatenation of symbols maps directly onto the semantic relation of composition of functions. + +Anyway, [branch], [fork], amd [loop] are the fundamental combinators in Joy. +Just as [branch] has it's more common and convenient form [ifte], +[loop] has [while]. ### Crosslinks -Lorem ipsum. +[branch] +[fork] +[while] diff --git a/docs/reference/mkref/FuncRef.html b/docs/reference/mkref/FuncRef.html index c78dba0..33010a3 100644 --- a/docs/reference/mkref/FuncRef.html +++ b/docs/reference/mkref/FuncRef.html @@ -1375,8 +1375,37 @@ a F a
This is the only function that modifies the dictionary. It’s provided as a convenience, for tinkering with new definitions before entering them into the defs.txt file. It can be abused, which you should avoid unless you know what you’re doing.
Basis Function
+Less-Than-or-Equal-to comparison of the two items on the top of the stack, replacing them with a Boolean value.
+ a b eq
+-------------
+ Boolean
+ (a <= b)
+Basis Combinator
+Expect a quoted program Q and a Boolean value on the stack. If the value is false discard the quoted program, otherwise run a copy of Q and loop again.
false [Q] loop
+--------------------
+
+
+ true [Q] . loop
+--------------------------
+ . Q [Q] loop
+This, along with branch and fork, is one of the four main combinators of all programming. The fourth, sequence, is implied by juxtaposition. That is to say, in Joy F G is like G(F(...)) in a language bassed on function application. Or again, to quote the Joy Wikipedia entry,
++In Joy, the meaning function is a homomorphism from the syntactic monoid onto the semantic monoid. That is, the syntactic relation of concatenation of symbols maps directly onto the semantic relation of composition of functions.
+
Anyway, branch, fork, amd loop are the fundamental combinators in Joy. Just as branch has it’s more common and convenient form ifte, loop has while.
+Basis Function Combinator
-Same as a <= b.
+Same as a << b.
Gentzen diagram.
if not basis.
@@ -1384,45 +1413,8 @@ a F aif not basis.
if basis
-Lorem ipsum.
-Lorem ipsum.
-Basis Function Combinator
-Basic loop combinator. :
-... True [Q] loop
------------------------
- ... Q [Q] loop
-
-... False [Q] loop
-------------------------
- ...
-Gentzen diagram.
-if not basis.
-if not basis.
-if basis
Lorem ipsum.
-Lorem ipsum.
-Basis Function Combinator
-Same as a << b.
-Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
Basis Function Combinator
Same as a < b.
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -1445,13 +1437,13 @@ a F aBasis Function Combinator
[codireco] ccons
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -1460,13 +1452,13 @@ a F aBasis Function Combinator
Run the quoted program on TOS on the items in the list under it, push a new list with the results in place of the program and original list.
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -1475,13 +1467,13 @@ a F aBasis Function Combinator
Given a list find the maximum.
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -1490,13 +1482,13 @@ a F aBasis Function Combinator
Given a list find the minimum.
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -1505,13 +1497,13 @@ a F aBasis Function Combinator
Same as a % b.
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -1523,13 +1515,13 @@ a F aBasis Function Combinator
Same as a * b.
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -1538,13 +1530,13 @@ a F aBasis Function Combinator
Same as a != b.
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -1553,13 +1545,13 @@ a F aBasis Function Combinator
Same as -a.
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -1568,13 +1560,13 @@ a F aBasis Function Combinator
Same as not a.
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -1590,20 +1582,20 @@ a F a N !- ---------- N >= 0 true -0 >=
Basis Function Combinator
[nullary] cons
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -1614,16 +1606,16 @@ a F a ... [P] nullary
---------------------
... A
-[stack] dip infra first
-... [P] nullary
... [P] [stack] dip infra first
... stack [P] infra first
... [...] [P] infra first
... [A ...] first
... A
-A very useful function that runs any other quoted function and returns it’s first result without disturbing the stack (under the quoted program.)
Basis Function Combinator
swap at
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -1647,13 +1639,13 @@ a F aBasis Function Combinator
Same as a | b.
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -1662,13 +1654,13 @@ a F aBasis Function Combinator
(a2 a1 -- a2 a1 a2)
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -1677,13 +1669,13 @@ a F aBasis Function Combinator
[i] map
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -1698,13 +1690,13 @@ a F a ------------- a+b a-bGentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -1713,13 +1705,13 @@ a+b a-bBasis Function Combinator
(a1 --)
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -1728,13 +1720,13 @@ a+b a-bBasis Function Combinator
(a2 a1 -- a1)
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -1743,13 +1735,13 @@ a+b a-bBasis Function Combinator
(a3 a2 a1 -- a2 a1)
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -1758,13 +1750,13 @@ a+b a-bBasis Function Combinator
(a2 a1 --)
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -1773,13 +1765,13 @@ a+b a-bBasis Function Combinator
(a3 a2 a1 -- a1)
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -1788,13 +1780,13 @@ a+b a-bBasis Function Combinator
(a4 a3 a2 a1 -- a2 a1)
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -1803,13 +1795,13 @@ a+b a-bBasis Function Combinator
pop popop
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -1818,13 +1810,13 @@ a+b a-bBasis Function Combinator
Same as a ** b.
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -1833,13 +1825,13 @@ a+b a-bBasis Function Combinator
Decrement TOS.
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -1860,13 +1852,13 @@ a+b a-b ------------------------------------------ n > 0 n (n-1) [Base] [Recur] primrec RecurGentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -1875,13 +1867,13 @@ a+b a-bBasis Function Combinator
1 swap [*] step
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -1890,13 +1882,13 @@ a+b a-bBasis Function Combinator
[unit] dip
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -1905,13 +1897,13 @@ a+b a-bBasis Function Combinator
[0 <=] [1 - dup] anamorphism
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -1920,13 +1912,13 @@ a+b a-bBasis Function Combinator
unit [down_to_zero] infra
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -1935,13 +1927,13 @@ a+b a-bBasis Function Combinator
rest cons
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -1959,13 +1951,13 @@ a+b a-b ------------------------ [2 3 1]Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -1974,13 +1966,13 @@ a+b a-bBasis Function Combinator
([a1 ...0] -- [...0])
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -1990,13 +1982,13 @@ a+b a-bReverse the list on the top of the stack. :
reverse == [] swap shunt
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -2005,13 +1997,13 @@ a+b a-bBasis Function Combinator
(a1 a2 a3 -- a2 a3 a1)
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -2020,13 +2012,13 @@ a+b a-bBasis Function Combinator
(a1 a2 a3 -- a3 a1 a2)
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -2042,13 +2034,13 @@ a+b a-bRound a number to a given precision in decimal digits.
The return value is an integer if ndigits is omitted or None. Otherwise the return value has the same type as the number. ndigits may be negative.
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -2057,13 +2049,13 @@ a+b a-bBasis Function Combinator
([a1 a2 ...1] -- [...1])
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -2072,13 +2064,13 @@ a+b a-bBasis Function Combinator
Same as a >> b.
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -2087,13 +2079,13 @@ a+b a-bBasis Function Combinator
<{} infra
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -2102,13 +2094,13 @@ a+b a-bBasis Function Combinator
([a1 a2 ...1] -- a2)
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -2126,13 +2118,13 @@ a+b a-b BThe sequence can contain more than two items but not fewer. Currently Python semantics are used to evaluate the "truthiness" of the Boolean value (so empty string, zero, etc. are counted as false, etc.)
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -2141,13 +2133,13 @@ a+b a-bBasis Function Combinator
Print redistribution information.
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -2156,13 +2148,13 @@ a+b a-bBasis Function Combinator
uncons [swons] dip
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -2176,13 +2168,13 @@ a+b a-b --------------------------- [f e d a b c]Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -2191,13 +2183,13 @@ a+b a-bBasis Function Combinator
[pop ++] step_zero
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -2206,13 +2198,13 @@ a+b a-bBasis Function Combinator
Given a list return it sorted.
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -2221,13 +2213,13 @@ a+b a-bBasis Function Combinator
[[[abs] ii <=] [[<>] [pop !-] ||] &&] [[!-] [[++]] [[--]] ifte dip] [[pop !-] [--] [++] ifte] ifte
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -2236,13 +2228,13 @@ a+b a-bBasis Function Combinator
[drop] [take] clop
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -2251,13 +2243,13 @@ a+b a-bBasis Function Combinator
[take reverse] [drop] clop
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -2266,13 +2258,13 @@ a+b a-bBasis Function Combinator
dup *
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -2281,13 +2273,13 @@ a+b a-bBasis Function Combinator
Return the square root of the number a. Negative numbers return complex roots.
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -2296,13 +2288,13 @@ a+b a-bBasis Function Combinator
(... -- ... [...])
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -2311,13 +2303,13 @@ a+b a-bBasis Function Combinator
[stack] dip
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -2340,13 +2332,13 @@ a+b a-b ... a . Q [b c] [Q] stepThe step combinator executes the quotation on each member of the list on top of the stack.
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -2355,13 +2347,13 @@ a+b a-bBasis Function Combinator
0 roll> step
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -2370,13 +2362,13 @@ a+b a-bBasis Function Combinator
(... a1 -- ... a1 a1 [...])
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -2385,13 +2377,13 @@ a+b a-bBasis Function Combinator
(... a2 a1 -- ... a2 a1 a1 a2 [...])
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -2400,13 +2392,13 @@ a+b a-bBasis Function Combinator
Same as a - b.
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -2415,13 +2407,13 @@ a+b a-bBasis Function Combinator
Increment TOS.
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -2431,13 +2423,13 @@ a+b a-bGiven a quoted sequence of numbers return the sum. :
sum == 0 swap [+] step
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -2446,13 +2438,13 @@ a+b a-bBasis Function Combinator
([...1] -- [...0])
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -2461,13 +2453,13 @@ a+b a-bBasis Function Combinator
(a1 a2 -- a2 a1)
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -2476,13 +2468,13 @@ a+b a-bBasis Function Combinator
[swap] dip
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -2491,13 +2483,13 @@ a+b a-bBasis Function Combinator
swap concat
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -2506,13 +2498,13 @@ a+b a-bBasis Function Combinator
([...1] a1 -- [a1 ...1])
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -2521,13 +2513,13 @@ a+b a-bBasis Function Combinator
[i] genrec
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -2539,13 +2531,13 @@ a+b a-b ---------------------- [b a]Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -2556,9 +2548,9 @@ a+b a-b ... z y x [P] unary
-------------------------
... A
-binary popd
-Runs any other quoted function and returns its first result while consuming exactly three items from the stack.
Basis Function Combinator
([a1 a2 a3 ...1] -- a3)
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -2595,13 +2587,13 @@ a+b a-b ------------------------------------- w/ n > 1 ... . Q (n - 1) [Q] timesGentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -2613,13 +2605,13 @@ a+b a-bBasis Function Combinator
(a2 a1 -- a1 a2 a1)
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -2630,9 +2622,9 @@ a+b a-b ... x [P] unary
---------------------
... A
-nullary popd
-Runs any other quoted function and returns its first result while consuming exactly one item from the stack.
[A ...] uncons
--------------------
A [...]
-func(uncons, Si, So) :- func(cons, So, Si).
-This is the inverse of cons.
Basis Function Combinator
Given a list remove duplicate items.
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -2669,13 +2661,13 @@ a+b a-bBasis Function Combinator
(a1 -- [a1 ])
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -2684,13 +2676,13 @@ a+b a-bBasis Function Combinator
[i] dip
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -2699,13 +2691,13 @@ a+b a-bBasis Function Combinator
([a1 ...1] -- [...1] a1)
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -2714,13 +2706,13 @@ a+b a-bBasis Function Combinator
True if the form on TOS is void otherwise False.
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -2729,13 +2721,13 @@ a+b a-bBasis Function Combinator
Print warranty information.
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -2744,13 +2736,13 @@ a+b a-bBasis Function Combinator
swap nulco dupdipd concat loop
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -2759,13 +2751,13 @@ a+b a-bBasis Function Combinator
Print all the words in alphabetical order.
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -2775,22 +2767,22 @@ a+b a-b [F] x
-----------
[F] F
-dup i
-The x combinator …
Basis Function Combinator
Same as a ^ b.
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
@@ -2799,13 +2791,13 @@ a+b a-bBasis Function Combinator
Replace the two lists on the top of the stack with a list of the pairs from each list. The smallest list sets the length of the result list.
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
Lorem ipsum.
diff --git a/docs/reference/mkref/Functor-Reference.md b/docs/reference/mkref/Functor-Reference.md index 68e8111..e4d42cd 100644 --- a/docs/reference/mkref/Functor-Reference.md +++ b/docs/reference/mkref/Functor-Reference.md @@ -2024,69 +2024,62 @@ know what you're doing. ## le -Basis Function Combinator +Basis Function -Same as a \<= b. -Gentzen diagram. +Less-Than-or-Equal-to comparison of the two items on the top of the +stack, replacing them with a Boolean value. -### Definition - -if not basis. - -### Derivation - -if not basis. - -### Source - -if basis - -### Discussion - -Lorem ipsum. + a b eq + ------------- + Boolean + (a <= b) ### Crosslinks -Lorem ipsum. +[cmp] +[eq] +[ge] +[gt] +[lt] +[ne] ------------------------------------------------------------------------ ## loop -Basis Function Combinator +Basis Combinator -Basic loop combinator. : +Expect a quoted program `Q` and a Boolean value on the stack. If the value is false +discard the quoted program, otherwise run a copy of `Q` and `loop` again. - ... True [Q] loop - ----------------------- - ... Q [Q] loop + false [Q] loop + -------------------- - ... False [Q] loop - ------------------------ - ... -Gentzen diagram. - -### Definition - -if not basis. - -### Derivation - -if not basis. - -### Source - -if basis + true [Q] . loop + -------------------------- + . Q [Q] loop ### Discussion -Lorem ipsum. +This, along with [branch] and [fork], is one of the four main combinators +of all programming. The fourth, sequence, is implied by juxtaposition. +That is to say, in Joy `F G` is like `G(F(...))` in a language bassed on +function application. Or again, to quote the [Joy Wikipedia +entry](https://en.wikipedia.org/wiki/Joy_(programming_language)#Mathematical_purity), + +> In Joy, the meaning function is a homomorphism from the syntactic monoid onto the semantic monoid. That is, the syntactic relation of concatenation of symbols maps directly onto the semantic relation of composition of functions. + +Anyway, [branch], [fork], amd [loop] are the fundamental combinators in Joy. +Just as [branch] has it's more common and convenient form [ifte], +[loop] has [while]. ### Crosslinks -Lorem ipsum. +[branch] +[fork] +[while] ------------------------------------------------------------------------