From 1cc9bd9d82f970aba524ff57d9b67e9efac47ce9 Mon Sep 17 00:00:00 2001 From: dan Date: Fri, 26 May 2023 20:58:11 -0400 Subject: fix: js forth not statement so that string "0" inverts to true --- forth.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/forth.js b/forth.js index 3c7c0d2..5cea76f 100644 --- a/forth.js +++ b/forth.js @@ -48,7 +48,7 @@ function forth(print = console.log) { return localIdx - initialIdx; } }, - 'not' : () => { s.push(!s.pop()) }, + 'not' : () => { s.push(!popNum()) }, '.' : () => { print(s.pop()) }, 'peek' : () => { print(s[s.length - 1]) }, 'dup' : () => { -- cgit v1.2.3