Support of string keys.
This commit is contained in:
+7
-2
@@ -3,6 +3,7 @@
|
|||||||
(require racket/contract
|
(require racket/contract
|
||||||
racket/serialize
|
racket/serialize
|
||||||
racket/port
|
racket/port
|
||||||
|
racket/string
|
||||||
db
|
db
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -184,10 +185,14 @@
|
|||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
(define (value->string v)
|
(define (value->string v)
|
||||||
|
(if (string? v)
|
||||||
|
v
|
||||||
(call-with-output-string
|
(call-with-output-string
|
||||||
(λ (out) (write (serialize v) out))))
|
(λ (out) (write (serialize v) out)))))
|
||||||
|
|
||||||
(define (string->value v)
|
(define (string->value v)
|
||||||
|
(if (and (string-prefix? v "((") (string-suffix? v ")"))
|
||||||
(deserialize
|
(deserialize
|
||||||
(call-with-input-string v (λ (in) (read in)))))
|
(call-with-input-string v (λ (in) (read in))))
|
||||||
|
v))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user