The M's.
This commit is contained in:
parent
7863ba8856
commit
c39d6123a9
|
|
@ -2,28 +2,36 @@
|
||||||
|
|
||||||
## make_generator
|
## make_generator
|
||||||
|
|
||||||
Basis Function Combinator
|
Function
|
||||||
|
|
||||||
\[codireco\] ccons
|
Given an initial state value and a quoted generator function build a
|
||||||
|
generator quote.
|
||||||
|
|
||||||
Gentzen diagram.
|
state [generator function] make_generator
|
||||||
|
-----------------------------------------------
|
||||||
|
[state [generator function] codireco]
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
230 [dup ++] make_generator
|
||||||
|
---------------------------------
|
||||||
|
[230 [dup ++] codireco]
|
||||||
|
|
||||||
|
And then:
|
||||||
|
|
||||||
|
[230 [dup ++] codireco] 5 [x] times pop
|
||||||
|
---------------------------------------------
|
||||||
|
230 231 232 233 234
|
||||||
|
|
||||||
### Definition
|
### Definition
|
||||||
|
|
||||||
if not basis.
|
> \[[codireco]\] [ccons]
|
||||||
|
|
||||||
### Derivation
|
|
||||||
|
|
||||||
if not basis.
|
|
||||||
|
|
||||||
### Source
|
|
||||||
|
|
||||||
if basis
|
|
||||||
|
|
||||||
### Discussion
|
### Discussion
|
||||||
|
|
||||||
Lorem ipsum.
|
See the ["Using `x` to Generate Values" notebook](https://joypy.osdn.io/notebooks/Generator_Programs.html#an-interesting-variation).
|
||||||
|
|
||||||
### Crosslinks
|
### Crosslinks
|
||||||
|
|
||||||
Lorem ipsum.
|
[codireco]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,29 +2,28 @@
|
||||||
|
|
||||||
## map
|
## map
|
||||||
|
|
||||||
Basis Function Combinator
|
Combinator
|
||||||
|
|
||||||
Run the quoted program on TOS on the items in the list under it, push a
|
Given a list of items and a quoted program run the program for each item
|
||||||
new list with the results in place of the program and original list.
|
in the list (with the rest of the stack) and replace the old list and the
|
||||||
|
program with a list of the results.
|
||||||
|
|
||||||
Gentzen diagram.
|
### Example
|
||||||
|
|
||||||
### Definition
|
5 [1 2 3] [++ *] map
|
||||||
|
--------------------------
|
||||||
if not basis.
|
5 [10 15 20]
|
||||||
|
|
||||||
### Derivation
|
|
||||||
|
|
||||||
if not basis.
|
|
||||||
|
|
||||||
### Source
|
|
||||||
|
|
||||||
if basis
|
|
||||||
|
|
||||||
### Discussion
|
### Discussion
|
||||||
|
|
||||||
Lorem ipsum.
|
This is a common operation in many languages. In Joy it can be a
|
||||||
|
parallelism combinator due to the "pure" nature of the language.
|
||||||
|
|
||||||
### Crosslinks
|
### Crosslinks
|
||||||
|
|
||||||
Lorem ipsum.
|
[app1]
|
||||||
|
[app2]
|
||||||
|
[app3]
|
||||||
|
[appN](#appn)
|
||||||
|
[fork]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,28 +2,19 @@
|
||||||
|
|
||||||
## max
|
## max
|
||||||
|
|
||||||
Basis Function Combinator
|
Basis Function
|
||||||
|
|
||||||
Given a list find the maximum.
|
Given a list find the maximum.
|
||||||
|
|
||||||
Gentzen diagram.
|
### Example
|
||||||
|
|
||||||
### Definition
|
[1 2 3 4] max
|
||||||
|
-------------------
|
||||||
if not basis.
|
4
|
||||||
|
|
||||||
### Derivation
|
|
||||||
|
|
||||||
if not basis.
|
|
||||||
|
|
||||||
### Source
|
|
||||||
|
|
||||||
if basis
|
|
||||||
|
|
||||||
### Discussion
|
|
||||||
|
|
||||||
Lorem ipsum.
|
|
||||||
|
|
||||||
### Crosslinks
|
### Crosslinks
|
||||||
|
|
||||||
Lorem ipsum.
|
[min]
|
||||||
|
[size]
|
||||||
|
[sum]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,28 +2,19 @@
|
||||||
|
|
||||||
## min
|
## min
|
||||||
|
|
||||||
Basis Function Combinator
|
Basis Function
|
||||||
|
|
||||||
Given a list find the minimum.
|
Given a list find the minimum.
|
||||||
|
|
||||||
Gentzen diagram.
|
### Example
|
||||||
|
|
||||||
### Definition
|
[1 2 3 4] min
|
||||||
|
-------------------
|
||||||
if not basis.
|
1
|
||||||
|
|
||||||
### Derivation
|
|
||||||
|
|
||||||
if not basis.
|
|
||||||
|
|
||||||
### Source
|
|
||||||
|
|
||||||
if basis
|
|
||||||
|
|
||||||
### Discussion
|
|
||||||
|
|
||||||
Lorem ipsum.
|
|
||||||
|
|
||||||
### Crosslinks
|
### Crosslinks
|
||||||
|
|
||||||
Lorem ipsum.
|
[max]
|
||||||
|
[size]
|
||||||
|
[sum]
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -2122,152 +2122,129 @@ stack, replacing them with a Boolean value.
|
||||||
|
|
||||||
## make_generator
|
## make_generator
|
||||||
|
|
||||||
Basis Function Combinator
|
Function
|
||||||
|
|
||||||
\[codireco\] ccons
|
Given an initial state value and a quoted generator function build a
|
||||||
|
generator quote.
|
||||||
|
|
||||||
Gentzen diagram.
|
state [generator function] make_generator
|
||||||
|
-----------------------------------------------
|
||||||
|
[state [generator function] codireco]
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
230 [dup ++] make_generator
|
||||||
|
---------------------------------
|
||||||
|
[230 [dup ++] codireco]
|
||||||
|
|
||||||
|
And then:
|
||||||
|
|
||||||
|
[230 [dup ++] codireco] 5 [x] times pop
|
||||||
|
---------------------------------------------
|
||||||
|
230 231 232 233 234
|
||||||
|
|
||||||
### Definition
|
### Definition
|
||||||
|
|
||||||
if not basis.
|
> \[[codireco]\] [ccons]
|
||||||
|
|
||||||
### Derivation
|
|
||||||
|
|
||||||
if not basis.
|
|
||||||
|
|
||||||
### Source
|
|
||||||
|
|
||||||
if basis
|
|
||||||
|
|
||||||
### Discussion
|
### Discussion
|
||||||
|
|
||||||
Lorem ipsum.
|
See the ["Using `x` to Generate Values" notebook](https://joypy.osdn.io/notebooks/Generator_Programs.html#an-interesting-variation).
|
||||||
|
|
||||||
### Crosslinks
|
### Crosslinks
|
||||||
|
|
||||||
Lorem ipsum.
|
[codireco]
|
||||||
|
|
||||||
|
|
||||||
------------------------------------------------------------------------
|
------------------------------------------------------------------------
|
||||||
|
|
||||||
## map
|
## map
|
||||||
|
|
||||||
Basis Function Combinator
|
Combinator
|
||||||
|
|
||||||
Run the quoted program on TOS on the items in the list under it, push a
|
Given a list of items and a quoted program run the program for each item
|
||||||
new list with the results in place of the program and original list.
|
in the list (with the rest of the stack) and replace the old list and the
|
||||||
|
program with a list of the results.
|
||||||
|
|
||||||
Gentzen diagram.
|
### Example
|
||||||
|
|
||||||
### Definition
|
5 [1 2 3] [++ *] map
|
||||||
|
--------------------------
|
||||||
if not basis.
|
5 [10 15 20]
|
||||||
|
|
||||||
### Derivation
|
|
||||||
|
|
||||||
if not basis.
|
|
||||||
|
|
||||||
### Source
|
|
||||||
|
|
||||||
if basis
|
|
||||||
|
|
||||||
### Discussion
|
### Discussion
|
||||||
|
|
||||||
Lorem ipsum.
|
This is a common operation in many languages. In Joy it can be a
|
||||||
|
parallelism combinator due to the "pure" nature of the language.
|
||||||
|
|
||||||
### Crosslinks
|
### Crosslinks
|
||||||
|
|
||||||
Lorem ipsum.
|
[app1]
|
||||||
|
[app2]
|
||||||
|
[app3]
|
||||||
|
[appN](#appn)
|
||||||
|
[fork]
|
||||||
|
|
||||||
|
|
||||||
------------------------------------------------------------------------
|
------------------------------------------------------------------------
|
||||||
|
|
||||||
## max
|
## max
|
||||||
|
|
||||||
Basis Function Combinator
|
Basis Function
|
||||||
|
|
||||||
Given a list find the maximum.
|
Given a list find the maximum.
|
||||||
|
|
||||||
Gentzen diagram.
|
### Example
|
||||||
|
|
||||||
### Definition
|
[1 2 3 4] max
|
||||||
|
-------------------
|
||||||
if not basis.
|
4
|
||||||
|
|
||||||
### Derivation
|
|
||||||
|
|
||||||
if not basis.
|
|
||||||
|
|
||||||
### Source
|
|
||||||
|
|
||||||
if basis
|
|
||||||
|
|
||||||
### Discussion
|
|
||||||
|
|
||||||
Lorem ipsum.
|
|
||||||
|
|
||||||
### Crosslinks
|
### Crosslinks
|
||||||
|
|
||||||
Lorem ipsum.
|
[min]
|
||||||
|
[size]
|
||||||
|
[sum]
|
||||||
|
|
||||||
|
|
||||||
------------------------------------------------------------------------
|
------------------------------------------------------------------------
|
||||||
|
|
||||||
## min
|
## min
|
||||||
|
|
||||||
Basis Function Combinator
|
Basis Function
|
||||||
|
|
||||||
Given a list find the minimum.
|
Given a list find the minimum.
|
||||||
|
|
||||||
Gentzen diagram.
|
### Example
|
||||||
|
|
||||||
### Definition
|
[1 2 3 4] min
|
||||||
|
-------------------
|
||||||
if not basis.
|
1
|
||||||
|
|
||||||
### Derivation
|
|
||||||
|
|
||||||
if not basis.
|
|
||||||
|
|
||||||
### Source
|
|
||||||
|
|
||||||
if basis
|
|
||||||
|
|
||||||
### Discussion
|
|
||||||
|
|
||||||
Lorem ipsum.
|
|
||||||
|
|
||||||
### Crosslinks
|
### Crosslinks
|
||||||
|
|
||||||
Lorem ipsum.
|
[max]
|
||||||
|
[size]
|
||||||
|
[sum]
|
||||||
|
|
||||||
|
|
||||||
------------------------------------------------------------------------
|
------------------------------------------------------------------------
|
||||||
|
|
||||||
## mod
|
## mod
|
||||||
|
|
||||||
Basis Function Combinator
|
Basis Function
|
||||||
|
|
||||||
Same as a % b.
|
Return the remainder of `a` divided by `b`.
|
||||||
|
|
||||||
Gentzen diagram.
|
a b mod
|
||||||
|
-------------
|
||||||
### Definition
|
(a%b)
|
||||||
|
|
||||||
if not basis.
|
|
||||||
|
|
||||||
### Derivation
|
|
||||||
|
|
||||||
if not basis.
|
|
||||||
|
|
||||||
### Source
|
|
||||||
|
|
||||||
if basis
|
|
||||||
|
|
||||||
### Discussion
|
|
||||||
|
|
||||||
Lorem ipsum.
|
|
||||||
|
|
||||||
### Crosslinks
|
### Crosslinks
|
||||||
|
|
||||||
Lorem ipsum.
|
[divmod]
|
||||||
|
[mul]
|
||||||
|
|
||||||
|
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
|
|
@ -2280,31 +2257,19 @@ See [mod](#mod).
|
||||||
|
|
||||||
## mul
|
## mul
|
||||||
|
|
||||||
Basis Function Combinator
|
Basis Function
|
||||||
|
|
||||||
Same as a \* b.
|
Multiply two numbers.
|
||||||
|
|
||||||
Gentzen diagram.
|
a b mul
|
||||||
|
-------------
|
||||||
### Definition
|
(a×b)
|
||||||
|
|
||||||
if not basis.
|
|
||||||
|
|
||||||
### Derivation
|
|
||||||
|
|
||||||
if not basis.
|
|
||||||
|
|
||||||
### Source
|
|
||||||
|
|
||||||
if basis
|
|
||||||
|
|
||||||
### Discussion
|
|
||||||
|
|
||||||
Lorem ipsum.
|
|
||||||
|
|
||||||
### Crosslinks
|
### Crosslinks
|
||||||
|
|
||||||
Lorem ipsum.
|
[div]
|
||||||
|
[product]
|
||||||
|
|
||||||
|
|
||||||
------------------------------------------------------------------------
|
------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,28 +2,16 @@
|
||||||
|
|
||||||
## mod
|
## mod
|
||||||
|
|
||||||
Basis Function Combinator
|
Basis Function
|
||||||
|
|
||||||
Same as a % b.
|
Return the remainder of `a` divided by `b`.
|
||||||
|
|
||||||
Gentzen diagram.
|
a b mod
|
||||||
|
-------------
|
||||||
### Definition
|
(a%b)
|
||||||
|
|
||||||
if not basis.
|
|
||||||
|
|
||||||
### Derivation
|
|
||||||
|
|
||||||
if not basis.
|
|
||||||
|
|
||||||
### Source
|
|
||||||
|
|
||||||
if basis
|
|
||||||
|
|
||||||
### Discussion
|
|
||||||
|
|
||||||
Lorem ipsum.
|
|
||||||
|
|
||||||
### Crosslinks
|
### Crosslinks
|
||||||
|
|
||||||
Lorem ipsum.
|
[divmod]
|
||||||
|
[mul]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,28 +2,16 @@
|
||||||
|
|
||||||
## mul
|
## mul
|
||||||
|
|
||||||
Basis Function Combinator
|
Basis Function
|
||||||
|
|
||||||
Same as a \* b.
|
Multiply two numbers.
|
||||||
|
|
||||||
Gentzen diagram.
|
a b mul
|
||||||
|
-------------
|
||||||
### Definition
|
(a×b)
|
||||||
|
|
||||||
if not basis.
|
|
||||||
|
|
||||||
### Derivation
|
|
||||||
|
|
||||||
if not basis.
|
|
||||||
|
|
||||||
### Source
|
|
||||||
|
|
||||||
if basis
|
|
||||||
|
|
||||||
### Discussion
|
|
||||||
|
|
||||||
Lorem ipsum.
|
|
||||||
|
|
||||||
### Crosslinks
|
### Crosslinks
|
||||||
|
|
||||||
Lorem ipsum.
|
[div]
|
||||||
|
[product]
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue