diff --git a/vm/nga-python/retro.py b/vm/nga-python/retro.py index 822dba6..39d2eab 100644 --- a/vm/nga-python/retro.py +++ b/vm/nga-python/retro.py @@ -51,6 +51,7 @@ class Retro: self.Cached["interpreter"] = self.map_in("interpret") self.Cached["not_found"] = self.map_in("err:notfound") self.Cached["s:eq?"] = self.map_in("s:eq?") + self.Cached["s:to-number"] = self.map_in("s:to-number") self.Cached["d:lookup"] = self.map_in("d:lookup") self.instructions = [ @@ -439,6 +440,10 @@ class Retro: self.stack.push(header) self.memory.store(header, self.Cached["d:lookup"] - 20) # "which" self.ip = self.address.pop() + elif self.ip == self.Cached["s:to-number"]: + n = self.extract_string(self.stack.pop()) + self.stack.push(int(n)) + self.ip = self.address.pop() else: if self.ip == notfound: print("ERROR: word not found!")