Update some of the docs.

This commit is contained in:
Simon Forman
2020-05-20 19:15:47 -07:00
parent 6a6b63bf62
commit ffabda0407
60 changed files with 5182 additions and 5853 deletions
+37 -16
View File
@@ -209,7 +209,7 @@
"\n",
" F == [P] [T] [R1] primrec\n",
" \n",
" F == [popop !size! >=] [roll< pop] [get_value incr_value add_value incr_step_count] primrec"
" F == [popop !size! >=] [roll< pop] [get_value incr_value add_value incr_step_count] tailrec"
]
},
{
@@ -223,12 +223,12 @@
"\n",
"DefinitionWrapper.add_definitions('''\n",
"\n",
" get_value == [roll< at] nullary\n",
" incr_value == [[popd incr_at] unary] dip\n",
" add_value == [+] cons dipd\n",
"incr_step_count == [++] dip\n",
" get_value [roll< at] nullary\n",
" incr_value [[popd incr_at] unary] dip\n",
" add_value [+] cons dipd\n",
"incr_step_count [++] dip\n",
"\n",
" AoC2017.5.0 == get_value incr_value add_value incr_step_count\n",
" AoC2017.5.0 get_value incr_value add_value incr_step_count\n",
"\n",
"''', D)"
]
@@ -239,12 +239,33 @@
"metadata": {},
"outputs": [],
"source": [
"define('F == [popop 5 >=] [roll< popop] [AoC2017.5.0] primrec')"
"from joy.library import DefinitionWrapper\n",
"\n",
"\n",
"DefinitionWrapper.add_definitions('''\n",
"\n",
" get_value [roll< at] nullary\n",
" incr_value [[popd incr_at] unary] dip\n",
" add_value [+] cons dipd\n",
"incr_step_count [++] dip\n",
"\n",
" AoC2017.5.0 get_value incr_value add_value incr_step_count\n",
"\n",
"''', D)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"define('F [popop 5 >=] [roll< popop] [AoC2017.5.0] tailrec')"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"scrolled": true
},
@@ -294,25 +315,25 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
"DefinitionWrapper.add_definitions('''\n",
"\n",
"init-index-and-step-count == 0 0 roll<\n",
" prepare-predicate == dup size [>=] cons [popop] swoncat\n",
"init-index-and-step-count 0 0 roll<\n",
"prepare-predicate dup size [>=] cons [popop] swoncat\n",
"\n",
" AoC2017.5.preamble == init-index-and-step-count prepare-predicate\n",
"AoC2017.5.preamble init-index-and-step-count prepare-predicate\n",
"\n",
" AoC2017.5 == AoC2017.5.preamble [roll< popop] [AoC2017.5.0] primrec\n",
"AoC2017.5 AoC2017.5.preamble [roll< popop] [AoC2017.5.0] tailrec\n",
"\n",
"''', D)"
]
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 8,
"metadata": {
"scrolled": false
},
@@ -365,14 +386,14 @@
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.13"
"pygments_lexer": "ipython3",
"version": "3.8.3"
}
},
"nbformat": 4,