From dde77071c2df147521999a2ab644ac36f14ff0b2 Mon Sep 17 00:00:00 2001 From: Hans Dijkema Date: Tue, 30 Jun 2026 09:25:22 +0200 Subject: [PATCH] Support of string keys. --- keystore.rkt | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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))