OSDN Git Service

Clean up Zipper notebook.
[joypy/Thun.git] / joy / library.py
index 1e29b88..800ff3b 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)
 
 
 #
@@ -785,6 +785,22 @@ def b(stack, expression, dictionary):
 
 @inscribe
 @FunctionWrapper
+def ii(stack, expression, dictionary):
+    '''
+    ::
+
+           ... a [Q] ii
+        ------------------
+            ... Q a Q
+
+    '''
+    quote, (a, stack) = stack
+    expression = concat(quote, (a, concat(quote, expression)))
+    return stack, expression, dictionary
+
+
+@inscribe
+@FunctionWrapper
 def dupdip(stack, expression, dictionary):
     '''
     ::