From ab6ef0adffc86edb0ed3fbc8dbcf5be96ba7812c Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Mon, 28 Aug 2023 23:16:40 -0500 Subject: Add unprintable helper functions --- schmaltz.scm | 4 ++-- schmaltz.sld | 3 +++ schmaltz.sls | 6 ++++++ 3 files changed, 11 insertions(+), 2 deletions(-) mode change 100644 => 100755 schmaltz.scm diff --git a/schmaltz.scm b/schmaltz.scm old mode 100644 new mode 100755 index f8885f5..9e0e64a --- a/schmaltz.scm +++ b/schmaltz.scm @@ -15,8 +15,8 @@ (sxml->html ,(list 'quasiquote (read port)))))) (render-specials))) (render-unprintables - (list (cons "#" (lambda _ '())) - (cons "#!eof" (lambda (ch) (list ch #\#)))))) + (list (cons "#" unprintable/skip) + (cons "#!eof" unprintable/backtrack)))) (else)) (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 @@ render-specials render-unprintables render-environment + ;; Unprintables + unprintable/skip + unprintable/backtrack ;; Re-exports environment ) diff --git a/schmaltz.sls b/schmaltz.sls index 25d926b..4afcf40 100644 --- a/schmaltz.sls +++ b/schmaltz.sls @@ -77,3 +77,9 @@ (define (assq-ref key lis) (let ((val (assq key lis))) (if val (cdr val) #f))) + +(define (unprintable/skip . _) + '()) + +(define (unprintable/backtrack ch) + (list ch #\#)) -- cgit 1.4.1-21-gabe81