[plt-scheme] string-eval

From: David J. Neu (djneu at att.net)
Date: Wed Mar 23 17:50:24 EST 2005


I'd like to be able to store an association list in a DBMS and later
retrieve it.

The code below works fine for
(define alist `((a . 1) (b . "foo")))

but generates the error:

UNKNOWN::26: read: unexpected ')'

when b is "", i.e. for
(define alist `((a . 1) (b . "")))

Many thanks for any suggestions!


(require (lib "string.ss")
	 (lib "pconvert.ss"))

(define alist `((a . 1) (b . "")))

;; simulate storing alist in a DBMS and reading it back
(define alist-as-string (format "~a" (print-convert alist)))

(eval-string alist-as-string)

UNKNOWN::26: read: unexpected ')'

Posted on the users mailing list.