[plt-scheme] string-eval

From: Daniel Pinto de Mello e Silva (daniel.silva at gmail.com)
Date: Wed Mar 23 20:48:30 EST 2005

I added the comment to StructuresReadingAndWriting, but note that "the
Scheme Cookbook folks" can mean you too.  There is no membership fee
and nobody will haze you (I think). :-)

 From the BecomingAnAuthor recipe:

"To become an author. visit TWikiRegistration and fill out the
registration form. Anyone can become a cookbook author, and contribute
to the cookbook. Once you have registered with the site you can modify
and add recipes as you see fit. Please note that all contributions are
covered by the Copyright statement in BookIntroduction."

Registration: http://schemecookbook.org/TWiki/TWikiRegistration
Copyright statement: http://schemecookbook.org/Cookbook/BookIntroduction


Daniel

On Wed, 23 Mar 2005 23:58:14 +0000, djneu at att.net <djneu at att.net> wrote:
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> 
> Robby, Jens,
> 
> Many thanks - using ~s did it!
> 
> Any thoughts for the Scheme Cookbook folks on whether it's worth
> putting a note in one of the recipes Jens referenced or maybe
> creating a new one?
> 
> Cheers,
> David
> 
>  -------------- Original message ----------------------
> From: Robby Findler <robby at cs.uchicago.edu>
> > You need to use
> >
> >   ~s
> >
> > not ~a.
> >
> > If you look closely at the first case, you'll see that you're getting
> > back a symbol, not a string. ~s means to use `write' and ~a means to
> > use display.
> >
> > Robby
> >
> > At Wed, 23 Mar 2005 17:50:24 -0500, "David J. Neu" wrote:
> > >   For list-related administrative tasks:
> > >   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> > >
> > > Hi,
> > >
> > > 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!
> > >
> > > Cheers,
> > > David
> > >
> > >
> > >
> > > (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.