added the rest of the comparison operations...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2014-02-10 16:51:47 +04:00
parent de9737ec55
commit 6f24dc981f

View File

@ -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 ] ]',
'',
'',