That "fix" wasn't a fix.

It broke other stuff.  What I really wanted to do was change the stack
effect of 'clear'.
This commit is contained in:
Simon Forman 2018-07-15 14:06:10 -07:00
parent 20d87db9d5
commit c4af5682c4
1 changed files with 2 additions and 17 deletions

View File

@ -355,15 +355,10 @@ def type_check(name, stack):
except KeyError:
return # None, indicating unknown
stack = _foo_stack(stack)
for fi, fo in infer(func):
try:
U = unify(fi, stack)
except JoyTypeError, e:
#print e
continue
except ValueError, e:
except (JoyTypeError, ValueError), e:
#print >> sys.stderr, name, e, stack
continue
#print U
@ -371,16 +366,6 @@ def type_check(name, stack):
return False
def _foo_stack(stack, s=None):
if s is None:
s = (StackJoyType(n) for n in xrange(23, 100))
if stack == ():
return next(s)
if isinstance(stack, tuple):
return tuple(_foo_stack(inner, s) for inner in stack)
return stack
a0, a1, a2, a3, a4, a5, a6, a7, a8, a9 = A
b0, b1, b2, b3, b4, b5, b6, b7, b8, b9 = B
n0, n1, n2, n3, n4, n5, n6, n7, n8, n9 = N
@ -414,7 +399,7 @@ def defs():
sum_ = product = [(((Ns[1], s1), s0), (n0, s0))]
clear = [((As[1], s0), s1)]
clear = [(s0, s1)]
add = mul = sub = floordiv = modulus = [
((i2, (i1, s0)), (i3, s0)),