A Python version of the `ii` combinator.
This commit is contained in:
parent
626cc9aefd
commit
dafdb9d620
|
|
@ -783,6 +783,22 @@ def b(stack, expression, dictionary):
|
||||||
return stack, concat(p, concat(q, expression)), dictionary
|
return stack, concat(p, concat(q, 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
|
@inscribe
|
||||||
@FunctionWrapper
|
@FunctionWrapper
|
||||||
def dupdip(stack, expression, dictionary):
|
def dupdip(stack, expression, dictionary):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue