The rest of the C's.

This commit is contained in:
Simon Forman 2022-03-24 13:35:37 -07:00
parent 9057e3b347
commit 6a71bfb003
6 changed files with 648 additions and 692 deletions

View File

@ -2,28 +2,23 @@
## codireco ## codireco
Basis Function Combinator Combinator
codi reco This is part of the [make_generator] function. You would not use this
combinator directly.
Gentzen diagram.
### Definition ### Definition
if not basis. > [codi] [reco]
### Derivation
if not basis.
### Source
if basis
### Discussion ### Discussion
Lorem ipsum. See [make_generator] and the
["Using `x` to Generate Values" notebook](https://joypy.osdn.io/notebooks/Generator_Programs.html#an-interesting-variation)
as well as
[Recursion Theory and Joy](https://www.kevinalbrecht.com/code/joy-mirror/j05cmp.html) by Manfred von Thun.
### Crosslinks ### Crosslinks
Lorem ipsum. [make_generator]

View File

@ -2,32 +2,33 @@
## concat ## concat
Basis Function Combinator Function
Concatinate the two lists on the top of the stack. : Concatinate two lists.
[a b c] [d e f] concat [a b c] [d e f] concat
---------------------------- ----------------------------
[a b c d e f] [a b c d e f]
Gentzen diagram.
### Definition
if not basis.
### Derivation
if not basis.
### Source
if basis
### Discussion
Lorem ipsum.
### Crosslinks ### Crosslinks
Lorem ipsum. [first]
[first_two]
[flatten]
[fourth]
[getitem]
[remove]
[rest]
[reverse]
[rrest]
[second]
[shift]
[shunt]
[size]
[sort]
[split_at]
[split_list]
[swaack]
[third]
[zip]

View File

@ -2,39 +2,34 @@
## cond ## cond
Basis Function Combinator Combinator
This combinator works like a case statement. It expects a single quote This combinator works like a case statement. It expects a single quote
on the stack that must contain zero or more condition quotes and a on the stack that must contain zero or more condition quotes and a
default quote. Each condition clause should contain a quoted predicate default quote. Each condition quote should contain a quoted predicate
followed by the function expression to run if that predicate returns followed by the function expression to run if that predicate returns
true. If no predicates return true the default function runs. `true`. If no predicates return `true` the default function runs.
[
[ [Predicate0] Function0 ]
[ [Predicate1] Function1 ]
...
[ [PredicateN] FunctionN ]
[Default]
]
cond
### Discussion
It works by rewriting into a chain of nested [ifte]{.title-ref} It works by rewriting into a chain of nested [ifte]{.title-ref}
expressions, e.g.: expressions, e.g.:
[[[B0] T0] [[B1] T1] [D]] cond [[[B0] T0] [[B1] T1] [D]] cond
----------------------------------------- -----------------------------------------
[B0] [T0] [[B1] [T1] [D] ifte] ifte [B0] [T0] [[B1] [T1] [D] ifte] ifte
Gentzen diagram.
### Definition
if not basis.
### Derivation
if not basis.
### Source
if basis
### Discussion
Lorem ipsum.
### Crosslinks ### Crosslinks
Lorem ipsum. [ifte]

View File

@ -2,26 +2,20 @@
## cons ## cons
(Basis Function) Basis Function
Given an item and a list, append the item to the list to make a new list. Given an item and a list, append the item to the list to make a new list.
A [...] cons a [...] cons
------------------ ------------------
[A ...] [a ...]
### Source
func(cons, [list(A), B|S], [list([B|A])|S]).
### Discussion ### Discussion
Cons is a venerable old function from Lisp. It doesn't inspect the item Cons is a [venerable old function from Lisp](https://en.wikipedia.org/wiki/Cons#Lists).
but it will not cons onto a non-list. It's inverse operation is called Its inverse operation is [uncons].
`uncons`.
### Crosslinks ### Crosslinks
[ccons](#ccons) [uncons]
[uncons](#uncons)

File diff suppressed because it is too large Load Diff

View File

@ -895,133 +895,118 @@ useful in a few places.
## codireco ## codireco
Basis Function Combinator Combinator
codi reco This is part of the [make_generator] function. You would not use this
combinator directly.
Gentzen diagram.
### Definition ### Definition
if not basis. > [codi] [reco]
### Derivation
if not basis.
### Source
if basis
### Discussion ### Discussion
Lorem ipsum. See [make_generator] and the
["Using `x` to Generate Values" notebook](https://joypy.osdn.io/notebooks/Generator_Programs.html#an-interesting-variation)
as well as
[Recursion Theory and Joy](https://www.kevinalbrecht.com/code/joy-mirror/j05cmp.html) by Manfred von Thun.
### Crosslinks ### Crosslinks
Lorem ipsum. [make_generator]
------------------------------------------------------------------------ ------------------------------------------------------------------------
## concat ## concat
Basis Function Combinator Function
Concatinate the two lists on the top of the stack. : Concatinate two lists.
[a b c] [d e f] concat [a b c] [d e f] concat
---------------------------- ----------------------------
[a b c d e f] [a b c d e f]
Gentzen diagram.
### Definition
if not basis.
### Derivation
if not basis.
### Source
if basis
### Discussion
Lorem ipsum.
### Crosslinks ### Crosslinks
Lorem ipsum. [first]
[first_two]
[flatten]
[fourth]
[getitem]
[remove]
[rest]
[reverse]
[rrest]
[second]
[shift]
[shunt]
[size]
[sort]
[split_at]
[split_list]
[swaack]
[third]
[zip]
------------------------------------------------------------------------ ------------------------------------------------------------------------
## cond ## cond
Basis Function Combinator Combinator
This combinator works like a case statement. It expects a single quote This combinator works like a case statement. It expects a single quote
on the stack that must contain zero or more condition quotes and a on the stack that must contain zero or more condition quotes and a
default quote. Each condition clause should contain a quoted predicate default quote. Each condition quote should contain a quoted predicate
followed by the function expression to run if that predicate returns followed by the function expression to run if that predicate returns
true. If no predicates return true the default function runs. `true`. If no predicates return `true` the default function runs.
[
[ [Predicate0] Function0 ]
[ [Predicate1] Function1 ]
...
[ [PredicateN] FunctionN ]
[Default]
]
cond
### Discussion
It works by rewriting into a chain of nested [ifte]{.title-ref} It works by rewriting into a chain of nested [ifte]{.title-ref}
expressions, e.g.: expressions, e.g.:
[[[B0] T0] [[B1] T1] [D]] cond [[[B0] T0] [[B1] T1] [D]] cond
----------------------------------------- -----------------------------------------
[B0] [T0] [[B1] [T1] [D] ifte] ifte [B0] [T0] [[B1] [T1] [D] ifte] ifte
Gentzen diagram.
### Definition
if not basis.
### Derivation
if not basis.
### Source
if basis
### Discussion
Lorem ipsum.
### Crosslinks ### Crosslinks
Lorem ipsum. [ifte]
-------------------- --------------------
## cons ## cons
(Basis Function) Basis Function
Given an item and a list, append the item to the list to make a new list. Given an item and a list, append the item to the list to make a new list.
A [...] cons a [...] cons
------------------ ------------------
[A ...] [a ...]
### Source
func(cons, [list(A), B|S], [list([B|A])|S]).
### Discussion ### Discussion
Cons is a venerable old function from Lisp. It doesn't inspect the item Cons is a [venerable old function from Lisp](https://en.wikipedia.org/wiki/Cons#Lists).
but it will not cons onto a non-list. It's inverse operation is called Its inverse operation is [uncons].
`uncons`.
### Crosslinks ### Crosslinks
[ccons](#ccons) [uncons]
[uncons](#uncons)
------------------------------------------------------------------------ ------------------------------------------------------------------------