OSDN Git Service

Working on bug #15
authorSimon Forman <sforman@hushmail.com>
Sun, 28 Nov 2021 21:41:19 +0000 (13:41 -0800)
committerSimon Forman <sforman@hushmail.com>
Sun, 28 Nov 2021 21:41:19 +0000 (13:41 -0800)
https://todo.sr.ht/~sforman/thun-der/15

docs/Zipper.ipynb
joy/library.py

index 9ad3174..6b98413 100644 (file)
   },
   {
    "cell_type": "code",
-   "execution_count": 15,
+   "execution_count": 4,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": []
+    }
+   ],
+   "source": [
+    "clear"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 2,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "[Q] [dip dip infra dip infra dip infra]"
+     ]
+    }
+   ],
+   "source": [
+    "[Q] [dip dip infra dip infra dip infra]"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "[unit cons] step"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "So that's broken with the current definition of `step` but this works:"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 6,
    "metadata": {},
    "outputs": [
     {
   },
   {
    "cell_type": "code",
+   "execution_count": 7,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "[Q] [[dip] [dip] [infra] [dip] [infra] [dip] [infra]]"
+     ]
+    }
+   ],
+   "source": [
+    "[Q] [[dip] [dip] [infra] [dip] [infra] [dip] [infra]]"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 8,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "[[[[[[[[Q] dip] dip] infra] dip] infra] dip] infra]"
+     ]
+    }
+   ],
+   "source": [
+    "[cons] step"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "Do I want to revisit `step` def?  Insist that `Z` use `[[A][B][C]...]` rather than `[A B C ...]`?  Seems clunky, special-cased, and not in the spirit of the thing, eh?\n",
+    "\n",
+    "Arguably,\n",
+    "\n",
+    "    [dip dip infra dip infra dip infra] [unit cons] step\n",
+    "\n",
+    "*should* work, yes?\n",
+    "\n",
+    "\n",
+    "           ... [] [Q] . step\n",
+    "        -----------------------\n",
+    "              ... .\n",
+    "\n",
+    "\n",
+    "           ... [a] [Q] . step\n",
+    "        ------------------------\n",
+    "             ... a . Q\n",
+    "\n",
+    "\n",
+    "           ... [a b c] [Q] . step\n",
+    "        ----------------------------------------\n",
+    "                 ... a . Q [b c] [Q] step\n",
+    "\n"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 9,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": []
+    }
+   ],
+   "source": [
+    "clear"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 10,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "[dip dip infra dip infra dip infra]"
+     ]
+    }
+   ],
+   "source": [
+    "[dip dip infra dip infra dip infra]"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 11,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "[[dip] dip infra dip infra dip infra]"
+     ]
+    }
+   ],
+   "source": [
+    "[unit] infra"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": []
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": []
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": []
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": []
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": []
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": []
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": []
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": []
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": []
+  },
+  {
+   "cell_type": "code",
    "execution_count": 6,
    "metadata": {},
    "outputs": [
index 800ff3b..393760f 100644 (file)
@@ -201,9 +201,9 @@ class Def(object):
             if line.lstrip().startswith('#'):
                 continue
             name, body = text_to_expression(line)
-            if name not in dictionary:
-                inscribe(class_(name, body), dictionary)
-##            inscribe(class_(name, body), dictionary)
+##            if name not in dictionary:
+##                inscribe(class_(name, body), dictionary)
+            inscribe(class_(name, body), dictionary)
 
 
 #