about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2023-08-28 23:16:40 -0500
committerCase Duckworth2023-08-28 23:16:40 -0500
commitab6ef0adffc86edb0ed3fbc8dbcf5be96ba7812c (patch)
tree4a40d8d1245face7466b0f20b93487016d5cb237
parentCorrect dependencies (diff)
downloadschmaltz-ab6ef0adffc86edb0ed3fbc8dbcf5be96ba7812c.tar.gz
schmaltz-ab6ef0adffc86edb0ed3fbc8dbcf5be96ba7812c.zip
Add unprintable helper functions
-rwxr-xr-x[-rw-r--r--]schmaltz.scm4
-rw-r--r--schmaltz.sld3
-rw-r--r--schmaltz.sls6
3 files changed, 11 insertions, 2 deletions
diff --git a/schmaltz.scm b/schmaltz.scm index f8885f5..9e0e64a 100644..100755 --- a/schmaltz.scm +++ b/schmaltz.scm
@@ -15,8 +15,8 @@
15 (sxml->html ,(list 'quasiquote (read port)))))) 15 (sxml->html ,(list 'quasiquote (read port))))))
16 (render-specials))) 16 (render-specials)))
17 (render-unprintables 17 (render-unprintables
18 (list (cons "#<unspecified>" (lambda _ '())) 18 (list (cons "#<unspecified>" unprintable/skip)
19 (cons "#!eof" (lambda (ch) (list ch #\#)))))) 19 (cons "#!eof" unprintable/backtrack))))
20 (else)) 20 (else))
21 21
22(define (main args) 22(define (main args)
diff --git a/schmaltz.sld b/schmaltz.sld index 19212b4..31ed610 100644 --- a/schmaltz.sld +++ b/schmaltz.sld
@@ -5,6 +5,9 @@
5 render-specials 5 render-specials
6 render-unprintables 6 render-unprintables
7 render-environment 7 render-environment
8 ;; Unprintables
9 unprintable/skip
10 unprintable/backtrack
8 ;; Re-exports 11 ;; Re-exports
9 environment 12 environment
10 ) 13 )
diff --git a/schmaltz.sls b/schmaltz.sls index 25d926b..4afcf40 100644 --- a/schmaltz.sls +++ b/schmaltz.sls
@@ -77,3 +77,9 @@
77(define (assq-ref key lis) 77(define (assq-ref key lis)
78 (let ((val (assq key lis))) 78 (let ((val (assq key lis)))
79 (if val (cdr val) #f))) 79 (if val (cdr val) #f)))
80
81(define (unprintable/skip . _)
82 '())
83
84(define (unprintable/backtrack ch)
85 (list ch #\#))