diff --git a/docs/reference/mkref/FuncRef.html b/docs/reference/mkref/FuncRef.html index 8a1cada..7a4565d 100644 --- a/docs/reference/mkref/FuncRef.html +++ b/docs/reference/mkref/FuncRef.html @@ -2082,273 +2082,212 @@ a F a
Basis Function Combinator
-dup *
-Gentzen diagram.
+Function
+Square the number on the top of the stack.
+ n sqr
+------------
+ n²
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.
+Another “numeric tower” hatch…
Basis Function Combinator
-(... -- ... [...])
-Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
+Function
+Put the stack onto the stack.
+ ... c b a stack
+---------------------------
+ ... c b a [a b c ...]
++ ++
This function forms a pair with [unstack], and together they form the complement to the “destructive” pair enstacken and disenstacken.
+[unstack] enstacken disenstacken
Basis Function Combinator
-[stack] dip
-Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
+Function
+Grab the stack under the top item and put it onto the stack.
+ ... 1 2 3 stackd
+------------------------
+ ... 1 2 [2 1 ...] 3
++ +
Basis Function Combinator
-Run a quoted program on each item in a sequence. :
-... [] [Q] . step
------------------------
- ... .
+Combinator
+Run a quoted program on each item in a sequence.
+ ... [] [Q] step
+---------------------
+ ...
-... [a] [Q] . step
-------------------------
- ... a . Q
+ ... [a] [Q] step
+----------------------
+ ... a Q
-... [a b c] [Q] . step
+ ... [a b c] [Q] . step
----------------------------------------
- ... a . Q [b c] [Q] step
-The step combinator executes the quotation on each member of the list on top of the stack.
-Gentzen diagram.
-Definition
-if not basis.
-Derivation
-if not basis.
-Source
-if basis
-Discussion
-Lorem ipsum.
-Crosslinks
-Lorem ipsum.
+ ... a . Q [b c] [Q] step
+See the Recursion Combinators notebook.
+Basis Function Combinator
-0 roll> step
-Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
+Combinator
+Like step but with 0 as the initial value.
+ [...] [F] step_zero
+-------------------------
+ 0 [...] [F] step
++ ++
size and sum can both be defined in terms of this specialization of step.
+Basis Function Combinator
-(... a1 -- ... a1 a1 [...])
-Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
+Function
+Take the stack and uncons the top item.
+ 1 2 3 stuncons
+--------------------
+ 1 2 3 3 [2 1]
++ +
Basis Function Combinator
-(... a2 a1 -- ... a2 a1 a1 a2 [...])
-Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
+Function
+Take the stack and uncons the top two items.
+ 1 2 3 stununcons
+----------------------
+ 1 2 3 3 2 [1]
++ ++
Basis Function Combinator
-Same as a - b.
-Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
+Basis Function
+Subtract the number on the top of the stack from the number below it.
+ a b sub
+-------------
+ (a-b)
+Basis Function Combinator
-Increment TOS.
-Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
+Function
+Successor. Increment TOS.
+++1 +
+
Basis Function Combinator
-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.
+Combinator
+Given a quoted sequence of numbers return the sum.
+ [1 2 3 4 5] sum
+---------------------
+ 15
+++[+] step_zero
+
Basis Function Combinator
-([...1] -- [...0])
-Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
+Basis Function
+Swap stack. Take a list from the top of the stack, replace the stack with the list, and put the old stack onto it.
+ 1 2 3 [4 5 6] swaack
+--------------------------
+ 6 5 4 [3 2 1]
+This function works as a kind of “context switch”. It’s used in the definition of infra.
+Basis Function Combinator
-(a1 a2 -- a2 a1)
-Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
+Basis Function
+Swap the top two items on the stack.
+ a b swap
+--------------
+ b a
+Basis Function Combinator
-[swap] dip
-Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
+Function
+Swap the second and third items on the stack.
+ a b c swapd
+-----------------
+ b a c
++ ++
Basis Function Combinator
-swap concat
-Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
+Function
+concat two lists, but swap the lists first.
++ ++
Basis Function Combinator
-([...1] a1 -- [a1 ...1])
-Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
+Function
+Like cons but swap the item and list.
+ [...] a swons
+-------------------
+ [a ...]
++ +
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.