From 54491f0da2a3bff8bab9822be0d5a00266abeb65 Mon Sep 17 00:00:00 2001 From: Simon Forman Date: Sat, 14 Jul 2018 12:29:25 -0700 Subject: [PATCH] A little more bit o' docs. --- docs/Derivatives_of_Regular_Expressions.ipynb | 4 - docs/Makefile | 2 +- .../_build/html/_modules/joy/library.html | 62 +- docs/sphinx_docs/_build/html/genindex.html | 24 +- docs/sphinx_docs/_build/html/index.html | 2 +- docs/sphinx_docs/_build/html/library.html | 24 +- .../html/notebooks/Generator_Programs.html | 7 +- .../html/notebooks/Ordered_Binary_Trees.html | 4 +- .../html/notebooks/Recursion_Combinators.html | 8 +- .../_build/html/notebooks/Replacing.html | 4 +- .../_build/html/notebooks/index.html | 2 +- docs/sphinx_docs/_build/html/objects.inv | Bin 1701 -> 1751 bytes docs/sphinx_docs/_build/html/searchindex.js | 2 +- docs/sphinx_docs/_build/html/types.html | 37 +- .../Derivatives_of_Regular_Expressions.rst | 949 ++++++++++++++++++ .../notebooks/Generator_Programs.rst | 6 +- .../notebooks/Recursion_Combinators.rst | 2 +- .../notebooks/The_Four_Operations.rst | 337 +++++++ docs/sphinx_docs/notebooks/TypeChecking.rst | 172 ++++ docs/sphinx_docs/notebooks/omg.svg | 185 ++++ 20 files changed, 1702 insertions(+), 131 deletions(-) create mode 100644 docs/sphinx_docs/notebooks/Derivatives_of_Regular_Expressions.rst create mode 100644 docs/sphinx_docs/notebooks/The_Four_Operations.rst create mode 100644 docs/sphinx_docs/notebooks/TypeChecking.rst create mode 100644 docs/sphinx_docs/notebooks/omg.svg diff --git a/docs/Derivatives_of_Regular_Expressions.ipynb b/docs/Derivatives_of_Regular_Expressions.ipynb index 928cc58..d42699c 100644 --- a/docs/Derivatives_of_Regular_Expressions.ipynb +++ b/docs/Derivatives_of_Regular_Expressions.ipynb @@ -367,10 +367,6 @@ "metadata": {}, "outputs": [], "source": [ - "# This is the straightforward version with no \"compaction\".\n", - "# It works fine, but does waaaay too much work because the\n", - "# expressions grow each derivation.\n", - "\n", "def D(symbol):\n", "\n", " def derv(R):\n", diff --git a/docs/Makefile b/docs/Makefile index 9c7b6eb..763cddc 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -23,7 +23,7 @@ $(docs_rst): %.rst : %.ipynb python -m nbconvert --to rst $< -move_us = Generator_Programs.rst Newton-Raphson.rst Ordered_Binary_Trees.rst Quadratic.rst Recursion_Combinators.rst Replacing.rst Treestep.rst Types.rst Zipper.rst +move_us = Derivatives_of_Regular_Expressions.rst Generator_Programs.rst Newton-Raphson.rst Ordered_Binary_Trees.rst Quadratic.rst Recursion_Combinators.rst Replacing.rst The_Four_Operations.rst Treestep.rst TypeChecking.rst Types.rst Zipper.rst mov: $(move_us) cp -v $? ./sphinx_docs/notebooks/ diff --git a/docs/sphinx_docs/_build/html/_modules/joy/library.html b/docs/sphinx_docs/_build/html/_modules/joy/library.html index 1fee689..dc60009 100644 --- a/docs/sphinx_docs/_build/html/_modules/joy/library.html +++ b/docs/sphinx_docs/_build/html/_modules/joy/library.html @@ -104,7 +104,7 @@ ('pred', ['--']), ('rolldown', ['roll<']), ('rollup', ['roll>']), - ('id', ['•']), + ('id', [u'•']), ) @@ -141,7 +141,8 @@ run == [] swap infra sqr == dup mul size == 0 swap [pop ++] step -cleave == [i] app2 [popd] dip +fork == [i] app2 +cleave == fork [popd] dip average == [sum 1.0 *] [size] cleave / gcd == 1 [tuck modulus dup 0 >] loop pop least_fraction == dup [gcd] infra [div] concat map @@ -157,8 +158,9 @@ step_zero == 0 roll> step codireco == cons dip rest cons make_generator == [codireco] ccons +ifte == [nullary not] dipd branch ''' -# ifte == [nullary not] dipd branch +# # ifte == [nullary] dipd swap branch # genrec == [[genrec] cons cons cons cons] nullary swons concat ifte @@ -510,6 +512,8 @@ '''Clear everything from the stack. :: + clear == stack [pop stack] loop + ... clear --------------- @@ -991,32 +995,32 @@ return stack, concat(then if flag else else_, expression), dictionary -
[docs]@inscribe -@FunctionWrapper -def ifte(stack, expression, dictionary): - ''' - If-Then-Else Combinator - :: - - ... [if] [then] [else] ifte - --------------------------------------------------- - ... [[else] [then]] [...] [if] infra select i - - - - - ... [if] [then] [else] ifte - ------------------------------------------------------- - ... [else] [then] [...] [if] infra first choice i - - - Has the effect of grabbing a copy of the stack on which to run the - if-part using infra. - ''' - (else_, (then, (if_, stack))) = stack - expression = (S_infra, (S_first, (S_choice, (S_i, expression)))) - stack = (if_, (stack, (then, (else_, stack)))) - return stack, expression, dictionary
+##@inscribe +##@FunctionWrapper +##def ifte(stack, expression, dictionary): +## ''' +## If-Then-Else Combinator +## :: +## +## ... [if] [then] [else] ifte +## --------------------------------------------------- +## ... [[else] [then]] [...] [if] infra select i +## +## +## +## +## ... [if] [then] [else] ifte +## ------------------------------------------------------- +## ... [else] [then] [...] [if] infra first choice i +## +## +## Has the effect of grabbing a copy of the stack on which to run the +## if-part using infra. +## ''' +## (else_, (then, (if_, stack))) = stack +## expression = (S_infra, (S_first, (S_choice, (S_i, expression)))) +## stack = (if_, (stack, (then, (else_, stack)))) +## return stack, expression, dictionary
[docs]@inscribe diff --git a/docs/sphinx_docs/_build/html/genindex.html b/docs/sphinx_docs/_build/html/genindex.html index 288ec01..09d787a 100644 --- a/docs/sphinx_docs/_build/html/genindex.html +++ b/docs/sphinx_docs/_build/html/genindex.html @@ -75,16 +75,14 @@
  • add_aliases() (in module joy.library) -
  • -
  • add_def() (joy.library.DefinitionWrapper class method)