diff --git a/keystore.rkt b/keystore.rkt index f48651a..456ac11 100644 --- a/keystore.rkt +++ b/keystore.rkt @@ -3,6 +3,7 @@ (require racket/contract racket/serialize racket/port + racket/string db ) @@ -184,10 +185,14 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define (value->string v) - (call-with-output-string - (λ (out) (write (serialize v) out)))) + (if (string? v) + v + (call-with-output-string + (λ (out) (write (serialize v) out))))) (define (string->value v) - (deserialize - (call-with-input-string v (λ (in) (read in))))) + (if (and (string-prefix? v "((") (string-suffix? v ")")) + (deserialize + (call-with-input-string v (λ (in) (read in)))) + v))