Re: Execute a string containing a form?

2010-04-22 Thread Mike Mazur
Hi, On Thu, Apr 22, 2010 at 20:17, Base basselh...@gmail.com wrote: say i have a string that contains a form: (+ 1 1) I want to actually execute this.  How do you do this?  I thought that eval would be able to handle this but apparently am misunderstanding what eval does. You need to read

Re: Execute a string containing a form?

2010-04-22 Thread Tassilo Horn
On Thursday 22 April 2010 14:17:15 Base wrote: Hi! say i have a string that contains a form: (+ 1 1) I want to actually execute this. How do you do this? I thought that eval would be able to handle this but apparently am misunderstanding what eval does. `eval' evals a form, so first

Re: Execute a string containing a form?

2010-04-22 Thread Douglas Philips
On 2010 Apr 22, at 8:17 AM, Base wrote: say i have a string that contains a form: (+ 1 1) I want to actually execute this. How do you do this? I thought that eval would be able to handle this but apparently am misunderstanding what eval does. Well, eval is the second half of what you want.

Re: Execute a string containing a form?

2010-04-22 Thread Base
Thank you all! I knew there was something simple that i was missing! On Apr 22, 7:28 am, Douglas Philips d...@mac.com wrote: On 2010 Apr 22, at 8:17 AM, Base wrote: say i have a string that contains a form: (+ 1 1) I want to actually execute this.  How do you do this?  I thought that

Re: Execute a string containing a form?

2010-04-22 Thread Heinz N. Gies
On Apr 22, 2010, at 14:28 , Douglas Philips wrote: eval can be a dangerous thing to use, you have to be very careful about where the source has come from, in terms of trusting that the code your programs 'eval's will not be malicious or dangerous in some way. There are no absolute rules

Re: Execute a string containing a form?

2010-04-22 Thread Luc Préfontaine
We store routing rules in a database as Clojure code and get these to be loaded dynamically and run according to some variable configuration. Of course we make sure the code forms are stringent in the database and we wrap execution of these things with proper error handling code :))) That's one