Re: sythetic procedure names

Subject: Re: sythetic procedure names
From: Brandon Ibach <bibach@xxxxxxxxxxxxxx>
Date: Thu, 6 Apr 2000 10:51:43 -0500
Quoting Alexander Taranov <tay@xxxxxxxxxx>:
> Holger Klawitter writes:
>  > is there any way to get the value which is bound to a name if I have
>  > the name as a string value? (I don't care about dynamic, lexical or
>  > global-only context :-)
>  > 
> As far as i can understand you solution is below.
> But using eval in code other then read-eval-pring loops
> signals that something is wrong with program design
> --regards, alexander
> 
> [tay@goliath MSXml]$ mzscheme
> Welcome to MzScheme version 53 (using locale), Copyright (c) 1995-98 PLT (Matthew Flatt)
> > (define (foo-bar) 'i-m-here)
> > (define (dispatch x y) ((eval (string->symbol (string-append x "-" y)))))
> > (dispatch "foo" "bar")
> i-m-here
> 
   Yes, the solution would require (eval).  Unfortunately, DSSSL
doesn't have it.  Holger, if you'd like to describe your situation in
a little more detail, I might be able to come up with something better
than the huge (cond).

-Brandon :)


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


Current Thread