diff options
Diffstat (limited to 'awk/forth/test.forth')
-rw-r--r-- | awk/forth/test.forth | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/awk/forth/test.forth b/awk/forth/test.forth index 1beedaf..daa6943 100644 --- a/awk/forth/test.forth +++ b/awk/forth/test.forth @@ -17,9 +17,9 @@ rot .s \ Should show 1 2 3 5 3 < . \ Should print 0 (false) 3 5 > . \ Should print 0 (false) -\ Test conditionals -10 20 if .s then \ Should print 1 2 (since the condition is true) -10 5 if .s else 1 then \ Should print 1 (since the condition is false) +\ Test conditionals within user-defined words +: test_if 10 20 if .s then ; \ Should print 1 2 (since the condition is true) +: test_else 10 5 if .s else 1 then ; \ Should print 1 (since the condition is false) \ Test user-defined words : square dup * ; \ Define a word to square a number |