Add binary functions.

This commit is contained in:
Simon Forman
2018-08-02 14:22:42 -07:00
parent dae5126bfc
commit c88e00ecd0
2 changed files with 133 additions and 37 deletions
+10
View File
@@ -425,6 +425,16 @@ def parse(stack):
return expression, stack
@inscribe
@SimpleFunctionWrapper
def infer_(stack):
'''Attempt to infer the stack effect of a Joy expression.'''
E, stack = stack
effects = infer_expression(E)
e = list_to_stack([(fi, (fo, ())) for fi, fo in effects])
return e, stack
@inscribe
@sec2
@SimpleFunctionWrapper