Fixes: #38238 rename pushback to concat.

This commit is contained in:
Simon Forman 2020-04-24 17:12:46 -07:00
parent 9f55b5f4d8
commit ff6d427b2f
2 changed files with 41 additions and 49 deletions

View File

@ -133,7 +133,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 6, "execution_count": 1,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -423,9 +423,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 12, "execution_count": 12,
"metadata": { "metadata": {},
"collapsed": true
},
"outputs": [ "outputs": [
{ {
"name": "stdout", "name": "stdout",
@ -459,9 +457,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 13, "execution_count": 13,
"metadata": { "metadata": {},
"collapsed": true
},
"outputs": [ "outputs": [
{ {
"name": "stdout", "name": "stdout",
@ -535,9 +531,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 15, "execution_count": 15,
"metadata": { "metadata": {},
"collapsed": true
},
"outputs": [ "outputs": [
{ {
"name": "stdout", "name": "stdout",
@ -609,9 +603,7 @@
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 17, "execution_count": 17,
"metadata": { "metadata": {},
"collapsed": true
},
"outputs": [ "outputs": [
{ {
"name": "stdout", "name": "stdout",
@ -906,12 +898,12 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 11, "execution_count": 30,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
"from joy.library import FunctionWrapper\n", "from joy.library import FunctionWrapper\n",
"from joy.utils.stack import pushback\n", "from joy.utils.stack import concat\n",
"from notebook_preamble import D\n", "from notebook_preamble import D\n",
"\n", "\n",
"\n", "\n",
@ -934,7 +926,7 @@
" L\n", " L\n",
" '''\n", " '''\n",
" L, (E, (G, (b, (a, stack)))) = stack\n", " L, (E, (G, (b, (a, stack)))) = stack\n",
" expression = pushback(G if a > b else L if a < b else E, expression)\n", " expression = concat(G if a > b else L if a < b else E, expression)\n",
" return stack, expression, dictionary\n", " return stack, expression, dictionary\n",
"\n", "\n",
"\n", "\n",
@ -943,7 +935,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 14, "execution_count": 31,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -992,7 +984,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 31, "execution_count": 32,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -1009,7 +1001,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 32, "execution_count": 33,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -1026,7 +1018,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 33, "execution_count": 34,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -1043,7 +1035,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 34, "execution_count": 35,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -1064,7 +1056,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 35, "execution_count": 36,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -1081,7 +1073,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 36, "execution_count": 37,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -1098,7 +1090,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 37, "execution_count": 38,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -1115,7 +1107,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 38, "execution_count": 39,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -1132,7 +1124,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 39, "execution_count": 40,
"metadata": { "metadata": {
"scrolled": true "scrolled": true
}, },
@ -1265,7 +1257,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 40, "execution_count": 41,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -1274,7 +1266,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 41, "execution_count": 42,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -1398,7 +1390,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 42, "execution_count": 43,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -1421,7 +1413,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 43, "execution_count": 44,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -1438,7 +1430,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 44, "execution_count": 45,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -1455,7 +1447,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 45, "execution_count": 46,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -1886,7 +1878,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 20, "execution_count": 47,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -1909,7 +1901,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 23, "execution_count": 48,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -1926,7 +1918,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 24, "execution_count": 49,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -1943,7 +1935,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 25, "execution_count": 50,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -1960,7 +1952,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 26, "execution_count": 51,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -1977,7 +1969,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 30, "execution_count": 52,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -2121,7 +2113,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 46, "execution_count": 53,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -2150,7 +2142,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 47, "execution_count": 54,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -2167,7 +2159,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 48, "execution_count": 55,
"metadata": { "metadata": {
"scrolled": true "scrolled": true
}, },
@ -2186,7 +2178,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 49, "execution_count": 56,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -2235,7 +2227,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 50, "execution_count": 57,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -2244,7 +2236,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 51, "execution_count": 58,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -2261,7 +2253,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 52, "execution_count": 59,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -2314,7 +2306,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 53, "execution_count": 60,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
@ -2351,7 +2343,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 57, "execution_count": 61,
"metadata": { "metadata": {
"scrolled": true "scrolled": true
}, },
@ -2391,7 +2383,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 55, "execution_count": 62,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {

View File

@ -224,7 +224,7 @@ Many of the functions are defined in Python, like ``dip``:
def dip(stack, expression, dictionary): def dip(stack, expression, dictionary):
(quote, (x, stack)) = stack (quote, (x, stack)) = stack
expression = x, expression expression = x, expression
return stack, pushback(quote, expression), dictionary return stack, concat(quote, expression), dictionary
Some functions are defined in equations in terms of other functions. Some functions are defined in equations in terms of other functions.