OSDN Git Service
(root)
/
joypy
/
Thun.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
626cc9a
)
A Python version of the `ii` combinator.
author
Simon Forman
<sforman@hushmail.com>
Sun, 28 Nov 2021 00:59:57 +0000
(16:59 -0800)
committer
Simon Forman
<sforman@hushmail.com>
Sun, 28 Nov 2021 00:59:57 +0000
(16:59 -0800)
joy/library.py
patch
|
blob
|
history
diff --git
a/joy/library.py
b/joy/library.py
index
f85c69e
..
800ff3b
100644
(file)
--- a/
joy/library.py
+++ b/
joy/library.py
@@
-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):
'''
::