Correct swaack.

This commit is contained in:
Simon Forman 2021-04-09 17:46:45 -07:00
parent e417842923
commit 7957136ac3
1 changed files with 6 additions and 1 deletions

View File

@ -324,7 +324,12 @@ def swaack(stack):
([...1] -- [...0])
"""
(s1, s0) = stack
try:
(s1, s0) = stack
except ValueError:
raise StackUnderflowError('Not enough values on stack.')
if not isinstance(s1, tuple):
raise NotAListError('Not a list.')
return (s0, s1)