[plt-scheme] trying not to use eval

From: Rohan Nicholls (rohan.nicholls at informaat.nl)
Date: Tue Oct 29 10:11:53 EST 2002

Noel Welsh wrote:
> Common Lisp allows you to get the function associated
> with a symbol with the symbol-function function. 

It was this functionality I was looking for in scheme....

> There is no equivalent in R5RS Scheme that I'm aware
> of.  However you can do it in PLT Scheme in a
> restricted sense.  The question comes down to which
> environment you want to resolve the symbol in.  If you
> want to resolve the symbol in the current top-level
> environment then you can use
> 
>   namespace-variable-value
> 
> To do the resolution in the lexical
> environment...there's no way I know.
> 
the structure definition I want to get at is in the global space, so 
that should work, but yes it would be nice to be able to do that on the 
fly....

Being an inordinately lazy programmer, I like to create generic 
functions rather than have to type something twice.  This usually gets 
me in trouble.:)

Thanks for the help,

rohan



Posted on the users mailing list.