diff --git a/Makefile b/Makefile index bfc2bae..90c3f7f 100644 --- a/Makefile +++ b/Makefile @@ -27,3 +27,6 @@ docs: cd ./docs && python -m nbconvert --to html *.ipynb cd ./docs && python -m nbconvert --to markdown *.ipynb cd ./docs && python -m nbconvert --to rst *.ipynb + + +%.md : %.ipynb ; diff --git a/docs/0. This Implementation of Joy in Python.ipynb b/docs/0. This Implementation of Joy in Python.ipynb index a97a93e..8b3ce7e 100644 --- a/docs/0. This Implementation of Joy in Python.ipynb +++ b/docs/0. This Implementation of Joy in Python.ipynb @@ -5,6 +5,7 @@ "metadata": {}, "source": [ "# Joypy\n", + "\n", "## Joy in Python\n", "\n", "This implementation is meant as a tool for exploring the programming model and method of Joy. Python seems like a great implementation language for Joy for several reasons.\n", diff --git a/docs/4. Replacing Functions in the Dictionary.html b/docs/4. Replacing Functions in the Dictionary.html deleted file mode 100644 index 6cfc928..0000000 --- a/docs/4. Replacing Functions in the Dictionary.html +++ /dev/null @@ -1,12084 +0,0 @@ - - -
-from notebook_preamble import D, J, V
-V('[23 18] average')
-sum and size with "compiled" versions.¶Both sum and size are catamorphisms, they each convert a sequence to a single value.
J('[sum] help')
-J('[size] help')
-We can use "compiled" versions (they're not really compiled in this case, they're hand-written in Python) to speed up evaluation and make the trace more readable. The sum function is already in the library. It gets shadowed by the definition version above during initialize().
from joy.library import SimpleFunctionWrapper, primitives
-from joy.utils.stack import iter_stack
-
-
-@SimpleFunctionWrapper
-def size(stack):
- '''Return the size of the sequence on the stack.'''
- sequence, stack = stack
- n = 0
- for _ in iter_stack(sequence):
- n += 1
- return n, stack
-
-
-sum_ = next(p for p in primitives if p.name == 'sum')
-Now we replace them old versions in the dictionary with the new versions and re-evaluate the expression.
- -old_sum, D['sum'] = D['sum'], sum_
-old_size, D['size'] = D['size'], size
-You can see that size and sum now execute in a single step.
V('[23 18] average')
-Look at the treatment of the Project Euler Problem One in Developing a Program.ipynb and you'll see that we might be interested in generating an endless cycle of:
+Look at the treatment of the Project Euler Problem One in the "Developing a Program" notebook and you'll see that we might be interested in generating an endless cycle of:
3 2 1 3 1 2 3
diff --git a/docs/Generator Programs.md b/docs/Generator Programs.md
index d22f64f..b10028c 100644
--- a/docs/Generator Programs.md
+++ b/docs/Generator Programs.md
@@ -164,7 +164,7 @@ J('23 [dup ++] G 5 [x] times')
## Generating Multiples of Three and Five
-Look at the treatment of the Project Euler Problem One in [Developing a Program.ipynb](./Developing a Program.ipynb) and you'll see that we might be interested in generating an endless cycle of:
+Look at the treatment of the Project Euler Problem One in the "Developing a Program" notebook and you'll see that we might be interested in generating an endless cycle of:
3 2 1 3 1 2 3
diff --git a/docs/Generator Programs.rst b/docs/Generator Programs.rst
index d5ee3ca..a201c0d 100644
--- a/docs/Generator Programs.rst
+++ b/docs/Generator Programs.rst
@@ -208,9 +208,9 @@ with the ``x`` combinator.
Generating Multiples of Three and Five
--------------------------------------
-Look at the treatment of the Project Euler Problem One in `Developing a
-Program.ipynb <./Developing%20a%20Program.ipynb>`__ and you'll see that
-we might be interested in generating an endless cycle of:
+Look at the treatment of the Project Euler Problem One in the
+"Developing a Program" notebook and you'll see that we might be
+interested in generating an endless cycle of:
::
diff --git a/docs/4. Replacing Functions in the Dictionary.ipynb b/docs/Replacing.ipynb
similarity index 99%
rename from docs/4. Replacing Functions in the Dictionary.ipynb
rename to docs/Replacing.ipynb
index c56d42b..fc1b436 100644
--- a/docs/4. Replacing Functions in the Dictionary.ipynb
+++ b/docs/Replacing.ipynb
@@ -26,9 +26,7 @@
{
"cell_type": "code",
"execution_count": 2,
- "metadata": {
- "scrolled": true
- },
+ "metadata": {},
"outputs": [
{
"name": "stdout",
diff --git a/docs/Zipper.html b/docs/Zipper.html
index cbab02b..70bff52 100644
--- a/docs/Zipper.html
+++ b/docs/Zipper.html
@@ -11778,14 +11778,6 @@ div#notebook {
This notebook is about using the "zipper" with joy datastructures. See the Zipper wikipedia entry or the original paper: "FUNCTIONAL PEARL The Zipper" by Gérard Huet
Given a datastructure on the stack we can navigate through it, modify it, and rebuild it using the "zipper" technique.
-