diff options
author | eli-oat <hi@eli.li> | 2022-10-09 14:33:01 -0400 |
---|---|---|
committer | eli-oat <hi@eli.li> | 2022-10-09 14:33:01 -0400 |
commit | e66b3143edbf6b007a9125ca5618e55b2f6c8c76 (patch) | |
tree | 12ffaa589a9dc894fb0101c40deb29fad8229ffd | |
parent | 3cc753c6529f512922a17b4fd30cc9680037fc04 (diff) | |
download | tour-e66b3143edbf6b007a9125ca5618e55b2f6c8c76.tar.gz |
*
-rw-r--r-- | chibi/print.scm | 34 | ||||
-rw-r--r-- | chibi/print.sld | 28 |
2 files changed, 38 insertions, 24 deletions
diff --git a/chibi/print.scm b/chibi/print.scm index d3af299..4e948c0 100644 --- a/chibi/print.scm +++ b/chibi/print.scm @@ -1,28 +1,14 @@ -(define-library (print) - (import (scheme base) - (scheme write)) +(import + (print)) - (export print - println - prints - printsln) - (begin - ;; Print arguments. - (define (print . args) - (for-each display args)) +;; very unoficial test of my tiny print library - ;; Print arguments, space separated. - (define (prints . args) - (for-each (lambda (s) - (display s) - (display " ")) args)) +(println "hi there") - ;; Print arguments and a newline. - (define (println . args) - (apply print args) - (newline)) +(printsln "kiwi" "banana" "pineapple") - ;; Print arguments, space separated, newline. - (define (printsln . args) - (apply prints args) - (newline)))) +(print "****") + +(print "hi there") + +(prints "kiwi" "banana" "pineapple") \ No newline at end of file diff --git a/chibi/print.sld b/chibi/print.sld new file mode 100644 index 0000000..d3af299 --- /dev/null +++ b/chibi/print.sld @@ -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)))) |