From: Michael Hönisch
Subject: Evaluate string in Lisp
Date: 
Message-ID: <41483ab1@news.adm.arcor.net>
Hello,

is it possible to evaluate a string in LISP?

For example, there is a string "(pprint \"Hello World\")". Is it 
possible to evaluate this string?

Regards
Michael

From: Howard Ding <······@hading.dnsalias.com>
Subject: Re: Evaluate string in Lisp
Date: 
Message-ID: <m3acvrpujb.fsf@frisell.localdomain>
Michael H�nisch <················@ascad.de> writes:

> is it possible to evaluate a string in LISP?
> 
> For example, there is a string "(pprint \"Hello World\")". Is it
> possible to evaluate this string?
> 

Combine eval with read-from-string

-- 
Howard Ding
<······@hading.dnsalias.com>
From: Edi Weitz
Subject: Re: Evaluate string in Lisp
Date: 
Message-ID: <874qlzelvm.fsf@miles.agharta.de>
On Wed, 15 Sep 2004 14:44:48 +0200, Michael H�nisch <················@ascad.de> wrote:

> is it possible to evaluate a string in LISP?
>
> For example, there is a string "(pprint \"Hello World\")". Is it
> possible to evaluate this string?

Try

  (eval (read-from-string "(print \"Hi\")"))

but note that a) READ-FROM-STRING will read only one object from the
string and b) EVAL evaluates the form in the "null lexical
environment" - see the HyperSpec for details:

  <http://www.lispworks.com/reference/HyperSpec/Front/index.htm>

Edi.

-- 

"Lisp doesn't look any deader than usual to me."
(David Thornley, reply to a question older than most languages)

Real email: (replace (subseq ·········@agharta.de" 5) "edi")