aboutsummaryrefslogtreecommitdiff
path: root/forth/printer.fs
diff options
context:
space:
mode:
authorChouser <chouser@n01se.net>2015-02-15 13:33:44 -0500
committerChouser <chouser@n01se.net>2015-02-21 13:22:44 -0500
commit60801ed68d5b2c6630c83883de150ccce98767f9 (patch)
tree5f37431cd6610050e456401be5990004a70dfea6 /forth/printer.fs
parent79feb89f9c75d30e79b9ef13fa40d2f8e22f4b9b (diff)
downloadmal-60801ed68d5b2c6630c83883de150ccce98767f9.tar.gz
mal-60801ed68d5b2c6630c83883de150ccce98767f9.zip
forth: Add step 4, but not varargs
Diffstat (limited to 'forth/printer.fs')
-rw-r--r--forth/printer.fs21
1 files changed, 11 insertions, 10 deletions
diff --git a/forth/printer.fs b/forth/printer.fs
index 78ac197..39ddb8e 100644
--- a/forth/printer.fs
+++ b/forth/printer.fs
@@ -67,10 +67,9 @@ MalDefault
s" >" str-append ;;
drop
-MalNil
- extend pr-buf
- drop s" nil" str-append ;;
-drop
+MalNil extend pr-buf drop s" nil" str-append ;; drop
+MalTrue extend pr-buf drop s" true" str-append ;; drop
+MalFalse extend pr-buf drop s" false" str-append ;; drop
MalList
extend pr-buf
@@ -78,12 +77,14 @@ MalList
rot pr-seq-buf
s" )" str-append ;;
extend pr-seq-buf { list }
- list MalList/start @ { start }
- start @ pr-buf
- list MalList/count @ 1 ?do
- a-space
- start i cells + @ pr-buf
- loop ;;
+ list MalList/count @ 0 > if
+ list MalList/start @ { start }
+ start @ pr-buf
+ list MalList/count @ 1 ?do
+ a-space
+ start i cells + @ pr-buf
+ loop
+ endif ;;
extend pr-pairs-buf { list }
list MalList/start @ { start }
start @ pr-buf a-space start cell+ @ pr-buf