The rest of the S's.

This commit is contained in:
Simon Forman 2022-03-29 08:50:48 -07:00
parent dd7374ef81
commit 81f8ade4be
14 changed files with 454 additions and 791 deletions

View File

@ -2082,273 +2082,212 @@ a F a</code></pre>
<p><a href="#split_at">split_at</a></p> <p><a href="#split_at">split_at</a></p>
<hr /> <hr />
<h2 id="sqr">sqr</h2> <h2 id="sqr">sqr</h2>
<p>Basis Function Combinator</p> <p>Function</p>
<p>dup *</p> <p>Square the number on the top of the stack.</p>
<p>Gentzen diagram.</p> <pre><code> n sqr
------------
n&#xB2;</code></pre>
<h3 id="definition-81">Definition</h3> <h3 id="definition-81">Definition</h3>
<p>if not basis.</p> <blockquote>
<h3 id="derivation-3">Derivation</h3> <p><a href="#dup">dup</a> <a href="#mul">mul</a></p>
<p>if not basis.</p> </blockquote>
<h3 id="source">Source</h3>
<p>if basis</p>
<h3 id="discussion-64">Discussion</h3>
<p>Lorem ipsum.</p>
<h3 id="crosslinks-98">Crosslinks</h3>
<p>Lorem ipsum.</p>
<hr /> <hr />
<h2 id="sqrt">sqrt</h2> <h2 id="sqrt">sqrt</h2>
<p>Basis Function Combinator</p> <p>Basis Function Combinator</p>
<p>Return the square root of the number a. Negative numbers return complex roots.</p> <p>Return the square root of the number a. Negative numbers return complex roots.</p>
<p>Gentzen diagram.</p> <h3 id="discussion-64">Discussion</h3>
<h3 id="definition-82">Definition</h3> <p>Another &#x201C;numeric tower&#x201D; hatch&#x2026;</p>
<p>if not basis.</p>
<h3 id="derivation-4">Derivation</h3>
<p>if not basis.</p>
<h3 id="source-1">Source</h3>
<p>if basis</p>
<h3 id="discussion-65">Discussion</h3>
<p>Lorem ipsum.</p>
<h3 id="crosslinks-99">Crosslinks</h3>
<p>Lorem ipsum.</p>
<hr /> <hr />
<h2 id="stack">stack</h2> <h2 id="stack">stack</h2>
<p>Basis Function Combinator</p> <p>Function</p>
<pre><code>(... -- ... [...])</code></pre> <p>Put the stack onto the stack.</p>
<p>Gentzen diagram.</p> <pre><code> ... c b a stack
<h3 id="definition-83">Definition</h3> ---------------------------
<p>if not basis.</p> ... c b a [a b c ...]</code></pre>
<h3 id="derivation-5">Derivation</h3> <h3 id="definition-82">Definition</h3>
<p>if not basis.</p> <blockquote>
<h3 id="source-2">Source</h3> <p>[] <a href="#swaack">swaack</a> <a href="#dup">dup</a> <a href="#swaack">swaack</a> <a href="#first">first</a></p>
<p>if basis</p> </blockquote>
<h3 id="discussion-66">Discussion</h3> <h3 id="discussion-65">Discussion</h3>
<p>Lorem ipsum.</p> <p>This function forms a pair with [unstack], and together they form the complement to the &#x201C;destructive&#x201D; pair <a href="#enstacken">enstacken</a> and <a href="#disenstacken">disenstacken</a>.</p>
<h3 id="crosslinks-100">Crosslinks</h3> <h3 id="crosslinks-98">Crosslinks</h3>
<p>Lorem ipsum.</p> <p>[unstack] <a href="#enstacken">enstacken</a> <a href="#disenstacken">disenstacken</a></p>
<hr /> <hr />
<h2 id="stackd">stackd</h2> <h2 id="stackd">stackd</h2>
<p>Basis Function Combinator</p> <p>Function</p>
<p>[stack] dip</p> <p>Grab the stack under the top item and put it onto the stack.</p>
<p>Gentzen diagram.</p> <h3 id="example-26">Example</h3>
<h3 id="definition-84">Definition</h3> <pre><code> ... 1 2 3 stackd
<p>if not basis.</p> ------------------------
<h3 id="derivation-6">Derivation</h3> ... 1 2 [2 1 ...] 3</code></pre>
<p>if not basis.</p> <h3 id="definition-83">Definition</h3>
<h3 id="source-3">Source</h3> <blockquote>
<p>if basis</p> <p>[<a href="#stack">stack</a>] <a href="#dip">dip</a></p>
<h3 id="discussion-67">Discussion</h3> </blockquote>
<p>Lorem ipsum.</p>
<h3 id="crosslinks-101">Crosslinks</h3>
<p>Lorem ipsum.</p>
<hr /> <hr />
<h2 id="step">step</h2> <h2 id="step">step</h2>
<p>Basis Function Combinator</p> <p>Combinator</p>
<p>Run a quoted program on each item in a sequence. :</p> <p>Run a quoted program on each item in a sequence.</p>
<pre><code>... [] [Q] . step <pre><code> ... [] [Q] step
----------------------- ---------------------
... . ...
... [a] [Q] . step ... [a] [Q] step
------------------------ ----------------------
... a . Q ... a Q
... [a b c] [Q] . step ... [a b c] [Q] . step
---------------------------------------- ----------------------------------------
... a . Q [b c] [Q] step</code></pre> ... a . Q [b c] [Q] step</code></pre>
<p>The step combinator executes the quotation on each member of the list on top of the stack.</p> <h3 id="discussion-66">Discussion</h3>
<p>Gentzen diagram.</p> <p>See the <a href="https://joypy.osdn.io/notebooks/Recursion_Combinators.html">Recursion Combinators notebook</a>.</p>
<h3 id="definition-85">Definition</h3> <h3 id="crosslinks-99">Crosslinks</h3>
<p>if not basis.</p> <p><a href="#step_zero">step_zero</a></p>
<h3 id="derivation-7">Derivation</h3>
<p>if not basis.</p>
<h3 id="source-4">Source</h3>
<p>if basis</p>
<h3 id="discussion-68">Discussion</h3>
<p>Lorem ipsum.</p>
<h3 id="crosslinks-102">Crosslinks</h3>
<p>Lorem ipsum.</p>
<hr /> <hr />
<h2 id="step_zero">step_zero</h2> <h2 id="step_zero">step_zero</h2>
<p>Basis Function Combinator</p> <p>Combinator</p>
<p>0 roll&gt; step</p> <p>Like <a href="#step">step</a> but with 0 as the initial value.</p>
<p>Gentzen diagram.</p> <pre><code> [...] [F] step_zero
<h3 id="definition-86">Definition</h3> -------------------------
<p>if not basis.</p> 0 [...] [F] step</code></pre>
<h3 id="derivation-8">Derivation</h3> <h3 id="definition-84">Definition</h3>
<p>if not basis.</p> <blockquote>
<h3 id="source-5">Source</h3> <p>0 <a href="#roll">roll&gt;</a> <a href="#step">step</a></p>
<p>if basis</p> </blockquote>
<h3 id="discussion-69">Discussion</h3> <h3 id="discussion-67">Discussion</h3>
<p>Lorem ipsum.</p> <p><a href="#size">size</a> and <a href="#sum">sum</a> can both be defined in terms of this specialization of <a href="#step">step</a>.</p>
<h3 id="crosslinks-103">Crosslinks</h3> <h3 id="crosslinks-100">Crosslinks</h3>
<p>Lorem ipsum.</p> <p><a href="#step">step</a></p>
<hr /> <hr />
<h2 id="stuncons">stuncons</h2> <h2 id="stuncons">stuncons</h2>
<p>Basis Function Combinator</p> <p>Function</p>
<pre><code>(... a1 -- ... a1 a1 [...])</code></pre> <p>Take the <a href="#stack">stack</a> and <a href="#uncons">uncons</a> the top item.</p>
<p>Gentzen diagram.</p> <h3 id="example-27">Example</h3>
<h3 id="definition-87">Definition</h3> <pre><code> 1 2 3 stuncons
<p>if not basis.</p> --------------------
<h3 id="derivation-9">Derivation</h3> 1 2 3 3 [2 1]</code></pre>
<p>if not basis.</p> <h3 id="definition-85">Definition</h3>
<h3 id="source-6">Source</h3> <blockquote>
<p>if basis</p> <p><a href="#stack">stack</a> <a href="#uncons">uncons</a></p>
<h3 id="discussion-70">Discussion</h3> </blockquote>
<p>Lorem ipsum.</p>
<h3 id="crosslinks-104">Crosslinks</h3>
<p>Lorem ipsum.</p>
<hr /> <hr />
<h2 id="stununcons">stununcons</h2> <h2 id="stununcons">stununcons</h2>
<p>Basis Function Combinator</p> <p>Function</p>
<pre><code>(... a2 a1 -- ... a2 a1 a1 a2 [...])</code></pre> <p>Take the <a href="#stack">stack</a> and <a href="#uncons">uncons</a> the top two items.</p>
<p>Gentzen diagram.</p> <h3 id="example-28">Example</h3>
<h3 id="definition-88">Definition</h3> <pre><code> 1 2 3 stununcons
<p>if not basis.</p> ----------------------
<h3 id="derivation-10">Derivation</h3> 1 2 3 3 2 [1]</code></pre>
<p>if not basis.</p> <h3 id="definition-86">Definition</h3>
<h3 id="source-7">Source</h3> <blockquote>
<p>if basis</p> <p><a href="#stack">stack</a> <a href="#uncons">uncons</a> <a href="#uncons">uncons</a></p>
<h3 id="discussion-71">Discussion</h3> </blockquote>
<p>Lorem ipsum.</p> <h3 id="crosslinks-101">Crosslinks</h3>
<h3 id="crosslinks-105">Crosslinks</h3> <p><a href="#stuncons">stuncons</a></p>
<p>Lorem ipsum.</p>
<hr /> <hr />
<h2 id="sub">sub</h2> <h2 id="sub">sub</h2>
<p>Basis Function Combinator</p> <p>Basis Function</p>
<p>Same as a - b.</p> <p>Subtract the number on the top of the stack from the number below it.</p>
<p>Gentzen diagram.</p> <pre><code> a b sub
<h3 id="definition-89">Definition</h3> -------------
<p>if not basis.</p> (a-b)</code></pre>
<h3 id="derivation-11">Derivation</h3> <h3 id="crosslinks-102">Crosslinks</h3>
<p>if not basis.</p> <p><a href="#add">add</a></p>
<h3 id="source-8">Source</h3>
<p>if basis</p>
<h3 id="discussion-72">Discussion</h3>
<p>Lorem ipsum.</p>
<h3 id="crosslinks-106">Crosslinks</h3>
<p>Lorem ipsum.</p>
<hr /> <hr />
<h2 id="succ">succ</h2> <h2 id="succ">succ</h2>
<p>Basis Function Combinator</p> <p>Function</p>
<p>Increment TOS.</p> <p>Successor. Increment TOS.</p>
<p>Gentzen diagram.</p> <h3 id="definition-87">Definition</h3>
<h3 id="definition-90">Definition</h3> <blockquote>
<p>if not basis.</p> <p>1 +</p>
<h3 id="derivation-12">Derivation</h3> </blockquote>
<p>if not basis.</p> <h3 id="crosslinks-103">Crosslinks</h3>
<h3 id="source-9">Source</h3> <p><a href="#pred">pred</a></p>
<p>if basis</p>
<h3 id="discussion-73">Discussion</h3>
<p>Lorem ipsum.</p>
<h3 id="crosslinks-107">Crosslinks</h3>
<p>Lorem ipsum.</p>
<hr /> <hr />
<h2 id="sum">sum</h2> <h2 id="sum">sum</h2>
<p>Basis Function Combinator</p> <p>Combinator</p>
<p>Given a quoted sequence of numbers return the sum. :</p> <p>Given a quoted sequence of numbers return the sum.</p>
<pre><code>sum == 0 swap [+] step</code></pre> <h3 id="example-29">Example</h3>
<p>Gentzen diagram.</p> <pre><code> [1 2 3 4 5] sum
<h3 id="definition-91">Definition</h3> ---------------------
<p>if not basis.</p> 15</code></pre>
<h3 id="derivation-13">Derivation</h3> <h3 id="definition-88">Definition</h3>
<p>if not basis.</p> <blockquote>
<h3 id="source-10">Source</h3> <p>[+] <a href="#step_zero">step_zero</a></p>
<p>if basis</p> </blockquote>
<h3 id="discussion-74">Discussion</h3> <h3 id="crosslinks-104">Crosslinks</h3>
<p>Lorem ipsum.</p> <p><a href="#size">size</a></p>
<h3 id="crosslinks-108">Crosslinks</h3>
<p>Lorem ipsum.</p>
<hr /> <hr />
<h2 id="swaack">swaack</h2> <h2 id="swaack">swaack</h2>
<p>Basis Function Combinator</p> <p>Basis Function</p>
<pre><code>([...1] -- [...0])</code></pre> <p>Swap stack. Take a list from the top of the stack, replace the stack with the list, and put the old stack onto it.</p>
<p>Gentzen diagram.</p> <h3 id="example-30">Example</h3>
<h3 id="definition-92">Definition</h3> <pre><code> 1 2 3 [4 5 6] swaack
<p>if not basis.</p> --------------------------
<h3 id="derivation-14">Derivation</h3> 6 5 4 [3 2 1]</code></pre>
<p>if not basis.</p> <h3 id="discussion-68">Discussion</h3>
<h3 id="source-11">Source</h3> <p>This function works as a kind of &#x201C;context switch&#x201D;. It&#x2019;s used in the definition of <a href="#infra">infra</a>.</p>
<p>if basis</p> <h3 id="crosslinks-105">Crosslinks</h3>
<h3 id="discussion-75">Discussion</h3> <p><a href="#infra">infra</a></p>
<p>Lorem ipsum.</p>
<h3 id="crosslinks-109">Crosslinks</h3>
<p>Lorem ipsum.</p>
<hr /> <hr />
<h2 id="swap">swap</h2> <h2 id="swap">swap</h2>
<p>Basis Function Combinator</p> <p>Basis Function</p>
<pre><code>(a1 a2 -- a2 a1)</code></pre> <p>Swap the top two items on the stack.</p>
<p>Gentzen diagram.</p> <pre><code> a b swap
<h3 id="definition-93">Definition</h3> --------------
<p>if not basis.</p> b a</code></pre>
<h3 id="derivation-15">Derivation</h3> <h3 id="crosslinks-106">Crosslinks</h3>
<p>if not basis.</p> <p><a href="#swapd">swapd</a></p>
<h3 id="source-12">Source</h3>
<p>if basis</p>
<h3 id="discussion-76">Discussion</h3>
<p>Lorem ipsum.</p>
<h3 id="crosslinks-110">Crosslinks</h3>
<p>Lorem ipsum.</p>
<hr /> <hr />
<h2 id="swapd">swapd</h2> <h2 id="swapd">swapd</h2>
<p>Basis Function Combinator</p> <p>Function</p>
<p>[swap] dip</p> <p>Swap the second and third items on the stack.</p>
<p>Gentzen diagram.</p> <pre><code> a b c swapd
<h3 id="definition-94">Definition</h3> -----------------
<p>if not basis.</p> b a c</code></pre>
<h3 id="derivation-16">Derivation</h3> <h3 id="definition-89">Definition</h3>
<p>if not basis.</p> <blockquote>
<h3 id="source-13">Source</h3> <p>[<a href="#swap">swap</a>] <a href="#dip">dip</a></p>
<p>if basis</p> </blockquote>
<h3 id="discussion-77">Discussion</h3> <h3 id="crosslinks-107">Crosslinks</h3>
<p>Lorem ipsum.</p> <p><a href="#over">over</a> <a href="#tuck">tuck</a></p>
<h3 id="crosslinks-111">Crosslinks</h3>
<p>Lorem ipsum.</p>
<hr /> <hr />
<h2 id="swoncat">swoncat</h2> <h2 id="swoncat">swoncat</h2>
<p>Basis Function Combinator</p> <p>Function</p>
<p>swap concat</p> <p><a href="#concat">concat</a> two lists, but <a href="#swap">swap</a> the lists first.</p>
<p>Gentzen diagram.</p> <h3 id="definition-90">Definition</h3>
<h3 id="definition-95">Definition</h3> <blockquote>
<p>if not basis.</p> <p><a href="#swap">swap</a> <a href="#concat">concat</a></p>
<h3 id="derivation-17">Derivation</h3> </blockquote>
<p>if not basis.</p> <h3 id="crosslinks-108">Crosslinks</h3>
<h3 id="source-14">Source</h3> <p><a href="#concat">concat</a></p>
<p>if basis</p>
<h3 id="discussion-78">Discussion</h3>
<p>Lorem ipsum.</p>
<h3 id="crosslinks-112">Crosslinks</h3>
<p>Lorem ipsum.</p>
<hr /> <hr />
<h2 id="swons">swons</h2> <h2 id="swons">swons</h2>
<p>Basis Function Combinator</p> <p>Function</p>
<pre><code>([...1] a1 -- [a1 ...1])</code></pre> <p>Like <a href="#cons">cons</a> but <a href="#swap">swap</a> the item and list.</p>
<p>Gentzen diagram.</p> <pre><code> [...] a swons
<h3 id="definition-96">Definition</h3> -------------------
<p>if not basis.</p> [a ...]</code></pre>
<h3 id="derivation-18">Derivation</h3> <h3 id="definition-91">Definition</h3>
<p>if not basis.</p> <blockquote>
<h3 id="source-15">Source</h3> <p><a href="#swap">swap</a> <a href="#cons">cons</a></p>
<p>if basis</p> </blockquote>
<h3 id="discussion-79">Discussion</h3>
<p>Lorem ipsum.</p>
<h3 id="crosslinks-113">Crosslinks</h3>
<p>Lorem ipsum.</p>
<hr /> <hr />
<h2 id="tailrec">tailrec</h2> <h2 id="tailrec">tailrec</h2>
<p>Basis Function Combinator</p> <p>Basis Function Combinator</p>
<p>[i] genrec</p> <p>[i] genrec</p>
<p>Gentzen diagram.</p> <p>Gentzen diagram.</p>
<h3 id="definition-97">Definition</h3> <h3 id="definition-92">Definition</h3>
<p>if not basis.</p> <p>if not basis.</p>
<h3 id="derivation-19">Derivation</h3> <h3 id="derivation-3">Derivation</h3>
<p>if not basis.</p> <p>if not basis.</p>
<h3 id="source-16">Source</h3> <h3 id="source">Source</h3>
<p>if basis</p> <p>if basis</p>
<h3 id="discussion-80">Discussion</h3> <h3 id="discussion-69">Discussion</h3>
<p>Lorem ipsum.</p> <p>Lorem ipsum.</p>
<h3 id="crosslinks-114">Crosslinks</h3> <h3 id="crosslinks-109">Crosslinks</h3>
<p>Lorem ipsum.</p> <p>Lorem ipsum.</p>
<hr /> <hr />
<h2 id="take">take</h2> <h2 id="take">take</h2>
@ -2358,15 +2297,15 @@ a F a</code></pre>
---------------------- ----------------------
[b a]</code></pre> [b a]</code></pre>
<p>Gentzen diagram.</p> <p>Gentzen diagram.</p>
<h3 id="definition-98">Definition</h3> <h3 id="definition-93">Definition</h3>
<p>if not basis.</p> <p>if not basis.</p>
<h3 id="derivation-20">Derivation</h3> <h3 id="derivation-4">Derivation</h3>
<p>if not basis.</p> <p>if not basis.</p>
<h3 id="source-17">Source</h3> <h3 id="source-1">Source</h3>
<p>if basis</p> <p>if basis</p>
<h3 id="discussion-81">Discussion</h3> <h3 id="discussion-70">Discussion</h3>
<p>Lorem ipsum.</p> <p>Lorem ipsum.</p>
<h3 id="crosslinks-115">Crosslinks</h3> <h3 id="crosslinks-110">Crosslinks</h3>
<p>Lorem ipsum.</p> <p>Lorem ipsum.</p>
<hr /> <hr />
<h2 id="ternary">ternary</h2> <h2 id="ternary">ternary</h2>
@ -2375,26 +2314,26 @@ a F a</code></pre>
<pre><code> ... z y x [P] unary <pre><code> ... z y x [P] unary
------------------------- -------------------------
... A</code></pre> ... A</code></pre>
<h3 id="definition-99">Definition</h3> <h3 id="definition-94">Definition</h3>
<pre><code>binary popd</code></pre> <pre><code>binary popd</code></pre>
<h3 id="discussion-82">Discussion</h3> <h3 id="discussion-71">Discussion</h3>
<p>Runs any other quoted function and returns its first result while consuming exactly three items from the stack.</p> <p>Runs any other quoted function and returns its first result while consuming exactly three items from the stack.</p>
<h3 id="crosslinks-116">Crosslinks</h3> <h3 id="crosslinks-111">Crosslinks</h3>
<p><a href="#binary">binary</a> <a href="#nullary">nullary</a> <a href="#unary">unary</a></p> <p><a href="#binary">binary</a> <a href="#nullary">nullary</a> <a href="#unary">unary</a></p>
<hr /> <hr />
<h2 id="third">third</h2> <h2 id="third">third</h2>
<p>Basis Function Combinator</p> <p>Basis Function Combinator</p>
<pre><code>([a1 a2 a3 ...1] -- a3)</code></pre> <pre><code>([a1 a2 a3 ...1] -- a3)</code></pre>
<p>Gentzen diagram.</p> <p>Gentzen diagram.</p>
<h3 id="definition-100">Definition</h3> <h3 id="definition-95">Definition</h3>
<p>if not basis.</p> <p>if not basis.</p>
<h3 id="derivation-21">Derivation</h3> <h3 id="derivation-5">Derivation</h3>
<p>if not basis.</p> <p>if not basis.</p>
<h3 id="source-18">Source</h3> <h3 id="source-2">Source</h3>
<p>if basis</p> <p>if basis</p>
<h3 id="discussion-83">Discussion</h3> <h3 id="discussion-72">Discussion</h3>
<p>Lorem ipsum.</p> <p>Lorem ipsum.</p>
<h3 id="crosslinks-117">Crosslinks</h3> <h3 id="crosslinks-112">Crosslinks</h3>
<p>Lorem ipsum.</p> <p>Lorem ipsum.</p>
<hr /> <hr />
<h2 id="times">times</h2> <h2 id="times">times</h2>
@ -2414,15 +2353,15 @@ a F a</code></pre>
------------------------------------- w/ n &gt; 1 ------------------------------------- w/ n &gt; 1
... . Q (n - 1) [Q] times</code></pre> ... . Q (n - 1) [Q] times</code></pre>
<p>Gentzen diagram.</p> <p>Gentzen diagram.</p>
<h3 id="definition-101">Definition</h3> <h3 id="definition-96">Definition</h3>
<p>if not basis.</p> <p>if not basis.</p>
<h3 id="derivation-22">Derivation</h3> <h3 id="derivation-6">Derivation</h3>
<p>if not basis.</p> <p>if not basis.</p>
<h3 id="source-19">Source</h3> <h3 id="source-3">Source</h3>
<p>if basis</p> <p>if basis</p>
<h3 id="discussion-84">Discussion</h3> <h3 id="discussion-73">Discussion</h3>
<p>Lorem ipsum.</p> <p>Lorem ipsum.</p>
<h3 id="crosslinks-118">Crosslinks</h3> <h3 id="crosslinks-113">Crosslinks</h3>
<p>Lorem ipsum.</p> <p>Lorem ipsum.</p>
<hr /> <hr />
<h2 id="truthy">truthy</h2> <h2 id="truthy">truthy</h2>
@ -2432,15 +2371,15 @@ a F a</code></pre>
<p>Basis Function Combinator</p> <p>Basis Function Combinator</p>
<pre><code>(a2 a1 -- a1 a2 a1)</code></pre> <pre><code>(a2 a1 -- a1 a2 a1)</code></pre>
<p>Gentzen diagram.</p> <p>Gentzen diagram.</p>
<h3 id="definition-102">Definition</h3> <h3 id="definition-97">Definition</h3>
<p>if not basis.</p> <p>if not basis.</p>
<h3 id="derivation-23">Derivation</h3> <h3 id="derivation-7">Derivation</h3>
<p>if not basis.</p> <p>if not basis.</p>
<h3 id="source-20">Source</h3> <h3 id="source-4">Source</h3>
<p>if basis</p> <p>if basis</p>
<h3 id="discussion-85">Discussion</h3> <h3 id="discussion-74">Discussion</h3>
<p>Lorem ipsum.</p> <p>Lorem ipsum.</p>
<h3 id="crosslinks-119">Crosslinks</h3> <h3 id="crosslinks-114">Crosslinks</h3>
<p>Lorem ipsum.</p> <p>Lorem ipsum.</p>
<hr /> <hr />
<h2 id="unary">unary</h2> <h2 id="unary">unary</h2>
@ -2449,11 +2388,11 @@ a F a</code></pre>
<pre><code> ... x [P] unary <pre><code> ... x [P] unary
--------------------- ---------------------
... A</code></pre> ... A</code></pre>
<h3 id="definition-103">Definition</h3> <h3 id="definition-98">Definition</h3>
<pre><code>nullary popd</code></pre> <pre><code>nullary popd</code></pre>
<h3 id="discussion-86">Discussion</h3> <h3 id="discussion-75">Discussion</h3>
<p>Runs any other quoted function and returns its first result while consuming exactly one item from the stack.</p> <p>Runs any other quoted function and returns its first result while consuming exactly one item from the stack.</p>
<h3 id="crosslinks-120">Crosslinks</h3> <h3 id="crosslinks-115">Crosslinks</h3>
<p><a href="#binary">binary</a> <a href="#nullary">nullary</a> <a href="#ternary">ternary</a></p> <p><a href="#binary">binary</a> <a href="#nullary">nullary</a> <a href="#ternary">ternary</a></p>
<hr /> <hr />
<h2 id="uncons">uncons</h2> <h2 id="uncons">uncons</h2>
@ -2462,131 +2401,131 @@ a F a</code></pre>
<pre><code> [A ...] uncons <pre><code> [A ...] uncons
-------------------- --------------------
A [...]</code></pre> A [...]</code></pre>
<h3 id="source-21">Source</h3> <h3 id="source-5">Source</h3>
<pre><code>func(uncons, Si, So) :- func(cons, So, Si).</code></pre> <pre><code>func(uncons, Si, So) :- func(cons, So, Si).</code></pre>
<h3 id="discussion-87">Discussion</h3> <h3 id="discussion-76">Discussion</h3>
<p>This is the inverse of <code>cons</code>.</p> <p>This is the inverse of <code>cons</code>.</p>
<h3 id="crosslinks-121">Crosslinks</h3> <h3 id="crosslinks-116">Crosslinks</h3>
<p><a href="#cons">cons</a></p> <p><a href="#cons">cons</a></p>
<hr /> <hr />
<h2 id="unique">unique</h2> <h2 id="unique">unique</h2>
<p>Basis Function Combinator</p> <p>Basis Function Combinator</p>
<p>Given a list remove duplicate items.</p> <p>Given a list remove duplicate items.</p>
<p>Gentzen diagram.</p> <p>Gentzen diagram.</p>
<h3 id="definition-104">Definition</h3> <h3 id="definition-99">Definition</h3>
<p>if not basis.</p> <p>if not basis.</p>
<h3 id="derivation-24">Derivation</h3> <h3 id="derivation-8">Derivation</h3>
<p>if not basis.</p> <p>if not basis.</p>
<h3 id="source-22">Source</h3> <h3 id="source-6">Source</h3>
<p>if basis</p> <p>if basis</p>
<h3 id="discussion-88">Discussion</h3> <h3 id="discussion-77">Discussion</h3>
<p>Lorem ipsum.</p> <p>Lorem ipsum.</p>
<h3 id="crosslinks-122">Crosslinks</h3> <h3 id="crosslinks-117">Crosslinks</h3>
<p>Lorem ipsum.</p> <p>Lorem ipsum.</p>
<hr /> <hr />
<h2 id="unit">unit</h2> <h2 id="unit">unit</h2>
<p>Basis Function Combinator</p> <p>Basis Function Combinator</p>
<pre><code>(a1 -- [a1 ])</code></pre> <pre><code>(a1 -- [a1 ])</code></pre>
<p>Gentzen diagram.</p> <p>Gentzen diagram.</p>
<h3 id="definition-105">Definition</h3> <h3 id="definition-100">Definition</h3>
<p>if not basis.</p> <p>if not basis.</p>
<h3 id="derivation-25">Derivation</h3> <h3 id="derivation-9">Derivation</h3>
<p>if not basis.</p> <p>if not basis.</p>
<h3 id="source-23">Source</h3> <h3 id="source-7">Source</h3>
<p>if basis</p> <p>if basis</p>
<h3 id="discussion-89">Discussion</h3> <h3 id="discussion-78">Discussion</h3>
<p>Lorem ipsum.</p> <p>Lorem ipsum.</p>
<h3 id="crosslinks-123">Crosslinks</h3> <h3 id="crosslinks-118">Crosslinks</h3>
<p>Lorem ipsum.</p> <p>Lorem ipsum.</p>
<hr /> <hr />
<h2 id="unquoted">unquoted</h2> <h2 id="unquoted">unquoted</h2>
<p>Basis Function Combinator</p> <p>Basis Function Combinator</p>
<p>[i] dip</p> <p>[i] dip</p>
<p>Gentzen diagram.</p> <p>Gentzen diagram.</p>
<h3 id="definition-106">Definition</h3> <h3 id="definition-101">Definition</h3>
<p>if not basis.</p> <p>if not basis.</p>
<h3 id="derivation-26">Derivation</h3> <h3 id="derivation-10">Derivation</h3>
<p>if not basis.</p> <p>if not basis.</p>
<h3 id="source-24">Source</h3> <h3 id="source-8">Source</h3>
<p>if basis</p> <p>if basis</p>
<h3 id="discussion-90">Discussion</h3> <h3 id="discussion-79">Discussion</h3>
<p>Lorem ipsum.</p> <p>Lorem ipsum.</p>
<h3 id="crosslinks-124">Crosslinks</h3> <h3 id="crosslinks-119">Crosslinks</h3>
<p>Lorem ipsum.</p> <p>Lorem ipsum.</p>
<hr /> <hr />
<h2 id="unswons">unswons</h2> <h2 id="unswons">unswons</h2>
<p>Basis Function Combinator</p> <p>Basis Function Combinator</p>
<pre><code>([a1 ...1] -- [...1] a1)</code></pre> <pre><code>([a1 ...1] -- [...1] a1)</code></pre>
<p>Gentzen diagram.</p> <p>Gentzen diagram.</p>
<h3 id="definition-107">Definition</h3> <h3 id="definition-102">Definition</h3>
<p>if not basis.</p> <p>if not basis.</p>
<h3 id="derivation-27">Derivation</h3> <h3 id="derivation-11">Derivation</h3>
<p>if not basis.</p> <p>if not basis.</p>
<h3 id="source-25">Source</h3> <h3 id="source-9">Source</h3>
<p>if basis</p> <p>if basis</p>
<h3 id="discussion-91">Discussion</h3> <h3 id="discussion-80">Discussion</h3>
<p>Lorem ipsum.</p> <p>Lorem ipsum.</p>
<h3 id="crosslinks-125">Crosslinks</h3> <h3 id="crosslinks-120">Crosslinks</h3>
<p>Lorem ipsum.</p> <p>Lorem ipsum.</p>
<hr /> <hr />
<h2 id="void">void</h2> <h2 id="void">void</h2>
<p>Basis Function Combinator</p> <p>Basis Function Combinator</p>
<p>True if the form on TOS is void otherwise False.</p> <p>True if the form on TOS is void otherwise False.</p>
<p>Gentzen diagram.</p> <p>Gentzen diagram.</p>
<h3 id="definition-108">Definition</h3> <h3 id="definition-103">Definition</h3>
<p>if not basis.</p> <p>if not basis.</p>
<h3 id="derivation-28">Derivation</h3> <h3 id="derivation-12">Derivation</h3>
<p>if not basis.</p> <p>if not basis.</p>
<h3 id="source-26">Source</h3> <h3 id="source-10">Source</h3>
<p>if basis</p> <p>if basis</p>
<h3 id="discussion-92">Discussion</h3> <h3 id="discussion-81">Discussion</h3>
<p>Lorem ipsum.</p> <p>Lorem ipsum.</p>
<h3 id="crosslinks-126">Crosslinks</h3> <h3 id="crosslinks-121">Crosslinks</h3>
<p>Lorem ipsum.</p> <p>Lorem ipsum.</p>
<hr /> <hr />
<h2 id="warranty">warranty</h2> <h2 id="warranty">warranty</h2>
<p>Basis Function Combinator</p> <p>Basis Function Combinator</p>
<p>Print warranty information.</p> <p>Print warranty information.</p>
<p>Gentzen diagram.</p> <p>Gentzen diagram.</p>
<h3 id="definition-109">Definition</h3> <h3 id="definition-104">Definition</h3>
<p>if not basis.</p> <p>if not basis.</p>
<h3 id="derivation-29">Derivation</h3> <h3 id="derivation-13">Derivation</h3>
<p>if not basis.</p> <p>if not basis.</p>
<h3 id="source-27">Source</h3> <h3 id="source-11">Source</h3>
<p>if basis</p> <p>if basis</p>
<h3 id="discussion-93">Discussion</h3> <h3 id="discussion-82">Discussion</h3>
<p>Lorem ipsum.</p> <p>Lorem ipsum.</p>
<h3 id="crosslinks-127">Crosslinks</h3> <h3 id="crosslinks-122">Crosslinks</h3>
<p>Lorem ipsum.</p> <p>Lorem ipsum.</p>
<hr /> <hr />
<h2 id="while">while</h2> <h2 id="while">while</h2>
<p>Basis Function Combinator</p> <p>Basis Function Combinator</p>
<p>swap nulco dupdipd concat loop</p> <p>swap nulco dupdipd concat loop</p>
<p>Gentzen diagram.</p> <p>Gentzen diagram.</p>
<h3 id="definition-110">Definition</h3> <h3 id="definition-105">Definition</h3>
<p>if not basis.</p> <p>if not basis.</p>
<h3 id="derivation-30">Derivation</h3> <h3 id="derivation-14">Derivation</h3>
<p>if not basis.</p> <p>if not basis.</p>
<h3 id="source-28">Source</h3> <h3 id="source-12">Source</h3>
<p>if basis</p> <p>if basis</p>
<h3 id="discussion-94">Discussion</h3> <h3 id="discussion-83">Discussion</h3>
<p>Lorem ipsum.</p> <p>Lorem ipsum.</p>
<h3 id="crosslinks-128">Crosslinks</h3> <h3 id="crosslinks-123">Crosslinks</h3>
<p>Lorem ipsum.</p> <p>Lorem ipsum.</p>
<hr /> <hr />
<h2 id="words">words</h2> <h2 id="words">words</h2>
<p>Basis Function Combinator</p> <p>Basis Function Combinator</p>
<p>Print all the words in alphabetical order.</p> <p>Print all the words in alphabetical order.</p>
<p>Gentzen diagram.</p> <p>Gentzen diagram.</p>
<h3 id="definition-111">Definition</h3> <h3 id="definition-106">Definition</h3>
<p>if not basis.</p> <p>if not basis.</p>
<h3 id="derivation-31">Derivation</h3> <h3 id="derivation-15">Derivation</h3>
<p>if not basis.</p> <p>if not basis.</p>
<h3 id="source-29">Source</h3> <h3 id="source-13">Source</h3>
<p>if basis</p> <p>if basis</p>
<h3 id="discussion-95">Discussion</h3> <h3 id="discussion-84">Discussion</h3>
<p>Lorem ipsum.</p> <p>Lorem ipsum.</p>
<h3 id="crosslinks-129">Crosslinks</h3> <h3 id="crosslinks-124">Crosslinks</h3>
<p>Lorem ipsum.</p> <p>Lorem ipsum.</p>
<hr /> <hr />
<h2 id="x">x</h2> <h2 id="x">x</h2>
@ -2594,39 +2533,39 @@ a F a</code></pre>
<pre><code> [F] x <pre><code> [F] x
----------- -----------
[F] F</code></pre> [F] F</code></pre>
<h3 id="definition-112">Definition</h3> <h3 id="definition-107">Definition</h3>
<pre><code>dup i</code></pre> <pre><code>dup i</code></pre>
<h3 id="discussion-96">Discussion</h3> <h3 id="discussion-85">Discussion</h3>
<p>The <code>x</code> combinator &#x2026;</p> <p>The <code>x</code> combinator &#x2026;</p>
<hr /> <hr />
<h2 id="xor">xor</h2> <h2 id="xor">xor</h2>
<p>Basis Function Combinator</p> <p>Basis Function Combinator</p>
<p>Same as a ^ b.</p> <p>Same as a ^ b.</p>
<p>Gentzen diagram.</p> <p>Gentzen diagram.</p>
<h3 id="definition-113">Definition</h3> <h3 id="definition-108">Definition</h3>
<p>if not basis.</p> <p>if not basis.</p>
<h3 id="derivation-32">Derivation</h3> <h3 id="derivation-16">Derivation</h3>
<p>if not basis.</p> <p>if not basis.</p>
<h3 id="source-30">Source</h3> <h3 id="source-14">Source</h3>
<p>if basis</p> <p>if basis</p>
<h3 id="discussion-97">Discussion</h3> <h3 id="discussion-86">Discussion</h3>
<p>Lorem ipsum.</p> <p>Lorem ipsum.</p>
<h3 id="crosslinks-130">Crosslinks</h3> <h3 id="crosslinks-125">Crosslinks</h3>
<p>Lorem ipsum.</p> <p>Lorem ipsum.</p>
<hr /> <hr />
<h2 id="zip">zip</h2> <h2 id="zip">zip</h2>
<p>Basis Function Combinator</p> <p>Basis Function Combinator</p>
<p>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.</p> <p>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.</p>
<p>Gentzen diagram.</p> <p>Gentzen diagram.</p>
<h3 id="definition-114">Definition</h3> <h3 id="definition-109">Definition</h3>
<p>if not basis.</p> <p>if not basis.</p>
<h3 id="derivation-33">Derivation</h3> <h3 id="derivation-17">Derivation</h3>
<p>if not basis.</p> <p>if not basis.</p>
<h3 id="source-31">Source</h3> <h3 id="source-15">Source</h3>
<p>if basis</p> <p>if basis</p>
<h3 id="discussion-98">Discussion</h3> <h3 id="discussion-87">Discussion</h3>
<p>Lorem ipsum.</p> <p>Lorem ipsum.</p>
<h3 id="crosslinks-131">Crosslinks</h3> <h3 id="crosslinks-126">Crosslinks</h3>
<p>Lorem ipsum.</p> <p>Lorem ipsum.</p>
</body> </body>
</html> </html>

View File

@ -3324,31 +3324,18 @@ Compare with [split_at]. This function does extra work to ensure that
## sqr ## sqr
Basis Function Combinator Function
dup \* Square the number on the top of the stack.
Gentzen diagram. n sqr
------------
### Definition ### Definition
if not basis. > [dup] [mul]
### Derivation
if not basis.
### Source
if basis
### Discussion
Lorem ipsum.
### Crosslinks
Lorem ipsum.
------------------------------------------------------------------------ ------------------------------------------------------------------------
@ -3359,466 +3346,311 @@ Basis Function Combinator
Return the square root of the number a. Negative numbers return complex Return the square root of the number a. Negative numbers return complex
roots. roots.
Gentzen diagram.
### Definition
if not basis.
### Derivation
if not basis.
### Source
if basis
### Discussion ### Discussion
Lorem ipsum. Another "numeric tower" hatch...
### Crosslinks
Lorem ipsum.
------------------------------------------------------------------------ ------------------------------------------------------------------------
## stack ## stack
Basis Function Combinator Function
(... -- ... [...]) Put the stack onto the stack.
Gentzen diagram. ... c b a stack
---------------------------
... c b a [a b c ...]
### Definition ### Definition
if not basis. > \[\] [swaack] [dup] [swaack] [first]
### Derivation
if not basis.
### Source
if basis
### Discussion ### Discussion
Lorem ipsum. This function forms a pair with [unstack], and together they form the
complement to the "destructive" pair [enstacken] and [disenstacken].
### Crosslinks ### Crosslinks
Lorem ipsum. [unstack]
[enstacken]
[disenstacken]
------------------------------------------------------------------------ ------------------------------------------------------------------------
## stackd ## stackd
Basis Function Combinator Function
\[stack\] dip Grab the stack under the top item and put it onto the stack.
Gentzen diagram. ### Example
... 1 2 3 stackd
------------------------
... 1 2 [2 1 ...] 3
### Definition ### Definition
if not basis. > \[[stack]\] [dip]
### Derivation
if not basis.
### Source
if basis
### Discussion
Lorem ipsum.
### Crosslinks
Lorem ipsum.
------------------------------------------------------------------------ ------------------------------------------------------------------------
## step ## step
Basis Function Combinator Combinator
Run a quoted program on each item in a sequence. : Run a quoted program on each item in a sequence.
... [] [Q] . step ... [] [Q] step
----------------------- ---------------------
... . ...
... [a] [Q] . step ... [a] [Q] step
------------------------ ----------------------
... a . Q ... a Q
... [a b c] [Q] . step ... [a b c] [Q] . step
---------------------------------------- ----------------------------------------
... a . Q [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 ### Discussion
Lorem ipsum. See the [Recursion Combinators notebook](https://joypy.osdn.io/notebooks/Recursion_Combinators.html).
### Crosslinks ### Crosslinks
Lorem ipsum. [step_zero]
------------------------------------------------------------------------ ------------------------------------------------------------------------
## step_zero ## step_zero
Basis Function Combinator Combinator
0 roll> step Like [step] but with 0 as the initial value.
Gentzen diagram. [...] [F] step_zero
-------------------------
0 [...] [F] step
### Definition ### Definition
if not basis. > 0 [roll>] [step]
### Derivation
if not basis.
### Source
if basis
### Discussion ### Discussion
Lorem ipsum. [size] and [sum] can both be defined in terms of this specialization of
[step].
### Crosslinks ### Crosslinks
Lorem ipsum. [step]
------------------------------------------------------------------------ ------------------------------------------------------------------------
## stuncons ## stuncons
Basis Function Combinator Function
(... a1 -- ... a1 a1 [...]) Take the [stack] and [uncons] the top item.
Gentzen diagram. ### Example
1 2 3 stuncons
--------------------
1 2 3 3 [2 1]
### Definition ### Definition
if not basis. > [stack] [uncons]
### Derivation
if not basis.
### Source
if basis
### Discussion
Lorem ipsum.
### Crosslinks
Lorem ipsum.
------------------------------------------------------------------------ ------------------------------------------------------------------------
## stununcons ## stununcons
Basis Function Combinator Function
(... a2 a1 -- ... a2 a1 a1 a2 [...]) Take the [stack] and [uncons] the top two items.
Gentzen diagram. ### Example
1 2 3 stununcons
----------------------
1 2 3 3 2 [1]
### Definition ### Definition
if not basis. > [stack] [uncons] [uncons]
### Derivation
if not basis.
### Source
if basis
### Discussion
Lorem ipsum.
### Crosslinks ### Crosslinks
Lorem ipsum. [stuncons]
------------------------------------------------------------------------ ------------------------------------------------------------------------
## sub ## sub
Basis Function Combinator Basis Function
Same as a - b. Subtract the number on the top of the stack from the number below it.
Gentzen diagram. a b sub
-------------
### Definition (a-b)
if not basis.
### Derivation
if not basis.
### Source
if basis
### Discussion
Lorem ipsum.
### Crosslinks ### Crosslinks
Lorem ipsum. [add]
------------------------------------------------------------------------ ------------------------------------------------------------------------
## succ ## succ
Basis Function Combinator Function
Increment TOS. Successor. Increment TOS.
Gentzen diagram.
### Definition ### Definition
if not basis. > 1 +
### Derivation
if not basis.
### Source
if basis
### Discussion
Lorem ipsum.
### Crosslinks ### Crosslinks
Lorem ipsum. [pred]
------------------------------------------------------------------------ ------------------------------------------------------------------------
## sum ## sum
Basis Function Combinator Combinator
Given a quoted sequence of numbers return the sum. : Given a quoted sequence of numbers return the sum.
sum == 0 swap [+] step ### Example
Gentzen diagram. [1 2 3 4 5] sum
---------------------
15
### Definition ### Definition
if not basis. > \[+\] [step_zero]
### Derivation
if not basis.
### Source
if basis
### Discussion
Lorem ipsum.
### Crosslinks ### Crosslinks
Lorem ipsum. [size]
------------------------------------------------------------------------ ------------------------------------------------------------------------
## swaack ## swaack
Basis Function Combinator Basis Function
([...1] -- [...0]) Swap stack. Take a list from the top of the stack, replace the stack
with the list, and put the old stack onto it.
Gentzen diagram. ### Example
### Definition 1 2 3 [4 5 6] swaack
--------------------------
if not basis. 6 5 4 [3 2 1]
### Derivation
if not basis.
### Source
if basis
### Discussion ### Discussion
Lorem ipsum. This function works as a kind of "context switch". It's used in the
definition of [infra].
### Crosslinks ### Crosslinks
Lorem ipsum. [infra]
------------------------------------------------------------------------ ------------------------------------------------------------------------
## swap ## swap
Basis Function Combinator Basis Function
(a1 a2 -- a2 a1) Swap the top two items on the stack.
Gentzen diagram. a b swap
--------------
### Definition b a
if not basis.
### Derivation
if not basis.
### Source
if basis
### Discussion
Lorem ipsum.
### Crosslinks ### Crosslinks
Lorem ipsum. [swapd]
------------------------------------------------------------------------ ------------------------------------------------------------------------
## swapd ## swapd
Basis Function Combinator Function
\[swap\] dip Swap the second and third items on the stack.
Gentzen diagram. a b c swapd
-----------------
b a c
### Definition ### Definition
if not basis. > \[[swap]\] [dip]
### Derivation
if not basis.
### Source
if basis
### Discussion
Lorem ipsum.
### Crosslinks ### Crosslinks
Lorem ipsum. [over]
[tuck]
------------------------------------------------------------------------ ------------------------------------------------------------------------
## swoncat ## swoncat
Basis Function Combinator Function
swap concat [concat] two lists, but [swap] the lists first.
Gentzen diagram.
### Definition ### Definition
if not basis. > [swap] [concat]
### Derivation
if not basis.
### Source
if basis
### Discussion
Lorem ipsum.
### Crosslinks ### Crosslinks
Lorem ipsum. [concat]
------------------------------------------------------------------------ ------------------------------------------------------------------------
## swons ## swons
Basis Function Combinator Function
([...1] a1 -- [a1 ...1]) Like [cons] but [swap] the item and list.
Gentzen diagram. [...] a swons
-------------------
[a ...]
### Definition ### Definition
if not basis. > [swap] [cons]
### Derivation
if not basis.
### Source
if basis
### Discussion
Lorem ipsum.
### Crosslinks
Lorem ipsum.
------------------------------------------------------------------------ ------------------------------------------------------------------------

View File

@ -4,26 +4,22 @@
Combinator Combinator
0 roll> step Like [step] but with 0 as the initial value.
Gentzen diagram. [...] [F] step_zero
-------------------------
0 [...] [F] step
### Definition ### Definition
if not basis. > 0 [roll>] [step]
### Derivation
if not basis.
### Source
if basis
### Discussion ### Discussion
Lorem ipsum. [size] and [sum] can both be defined in terms of this specialization of
[step].
### Crosslinks ### Crosslinks
Lorem ipsum. [step]

View File

@ -2,28 +2,17 @@
## stuncons ## stuncons
Basis Function Combinator Function
(... a1 -- ... a1 a1 [...]) Take the [stack] and [uncons] the top item.
Gentzen diagram. ### Example
1 2 3 stuncons
--------------------
1 2 3 3 [2 1]
### Definition ### Definition
if not basis. > [stack] [uncons]
### Derivation
if not basis.
### Source
if basis
### Discussion
Lorem ipsum.
### Crosslinks
Lorem ipsum.

View File

@ -2,28 +2,21 @@
## stununcons ## stununcons
Basis Function Combinator Function
(... a2 a1 -- ... a2 a1 a1 a2 [...]) Take the [stack] and [uncons] the top two items.
Gentzen diagram. ### Example
1 2 3 stununcons
----------------------
1 2 3 3 2 [1]
### Definition ### Definition
if not basis. > [stack] [uncons] [uncons]
### Derivation
if not basis.
### Source
if basis
### Discussion
Lorem ipsum.
### Crosslinks ### Crosslinks
Lorem ipsum. [stuncons]

View File

@ -2,28 +2,15 @@
## sub ## sub
Basis Function Combinator Basis Function
Same as a - b. Subtract the number on the top of the stack from the number below it.
Gentzen diagram. a b sub
-------------
### Definition (a-b)
if not basis.
### Derivation
if not basis.
### Source
if basis
### Discussion
Lorem ipsum.
### Crosslinks ### Crosslinks
Lorem ipsum. [add]

View File

@ -2,28 +2,15 @@
## succ ## succ
Basis Function Combinator Function
Increment TOS. Successor. Increment TOS.
Gentzen diagram.
### Definition ### Definition
if not basis. > 1 +
### Derivation
if not basis.
### Source
if basis
### Discussion
Lorem ipsum.
### Crosslinks ### Crosslinks
Lorem ipsum. [pred]

View File

@ -2,30 +2,21 @@
## sum ## sum
Basis Function Combinator Combinator
Given a quoted sequence of numbers return the sum. : Given a quoted sequence of numbers return the sum.
sum == 0 swap [+] step ### Example
Gentzen diagram. [1 2 3 4 5] sum
---------------------
15
### Definition ### Definition
if not basis. > \[+\] [step_zero]
### Derivation
if not basis.
### Source
if basis
### Discussion
Lorem ipsum.
### Crosslinks ### Crosslinks
Lorem ipsum. [size]

View File

@ -2,28 +2,23 @@
## swaack ## swaack
Basis Function Combinator Basis Function
([...1] -- [...0]) Swap stack. Take a list from the top of the stack, replace the stack
with the list, and put the old stack onto it.
Gentzen diagram. ### Example
### Definition 1 2 3 [4 5 6] swaack
--------------------------
if not basis. 6 5 4 [3 2 1]
### Derivation
if not basis.
### Source
if basis
### Discussion ### Discussion
Lorem ipsum. This function works as a kind of "context switch". It's used in the
definition of [infra].
### Crosslinks ### Crosslinks
Lorem ipsum. [infra]

View File

@ -2,28 +2,15 @@
## swap ## swap
Basis Function Combinator Basis Function
(a1 a2 -- a2 a1) Swap the top two items on the stack.
Gentzen diagram. a b swap
--------------
### Definition b a
if not basis.
### Derivation
if not basis.
### Source
if basis
### Discussion
Lorem ipsum.
### Crosslinks ### Crosslinks
Lorem ipsum. [swapd]

View File

@ -2,28 +2,20 @@
## swapd ## swapd
Basis Function Combinator Function
\[swap\] dip Swap the second and third items on the stack.
Gentzen diagram. a b c swapd
-----------------
b a c
### Definition ### Definition
if not basis. > \[[swap]\] [dip]
### Derivation
if not basis.
### Source
if basis
### Discussion
Lorem ipsum.
### Crosslinks ### Crosslinks
Lorem ipsum. [over]
[tuck]

View File

@ -2,28 +2,15 @@
## swoncat ## swoncat
Basis Function Combinator Function
swap concat [concat] two lists, but [swap] the lists first.
Gentzen diagram.
### Definition ### Definition
if not basis. > [swap] [concat]
### Derivation
if not basis.
### Source
if basis
### Discussion
Lorem ipsum.
### Crosslinks ### Crosslinks
Lorem ipsum. [concat]

View File

@ -2,28 +2,15 @@
## swons ## swons
Basis Function Combinator Function
([...1] a1 -- [a1 ...1]) Like [cons] but [swap] the item and list.
Gentzen diagram. [...] a swons
-------------------
[a ...]
### Definition ### Definition
if not basis. > [swap] [cons]
### Derivation
if not basis.
### Source
if basis
### Discussion
Lorem ipsum.
### Crosslinks
Lorem ipsum.

View File

@ -83,6 +83,7 @@ split_list [take reverse] [drop] clop
sqr dup * sqr dup *
stackd [stack] dip stackd [stack] dip
step_zero 0 roll> step step_zero 0 roll> step
stuncons stack uncons
sum [+] step_zero sum [+] step_zero
swapd [swap] dip swapd [swap] dip
swons swap cons swons swap cons