guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: string to expression


From: Alex Shinn
Subject: Re: string to expression
Date: 22 Aug 2001 10:17:14 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.0.104

>>>>> "Peter" == Peter Ivanyi <address@hidden> writes:

    Peter> Hello, I am definitely a new user to guile, though I have
    Peter> programmed in Lisp a couple of years ago. My current
    Peter> problem is that I would like to convert a string into an
    Peter> expression, something like this:

    Peter>   # (define a "1 2 3") # (read (string-append "(" a ")"))
    Peter> (1 2 3)

Either use eval-string:

  (eval-string "'(a b c)")

which, you'll notice, requires quoting the list, or if you want to
avoid evaluating it at all and just read it:

  (with-input-from-string "(a b c)" read)

-- 
Alex Shinn <address@hidden>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]