A Python version of the `ii` combinator.

This commit is contained in:
Simon Forman 2021-11-27 16:59:57 -08:00
parent 626cc9aefd
commit dafdb9d620
1 changed files with 16 additions and 0 deletions

View File

@ -783,6 +783,22 @@ def b(stack, 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
@FunctionWrapper
def dupdip(stack, expression, dictionary):