From 6f24dc981fd292253b88c5a56511298bf22cb88a Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Mon, 10 Feb 2014 16:51:47 +0400 Subject: [PATCH] added the rest of the comparison operations... Signed-off-by: Alex A. Naanou --- Slang/slang.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Slang/slang.js b/Slang/slang.js index 843f1fe..1414904 100755 --- a/Slang/slang.js +++ b/Slang/slang.js @@ -632,13 +632,17 @@ var BOOTSTRAP = [ ':: . ( x -- ) [ drop ]', ':: .. ( x -- ) [ print drop ]', '', -':: ne ( a -- b ) [ eq not ]', ':: isT ( a -- b ) [ not not true eq ]', ':: isF ( a -- b ) [ not isT ]', '', +'-- we already have gt and eq, now let\'s define the rest...', +':: ne ( a b -- c ) [ eq not ]', +':: lt ( a b -- c ) [ dup2 eq not rot gt not tor and ]', +':: ge ( a b -- c ) [ dup2 eq rot gt or ]', +':: le ( a b -- c ) [ gt not ]', +'', ':: inc ( a -- b ) [ 1 add ]', ':: dec ( a -- b ) [ 1 sub ]', -'', ':: ! ( a -- b ) [ [ dup 1 ne ] ? [ dup 1 sub ! mul ] ]', '', '',