diff --git a/docs/reference/dinfrirst.md b/docs/reference/dinfrirst.md index 0139037..4b945c1 100644 --- a/docs/reference/dinfrirst.md +++ b/docs/reference/dinfrirst.md @@ -2,28 +2,11 @@ ## dinfrirst -Basis Function Combinator +Combinator -dip infrst - -Gentzen diagram. +Specialist function (that means I forgot what it does and why.) ### Definition -if not basis. +> [dip] [infrst] -### Derivation - -if not basis. - -### Source - -if basis - -### Discussion - -Lorem ipsum. - -### Crosslinks - -Lorem ipsum. diff --git a/docs/reference/dip.md b/docs/reference/dip.md index 28fb88a..e94ffee 100644 --- a/docs/reference/dip.md +++ b/docs/reference/dip.md @@ -2,34 +2,38 @@ ## dip -Basis Function Combinator +Basis Combinator -The dip combinator expects a quoted program on the stack and below it +The `dip` combinator expects a quoted program on the stack and below it some item, it hoists the item into the expression and runs the program -on the rest of the stack. : +on the rest of the stack. - ... x [Q] dip - ------------------- - ... Q x - -Gentzen diagram. - -### Definition - -if not basis. - -### Derivation - -if not basis. - -### Source - -if basis + ... x [Q] . dip + --------------------- + ... . Q x ### Discussion -Lorem ipsum. +This along with [infra] are enough to update any datastructure. +See the ["Traversing Datastructures with Zippers" notebook](https://joypy.osdn.io/notebooks/Zipper.html). + +Note that the item that was on the top of the stack (`x` in the example above) +will not be treated specially by the interpreter when it is reached +again. This is something of a footgun. My advice is to avoid putting +bare unquoted symbols onto the stack, but then you can't use symbols as +"atoms" and also use `dip` and `infra` to operate on compound +datastructures with atoms in them. This is a kind of side-effect of the +Continuation-Passing Style. The `dip` combinator could "set aside" the +item and replace it after running `Q` but that means that there is an +"extra space" where the item resides while `Q` runs. One of the nice +things about CPS is that the whole state is recorded in the stack and +pending expression (not counting modifications to the dictionary.) ### Crosslinks -Lorem ipsum. +[dipd] +[dipdd] +[dupdip] +[dupdipd] +[infra] + diff --git a/docs/reference/dipd.md b/docs/reference/dipd.md index 72f2973..aae4e24 100644 --- a/docs/reference/dipd.md +++ b/docs/reference/dipd.md @@ -2,32 +2,22 @@ ## dipd -Basis Function Combinator +Combinator -Like dip but expects two items. : +Like [dip] but expects two items. - ... y x [Q] dip - --------------------- - ... Q y x - -Gentzen diagram. - -### Definition - -if not basis. - -### Derivation - -if not basis. - -### Source - -if basis + ... y x [Q] . dipd + ------------------------- + ... . Q y x ### Discussion -Lorem ipsum. +See [dip]. ### Crosslinks -Lorem ipsum. +[dip] +[dipdd] +[dupdip] +[dupdipd] +[infra] diff --git a/docs/reference/dipdd.md b/docs/reference/dipdd.md index de355b8..e373e9d 100644 --- a/docs/reference/dipdd.md +++ b/docs/reference/dipdd.md @@ -2,32 +2,22 @@ ## dipdd -Basis Function Combinator +Combinator -Like dip but expects three items. : - - ... z y x [Q] dip - ----------------------- - ... Q z y x - -Gentzen diagram. - -### Definition - -if not basis. - -### Derivation - -if not basis. - -### Source - -if basis +Like [dip] but expects three items. : + ... z y x [Q] . dip + ----------------------------- + ... . Q z y x ### Discussion -Lorem ipsum. +See [dip]. ### Crosslinks -Lorem ipsum. +[dip] +[dipd] +[dupdip] +[dupdipd] +[infra] + diff --git a/docs/reference/disenstacken.md b/docs/reference/disenstacken.md index 8a188e2..3fed85c 100644 --- a/docs/reference/disenstacken.md +++ b/docs/reference/disenstacken.md @@ -2,29 +2,28 @@ ## disenstacken -Basis Function Combinator +Function -The disenstacken operator expects a list on top of the stack and makes +The `disenstacken` function expects a list on top of the stack and makes that the stack discarding the rest of the stack. -Gentzen diagram. + 1 2 3 [4 5 6] disenstacken + -------------------------------- + 6 5 4 ### Definition -if not basis. - -### Derivation - -if not basis. - -### Source - -if basis +> \[[clear]\] [dip] [reverse] [unstack](#unstack) ### Discussion -Lorem ipsum. +Note that the order of the list is not changed, it just looks that way +because the stack is printed with the top on the right while lists are +printed with the top or head on the left. ### Crosslinks -Lorem ipsum. +[enstacken] +[stack] +[unstack](#unstack) + diff --git a/docs/reference/divmod.md b/docs/reference/divmod.md index 6e8a6da..528a3cd 100644 --- a/docs/reference/divmod.md +++ b/docs/reference/divmod.md @@ -2,30 +2,17 @@ ## divmod -Basis Function Combinator +Function -divmod(x, y) -\> (quotient, remainder) + x y divmod + ------------------ + q r + (x/y) (x%y) -Return the tuple (x//y, x%y). Invariant: q \* y + r == x. +Invariant: `qy + r = x`. -Gentzen diagram. ### Definition -if not basis. +> \[[floordiv]\] \[[mod]\] [clop] -### Derivation - -if not basis. - -### Source - -if basis - -### Discussion - -Lorem ipsum. - -### Crosslinks - -Lorem ipsum. diff --git a/docs/reference/down_to_zero.md b/docs/reference/down_to_zero.md index cda1d4c..c83c0f1 100644 --- a/docs/reference/down_to_zero.md +++ b/docs/reference/down_to_zero.md @@ -2,28 +2,22 @@ ## down_to_zero -Basis Function Combinator +Function -\[0 \>\] \[dup \--\] while +Given a number greater than zero put all the Natural numbers (including +zero) less than that onto the stack. -Gentzen diagram. +### Example + + 3 down_to_zero + -------------------- + 3 2 1 0 ### Definition -if not basis. - -### Derivation - -if not basis. - -### Source - -if basis - -### Discussion - -Lorem ipsum. +> \[0 \>\] \[[dup] [--]\] [while] ### Crosslinks -Lorem ipsum. +[range] + diff --git a/docs/reference/drop.md b/docs/reference/drop.md index f085d2b..e332e2a 100644 --- a/docs/reference/drop.md +++ b/docs/reference/drop.md @@ -2,35 +2,22 @@ ## drop -Basis Function Combinator - - drop == [rest] times +Function Expects an integer and a quote on the stack and returns the quote with n -items removed off the top. : +items removed off the top. - [a b c d] 2 drop +### Example + + [a b c d] 2 drop ---------------------- - [c d] - -Gentzen diagram. + [c d] ### Definition -if not basis. - -### Derivation - -if not basis. - -### Source - -if basis - -### Discussion - -Lorem ipsum. +> \[[rest]\] [times] ### Crosslinks -Lorem ipsum. +[take] + diff --git a/docs/reference/dup.md b/docs/reference/dup.md index 8d34e93..69c1369 100644 --- a/docs/reference/dup.md +++ b/docs/reference/dup.md @@ -2,28 +2,18 @@ ## dup -Basis Function Combinator +Basis Function - (a1 -- a1 a1) +"Dup"licate the top item on the stack. -Gentzen diagram. - -### Definition - -if not basis. - -### Derivation - -if not basis. - -### Source - -if basis - -### Discussion - -Lorem ipsum. + a dup + ----------- + a a ### Crosslinks -Lorem ipsum. +[dupd] +[dupdd] +[dupdip] +[dupdipd] + diff --git a/docs/reference/dupd.md b/docs/reference/dupd.md index 4190c23..df2c6b0 100644 --- a/docs/reference/dupd.md +++ b/docs/reference/dupd.md @@ -2,28 +2,22 @@ ## dupd -Basis Function Combinator +Function - (a2 a1 -- a2 a2 a1) +[dup] the second item down on the stack. -Gentzen diagram. + a b dupd + -------------- + a a b ### Definition -if not basis. - -### Derivation - -if not basis. - -### Source - -if basis - -### Discussion - -Lorem ipsum. +> \[[dup]\] [dip] ### Crosslinks -Lorem ipsum. +[dup] +[dupdd] +[dupdip] +[dupdipd] + diff --git a/docs/reference/dupdd.md b/docs/reference/dupdd.md index ad3d58a..5f4f495 100644 --- a/docs/reference/dupdd.md +++ b/docs/reference/dupdd.md @@ -2,28 +2,22 @@ ## dupdd -Basis Function Combinator +Function - (a3 a2 a1 -- a3 a3 a2 a1) +[dup] the third item down on the stack. -Gentzen diagram. + a b c dupdd + ----------------- + a a b c ### Definition -if not basis. - -### Derivation - -if not basis. - -### Source - -if basis - -### Discussion - -Lorem ipsum. +> \[[dup]\] [dipd] ### Crosslinks -Lorem ipsum. +[dup] +[dupd] +[dupdip] +[dupdipd] + diff --git a/docs/reference/dupdip.md b/docs/reference/dupdip.md index 131b568..38a138b 100644 --- a/docs/reference/dupdip.md +++ b/docs/reference/dupdip.md @@ -2,33 +2,32 @@ ## dupdip -Basis Function Combinator +Combinator - [F] dupdip == dup [F] dip +Apply a function `F` and [dup] the item under it on the stack. - ... a [F] dupdip - ... a dup [F] dip - ... a a [F] dip - ... a F a - -Gentzen diagram. + a [F] dupdip + ------------------ + a F a ### Definition -if not basis. +> [dupd] [dip] ### Derivation -if not basis. - -### Source - -if basis + a [F] dupdip + a [F] dupd dip + a [F] [dup] dip dip + a dup [F] dip + a a [F] dip + a F a ### Discussion -Lorem ipsum. +A very common and useful combinator. ### Crosslinks -Lorem ipsum. +[dupdipd] + diff --git a/docs/reference/dupdipd.md b/docs/reference/dupdipd.md index 30aa73d..1d28291 100644 --- a/docs/reference/dupdipd.md +++ b/docs/reference/dupdipd.md @@ -2,28 +2,19 @@ ## dupdipd -Basis Function Combinator +Combinator -dup dipd +Run a copy of program `F` under the next item down on the stack. -Gentzen diagram. + a [F] dupdipd + ------------------- + F a [F] ### Definition -if not basis. - -### Derivation - -if not basis. - -### Source - -if basis - -### Discussion - -Lorem ipsum. +> [dup] [dipd] ### Crosslinks -Lorem ipsum. +[dupdip] + diff --git a/docs/reference/mkref/FuncRef.html b/docs/reference/mkref/FuncRef.html index c9d424d..ef560ac 100644 --- a/docs/reference/mkref/FuncRef.html +++ b/docs/reference/mkref/FuncRef.html @@ -866,295 +866,248 @@ cond
Basis Function Combinator
-dip infrst
-Gentzen diagram.
+Combinator
+Specialist function (that means I forgot what it does and why.)
if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
++ +
Basis Function Combinator
-The dip combinator expects a quoted program on the stack and below it some item, it hoists the item into the expression and runs the program on the rest of the stack. :
-... x [Q] dip
--------------------
- ... Q x
-Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
+Basis Combinator
+The dip combinator expects a quoted program on the stack and below it some item, it hoists the item into the expression and runs the program on the rest of the stack.
... x [Q] . dip
+---------------------
+ ... . Q x
+This along with infra are enough to update any datastructure. See the “Traversing Datastructures with Zippers” notebook.
+Note that the item that was on the top of the stack (x in the example above) will not be treated specially by the interpreter when it is reached again. This is something of a footgun. My advice is to avoid putting bare unquoted symbols onto the stack, but then you can’t use symbols as “atoms” and also use dip and infra to operate on compound datastructures with atoms in them. This is a kind of side-effect of the Continuation-Passing Style. The dip combinator could “set aside” the item and replace it after running Q but that means that there is an “extra space” where the item resides while Q runs. One of the nice things about CPS is that the whole state is recorded in the stack and pending expression (not counting modifications to the dictionary.)
dipd dipdd dupdip dupdipd infra
Basis Function Combinator
-Like dip but expects two items. :
-... y x [Q] dip
----------------------
- ... Q y x
-Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
+Combinator
+Like dip but expects two items.
+ ... y x [Q] . dipd
+-------------------------
+ ... . Q y x
+See dip.
+dip dipdd dupdip dupdipd infra
Basis Function Combinator
-Like dip but expects three items. :
-... z y x [Q] dip
------------------------
- ... Q z y x
-Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
+Combinator
+Like dip but expects three items. :
+ ... z y x [Q] . dip
+-----------------------------
+ ... . Q z y x
+See dip.
+Basis Function Combinator
-The disenstacken operator expects a list on top of the stack and makes that the stack discarding the rest of the stack.
-Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
+Function
+The disenstacken function expects a list on top of the stack and makes that the stack discarding the rest of the stack.
1 2 3 [4 5 6] disenstacken
+--------------------------------
+ 6 5 4
++ ++
Note that the order of the list is not changed, it just looks that way because the stack is printed with the top on the right while lists are printed with the top or head on the left.
+See floordiv.
Basis Function Combinator
-divmod(x, y) -> (quotient, remainder)
-Return the tuple (x//y, x%y). Invariant: q * y + r == x.
-Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
+Function
+ x y divmod
+------------------
+ q r
+ (x/y) (x%y)
+Invariant: qy + r = x.
+ +
Basis Function Combinator
-[0 >] [dup --] while
-Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
+Function
+Given a number greater than zero put all the Natural numbers (including zero) less than that onto the stack.
+ 3 down_to_zero
+--------------------
+ 3 2 1 0
++ ++
Basis Function Combinator
-drop == [rest] times
-Expects an integer and a quote on the stack and returns the quote with n items removed off the top. :
-[a b c d] 2 drop
+Function
+Expects an integer and a quote on the stack and returns the quote with n items removed off the top.
+Example
+ [a b c d] 2 drop
----------------------
- [c d]
-Gentzen diagram.
-Definition
-if not basis.
-Derivation
-if not basis.
-Source
-if basis
-Discussion
-Lorem ipsum.
-Crosslinks
-Lorem ipsum.
+ [c d]
++ ++
Basis Function Combinator
-(a1 -- a1 a1)
-Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
+Basis Function
+“Dup”licate the top item on the stack.
+ a dup
+-----------
+ a a
+Basis Function Combinator
-(a2 a1 -- a2 a2 a1)
-Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
+Function
+dup the second item down on the stack.
+ a b dupd
+--------------
+ a a b
++ ++
Basis Function Combinator
-(a3 a2 a1 -- a3 a3 a2 a1)
-Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
+Function
+dup the third item down on the stack.
+ a b c dupdd
+-----------------
+ a a b c
++ ++
Basis Function Combinator
-[F] dupdip == dup [F] dip
-
-... a [F] dupdip
-... a dup [F] dip
-... a a [F] dip
-... a F a
-Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
+Combinator
+Apply a function F and dup the item under it on the stack.
a [F] dupdip
+------------------
+ a F a
++ ++
a [F] dupdip
+a [F] dupd dip
+a [F] [dup] dip dip
+a dup [F] dip
+a a [F] dip
+a F a
+A very common and useful combinator.
+Basis Function Combinator
-dup dipd
-Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
+Combinator
+Run a copy of program F under the next item down on the stack.
a [F] dupdipd
+-------------------
+ F a [F]
++ ++
Basis Function Combinator
stack [clear] dip
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
([a1 ...1] -- a1)
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Basis Function Combinator
([a1 a2 ...1] -- a1 a2)
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Basis Function Combinator
<{} [concat] step
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Return the floor of x as an Integral.
This is the largest integer <= x.
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
[i] app2
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Basis Function Combinator
([a1 a2 a3 a4 ...1] -- a4)
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Basis Function Combinator
true [tuck mod dup 0 >] loop pop
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Basis Function Combinator
Compiled GCD function.
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.
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Basis Function Combinator
<{} [cons] times
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Basis Function Combinator
[stack popd] dip
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
Accepts a quoted symbol on the top of the stack and prints its docs.
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Basis Function Combinator
[sqr] ii + sqrt
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
[Q] i
-----------
Q
-combo(i, [list(P)|S], S, Ei, Eo) :- append(P, Ei, Eo).
-This is probably the fundamental combinator. You wind up using it in all kinds of places (for example, the x combinator can be defined as dup i.)
Basis Function Combinator
The identity function.
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Has the effect of grabbing a copy of the stack on which to run the if-part using infra.
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
... [a b c] [Q] infra
---------------------------
c b a Q [...] swaack
-swons swaack [i] dip swaack
-This is one of the more useful combinators. It allows a quoted expression to serve as a stack for a program, effectively running it in a kind of “pocket universe”. If the list represents a datastructure then infra lets you work on its internal structure.
Basis Function Combinator
infra first
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
[sqr dup mul] inscribe
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.
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.
Basis Function Combinator
[codireco] ccons
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Basis 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.
Basis Function Combinator
Given a list find the maximum.
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Basis Function Combinator
Given a list find the minimum.
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.
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.
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Basis Function Combinator
Same as not a.
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
0 >=
Basis Function Combinator
[nullary] cons
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
... [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.
Basis Function Combinator
Same as a | b.
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Basis Function Combinator
(a2 a1 -- a2 a1 a2)
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Basis Function Combinator
[i] map
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Basis Function Combinator
(a1 --)
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Basis Function Combinator
(a2 a1 -- a1)
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Basis Function Combinator
(a3 a2 a1 -- a2 a1)
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Basis Function Combinator
(a2 a1 --)
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Basis Function Combinator
(a3 a2 a1 -- a1)
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Basis Function Combinator
(a4 a3 a2 a1 -- a2 a1)
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Basis Function Combinator
pop popop
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
Decrement TOS.
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Basis Function Combinator
1 swap [*] step
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Basis Function Combinator
[unit] dip
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Basis Function Combinator
[0 <=] [1 - dup] anamorphism
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Basis Function Combinator
unit [down_to_zero] infra
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Basis Function Combinator
rest cons
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Basis Function Combinator
([a1 ...0] -- [...0])
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Reverse 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.
Basis Function Combinator
(a1 a2 a3 -- a2 a3 a1)
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Basis Function Combinator
(a1 a2 a3 -- a3 a1 a2)
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Round 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.
Basis Function Combinator
([a1 a2 ...1] -- [...1])
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
<{} infra
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Basis Function Combinator
([a1 a2 ...1] -- a2)
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
The 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.
Basis Function Combinator
Print redistribution information.
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Basis Function Combinator
uncons [swons] dip
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Basis Function Combinator
[pop ++] step_zero
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Basis Function Combinator
Given a list return it sorted.
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Basis Function Combinator
[[[abs] ii <=] [[<>] [pop !-] ||] &&] [[!-] [[++]] [[--]] ifte dip] [[pop !-] [--] [++] ifte] ifte
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Basis Function Combinator
[drop] [take] clop
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Basis Function Combinator
[take reverse] [drop] clop
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Basis Function Combinator
dup *
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Basis 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.
Basis Function Combinator
(... -- ... [...])
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Basis Function Combinator
[stack] dip
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
The 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.
Basis Function Combinator
0 roll> step
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Basis Function Combinator
(... a1 -- ... a1 a1 [...])
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Basis Function Combinator
(... a2 a1 -- ... a2 a1 a1 a2 [...])
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
Increment TOS.
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Given 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.
Basis Function Combinator
([...1] -- [...0])
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Basis Function Combinator
(a1 a2 -- a2 a1)
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Basis Function Combinator
[swap] dip
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Basis Function Combinator
swap concat
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Basis Function Combinator
([...1] a1 -- [a1 ...1])
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Basis Function Combinator
[i] genrec
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
... 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.
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Basis Function Combinator
(a2 a1 -- a1 a2 a1)
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
... 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.
Basis Function Combinator
(a1 -- [a1 ])
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Basis Function Combinator
[i] dip
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Basis Function Combinator
([a1 ...1] -- [...1] a1)
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Basis 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.
Basis Function Combinator
Print warranty information.
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Basis Function Combinator
swap nulco dupdipd concat loop
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
Basis Function Combinator
Print all the words in alphabetical order.
Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
[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.
Basis 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.