From 7901b76d6dee58ae5c99d48cacb71b9a06648f09 Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Mon, 24 Mar 2014 12:07:49 -0700 Subject: [PATCH] more liberal text conversion in decode --- decode.rkt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/decode.rkt b/decode.rkt index 010f65b..f1285e9 100644 --- a/decode.rkt +++ b/decode.rkt @@ -7,15 +7,14 @@ (define+provide (to-string x) (if (string? x) x ; fast exit for strings - (with-handlers ([exn:fail? (λ(exn) (error (format "Pollen parser: can't convert ~v to ~a" x 'string)))]) + (with-handlers ([exn:fail? (λ(exn) (error (format "Pollen decoder: can't convert ~v to ~a" x 'string)))]) (cond [(equal? '() x) ""] [(symbol? x) (symbol->string x)] [(number? x) (number->string x)] [(path? x) (path->string x)] [(char? x) (format "~a" x)] - [(txexpr? x) (format "~v" x)] ; todo: good or bad idea? will print expressions in preproc mode - [else (error)])))) ; put this last so other xexprish things don't get caught + [else (format "~v" x)])))) ;; decoder wireframe