diff --git a/docs/reference/mkref/FuncRef.html b/docs/reference/mkref/FuncRef.html index a827cc5..9d4e444 100644 --- a/docs/reference/mkref/FuncRef.html +++ b/docs/reference/mkref/FuncRef.html @@ -1622,276 +1622,233 @@ a F a
Basis Function Combinator
-[i] map
-Gentzen diagram.
+Combinator
+Take a list of quoted functions from the stack and replace it with a list of the first results from running those functions (on copies of the rest of the stack.)
+ 5 7 [[+][-][*][/][%]] pam
+-------------------------------
+ 5 7 [12 -2 35 0 5]
if not basis.
-if not basis.
-if basis
++ +
Lorem ipsum.
+A specialization of map that runs a list of functions in parallel (if the underlying map function is so implemented, of course.)
Lorem ipsum.
+See getitem.
Basis Function Combinator
-Plus or minus :
-a b pm
--------------
-a+b a-b
-Gentzen diagram.
+Function
+Plus or minus. Replace two numbers with their sum and difference.
+ a b pm
+-----------------
+ (a+b) (a-b)
if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
++[+] [-] clop
+
Basis Function Combinator
-(a1 --)
-Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
+Basis Function
+Pop the top item from the stack and discard it.
+ a pop
+-----------
+popd popdd popop popopd popopdd popopop
Basis Function Combinator
-(a2 a1 -- a1)
-Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
+Function
+pop the second item down on the stack.
+ a b popd
+--------------
+ b
++ ++
pop popdd popop popopd popopdd popopop
Basis Function Combinator
-(a3 a2 a1 -- a2 a1)
-Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
+Function
+pop the third item on the stack.
+ a b c popdd
+-----------------
+ b c
++ ++
pop popd popop popopd popopdd popopop
Basis Function Combinator
-(a2 a1 --)
-Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
+Function
+pop two items from the stack.
+ a b popop
+---------------
++ ++
pop popd popdd popopd popopdd popopop
Basis Function Combinator
-(a3 a2 a1 -- a1)
-Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
+Function
+pop the second and third items from the stack.
+ a b c popopd
+------------------
+ c
++ ++
pop popd popdd popop popopdd popopop
Basis Function Combinator
-(a4 a3 a2 a1 -- a2 a1)
-Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
+Function
+ a b c d popopdd
+---------------------
+ c d
++ ++
pop popd popdd popop popopd popopop
Basis Function Combinator
-pop popop
-Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
+Function
+pop three items from the stack.
+ a b c popopop
+-------------------
++ ++
pop popd popdd popop popopd popopdd
Basis Function Combinator
-Same as a ** b.
-Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
+Basis Function
+Take two numbers a and b from the stack and raise a to the nth power. (b is on the top of the stack.)
a n pow
+-------------
+ (aⁿ)
+ 2 [2 3 4 5 6 7 8 9] [pow] map
+-----------------------------------
+ 2 [4 8 16 32 64 128 256 512]
Basis Function Combinator
-Decrement TOS.
-Gentzen diagram.
-if not basis.
-if not basis.
-if basis
-Lorem ipsum.
-Lorem ipsum.
+Function
+Predecessor. Decrement TOS.
+++1 -
+
Basis Function Combinator
-From the "Overview of the language JOY":
-> The primrec combinator expects two quoted programs in addition to a data parameter. For an integer data parameter it works like this: If the data parameter is zero, then the first quotation has to produce the value to be returned. If the data parameter is positive then the second has to combine the data parameter with the result of applying the function to its predecessor.:
-5 [1] [*] primrec
-> Then primrec tests whether the top element on the stack (initially the 5) is equal to zero. If it is, it pops it off and executes one of the quotations, the [1] which leaves 1 on the stack as the result. Otherwise it pushes a decremented copy of the top element and recurses. On the way back from the recursion it uses the other quotation, [*], to multiply what is now a factorial on top of the stack by the second element on the stack.:
-n [Base] [Recur] primrec
-
- 0 [Base] [Recur] primrec
+Combinator
+From the “Overview of the language JOY”
+
+The primrec combinator expects two quoted programs in addition to a data parameter. For an integer data parameter it works like this: If the data parameter is zero, then the first quotation has to produce the value to be returned. If the data parameter is positive then the second has to combine the data parameter with the result of applying the function to its predecessor.
+
+
+5 [1] [*] primrec
+
+
+Then primrec tests whether the top element on the stack (initially the 5) is equal to zero. If it is, it pops it off and executes one of the quotations, the [1] which leaves 1 on the stack as the result. Otherwise it pushes a decremented copy of the top element and recurses. On the way back from the recursion it uses the other quotation, [*], to multiply what is now a factorial on top of the stack by the second element on the stack.
+
+ 0 [Base] [Recur] primrec
------------------------------
Base
- n [Base] [Recur] primrec
+ n [Base] [Recur] primrec
------------------------------------------ n > 0
n (n-1) [Base] [Recur] primrec Recur
-Gentzen diagram.
-Definition
-if not basis.
-Derivation
-if not basis.
-Source
-if basis
-Discussion
-Lorem ipsum.
-Crosslinks
-Lorem ipsum.
+Discussion
+Simple and useful specialization of the genrec combinator from the original Joy system.
+Crosslinks
+
product
-Basis Function Combinator
-1 swap [*] step
-Gentzen diagram.
-Definition
-if not basis.
-Derivation
-if not basis.
-Source
-if basis
-Discussion
-Lorem ipsum.
-Crosslinks
-Lorem ipsum.
+Function
+Just as sum sums a list of numbers, this function multiplies them together.
+Definition
+
+
+
+Or,
+
+
+
quoted
Basis Function Combinator
[unit] dip
Gentzen diagram.
-Definition
+Definition
if not basis.
-Derivation
+Derivation
if not basis.
-Source
+Source
if basis
-Discussion
+Discussion
Lorem ipsum.
-Crosslinks
+Crosslinks
Lorem ipsum.
range
Basis Function Combinator
[0 <=] [1 - dup] anamorphism
Gentzen diagram.
-Definition
+Definition
if not basis.
-Derivation
+Derivation
if not basis.
-Source
+Source
if basis
-Discussion
+Discussion
Lorem ipsum.
-Crosslinks
+Crosslinks
Lorem ipsum.
range_to_zero
Basis Function Combinator
unit [down_to_zero] infra
Gentzen diagram.
-Definition
+Definition
if not basis.
-Derivation
+Derivation
if not basis.
-Source
+Source
if basis
-Discussion
+Discussion
Lorem ipsum.
-Crosslinks
+Crosslinks
Lorem ipsum.
reco
Basis Function Combinator
rest cons
Gentzen diagram.
-Definition
+Definition
if not basis.
-Derivation
+Derivation
if not basis.
-Source
+Source
if basis
-Discussion
+Discussion
Lorem ipsum.
-Crosslinks
+Crosslinks
Lorem ipsum.
rem
@@ -1907,30 +1864,30 @@ a+b a-b
------------------------
[2 3 1]
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.
a n rshift
----------------
(a∕2ⁿ)
-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.