about summary refs log tree commit diff stats
path: root/chibi
diff options
context:
space:
mode:
authorelioat <elioat@tilde.institute>2022-10-08 00:12:25 +0000
committerelioat <elioat@tilde.institute>2022-10-08 00:12:25 +0000
commit843db0701933f5899f9de17be409a4167f99b078 (patch)
treef36e018f4e6f52247299f076074fb010cfe38391 /chibi
parentf7dc77b3763ac444fa54e110639fadc6ba70174b (diff)
downloadtour-843db0701933f5899f9de17be409a4167f99b078.tar.gz
*
Diffstat (limited to 'chibi')
-rw-r--r--chibi/print.scm28
1 files changed, 28 insertions, 0 deletions
diff --git a/chibi/print.scm b/chibi/print.scm
new file mode 100644
index 0000000..d3af299
--- /dev/null
+++ b/chibi/print.scm
@@ -0,0 +1,28 @@
+(define-library (print)
+  (import (scheme base)
+          (scheme write))
+
+  (export print
+          println
+          prints
+          printsln)
+  (begin
+    ;; Print arguments.
+    (define (print . args)
+      (for-each display args))
+
+    ;; Print arguments, space separated.
+    (define (prints . args)
+      (for-each (lambda (s)
+                  (display s)
+                  (display " ")) args))
+
+    ;; Print arguments and a newline.
+    (define (println . args)
+      (apply print args)
+      (newline))
+
+    ;; Print arguments, space separated, newline.
+    (define (printsln . args)
+      (apply prints args)
+      (newline))))