Re: How to find a procedure given a symbol or string

Subject: Re: How to find a procedure given a symbol or string
From: Brandon Ibach <bibach@xxxxxxxxxxxxxx>
Date: Thu, 29 Jul 1999 06:02:41 -0500
Quoting dmahler@xxxxxxxxxx <dmahler@xxxxxxxxxx>:
> What you need is eval,
> (define (string->procedure name)
> 	(eval (string->symbol name)))
> 
> then you can do
>    ((string->procedure name) arg1 arg2 ...)
> or
>   (apply (string->procedure name) arglist)
> if you have the arguments in a list.
> 
   Sadly, DSSSL lacks this construct.  Perhaps not so sad, though.
I've always been wary of such constructs, as I feel that allowing
programs to write and execute new code on the spot can be a very
dangerous thing, and often (but not always) lends itself to abuse in
the form of use where the problem could be better solved via more
traditional approaches.

-Brandon :)


 DSSSList info and archive:  http://www.mulberrytech.com/dsssl/dssslist


Current Thread