Ref docs B's.

This commit is contained in:
Simon Forman 2022-03-24 11:15:25 -07:00
parent e9a5fbdb51
commit 43649685ac
6 changed files with 482 additions and 555 deletions

View File

@ -2,7 +2,7 @@
## b ## b
(Combinator) Combinator
Run two quoted programs Run two quoted programs
@ -12,19 +12,11 @@ Run two quoted programs
### Definition ### Definition
[i] dip i > \[[i]\] [dip] [i]
### Derivation
[P] [Q] b
[P] [Q] [i] dip i
[P] i [Q] i
P [Q] i
P Q
### Discussion ### Discussion
This combinator comes in handy. This combinator may seem trivial but it comes in handy.
### Crosslinks ### Crosslinks

View File

@ -2,18 +2,18 @@
## binary ## binary
(Combinator) Combinator
Run a quoted program using exactly two stack values and leave the first Run a quoted program using exactly two stack values and leave the first
item of the result on the stack. item of the result on the stack.
... y x [P] binary ... y x [P] binary
----------------------- -----------------------
... A ... a
### Definition ### Definition
unary popd > [unary] [popd]
### Discussion ### Discussion

View File

@ -2,32 +2,16 @@
## bool ## bool
Basis Function Combinator Basis Function
bool(x) -\> bool Convert the item on the top of the stack to a Boolean value.
Returns True when the argument x is true, False otherwise. The builtins
True and False are the only two instances of the class bool. The class
bool is a subclass of the class int, and cannot be subclassed.
Gentzen diagram.
### Definition
if not basis.
### Derivation
if not basis.
### Source
if basis
### Discussion ### Discussion
Lorem ipsum. For integers 0 is `false` and any other number is `true`; for lists the
empty list is `false` and all other lists are `true`.
### Crosslinks ### Crosslinks
Lorem ipsum. [not]

View File

@ -2,38 +2,33 @@
## branch ## branch
Basis Function Combinator Basis Combinator
Use a Boolean value to select one of two quoted programs to run. Use a Boolean value to select and run one of two quoted programs.
branch == roll< choice i
False [F] [T] branch false [F] [T] branch
-------------------------- --------------------------
F F
True [F] [T] branch true [F] [T] branch
------------------------- -------------------------
T T
Gentzen diagram.
### Definition ### Definition
if not basis. > [rolldown] [choice] [i]
### Derivation
if not basis.
### Source
if basis
### Discussion ### Discussion
Lorem ipsum. This is one of the fundamental operations (although it can be defined in
terms of [choice] as above). The more common "if..then..else" construct
[ifte] adds a predicate function that is evaluated [nullary].
### Crosslinks ### Crosslinks
Lorem ipsum. [choice]
[ifte]
[select]

File diff suppressed because it is too large Load Diff

View File

@ -563,7 +563,7 @@ See the [Recursion Combinators notebook](https://joypy.osdn.io/notebooks/Recursi
## b ## b
(Combinator) Combinator
Run two quoted programs Run two quoted programs
@ -573,19 +573,11 @@ Run two quoted programs
### Definition ### Definition
[i] dip i > \[[i]\] [dip] [i]
### Derivation
[P] [Q] b
[P] [Q] [i] dip i
[P] i [Q] i
P [Q] i
P Q
### Discussion ### Discussion
This combinator comes in handy. This combinator may seem trivial but it comes in handy.
### Crosslinks ### Crosslinks
@ -597,18 +589,18 @@ This combinator comes in handy.
## binary ## binary
(Combinator) Combinator
Run a quoted program using exactly two stack values and leave the first Run a quoted program using exactly two stack values and leave the first
item of the result on the stack. item of the result on the stack.
... y x [P] binary ... y x [P] binary
----------------------- -----------------------
... A ... a
### Definition ### Definition
unary popd > [unary] [popd]
### Discussion ### Discussion
@ -626,75 +618,54 @@ consuming exactly two items from the stack.
## bool ## bool
Basis Function Combinator Basis Function
bool(x) -\> bool Convert the item on the top of the stack to a Boolean value.
Returns True when the argument x is true, False otherwise. The builtins
True and False are the only two instances of the class bool. The class
bool is a subclass of the class int, and cannot be subclassed.
Gentzen diagram.
### Definition
if not basis.
### Derivation
if not basis.
### Source
if basis
### Discussion ### Discussion
Lorem ipsum. For integers 0 is `false` and any other number is `true`; for lists the
empty list is `false` and all other lists are `true`.
### Crosslinks ### Crosslinks
Lorem ipsum. [not]
------------------------------------------------------------------------ ------------------------------------------------------------------------
## branch ## branch
Basis Function Combinator Basis Combinator
Use a Boolean value to select one of two quoted programs to run. Use a Boolean value to select and run one of two quoted programs.
branch == roll< choice i
False [F] [T] branch false [F] [T] branch
-------------------------- --------------------------
F F
True [F] [T] branch true [F] [T] branch
------------------------- -------------------------
T T
Gentzen diagram.
### Definition ### Definition
if not basis. > [rolldown] [choice] [i]
### Derivation
if not basis.
### Source
if basis
### Discussion ### Discussion
Lorem ipsum. This is one of the fundamental operations (although it can be defined in
terms of [choice] as above). The more common "if..then..else" construct
[ifte] adds a predicate function that is evaluated [nullary].
### Crosslinks ### Crosslinks
Lorem ipsum. [choice]
[ifte]
[select]
------------------------------------------------------------------------ ------------------------------------------------------------------------