This brings Python Joy into congruence with Nim.
It's hacky. I edited the generated file. The more complicated functions like popop will not generate the same errors as the Nim versions. This is only congruence in the sense that the current jtest suite passes identically on both. Ideally I should be generating both the Nim and Python code from the Prolog compiler.
This commit is contained in:
@@ -67,10 +67,10 @@ def cons(stack):
|
||||
|
||||
"""
|
||||
try: s0, stack = stack
|
||||
except ValueError: raise StackUnderflowError
|
||||
if not isinstance(s0, tuple): raise NotAListError
|
||||
except ValueError: raise StackUnderflowError('Not enough values on stack.')
|
||||
if not isinstance(s0, tuple): raise NotAListError('Not a list.')
|
||||
try: a1, s23 = stack
|
||||
except ValueError: raise StackUnderflowError
|
||||
except ValueError: raise StackUnderflowError('Not enough values on stack.')
|
||||
return ((a1, s0), s23)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user