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

Subject: RE: How to find a procedure given a symbol or string
From: "Frank A. Christoph" <christo@xxxxxxxxxxxxxxxxxx>
Date: Thu, 29 Jul 1999 08:53:46 +0900
> >> To paraphrase Mitch C. Amiano <amiamc@xxxxxxxxxxxxxxx> question:
> >> given tags like
> >>   <jediknight   name="obiwan" func="apprentice">
> >> and DSSSL functions
> >>   (define (apprentice name) (string-append name " is an apprentice" ))
> >> I want to use the value of "func" to call the correct DSSSL function...
>
> Something like the following ought to work:
>
> (element JEDIKNIGHT
>   (let ((func (string->symbol (attribute-string "FUNC"))))
>     (apply func (attribute-string "NAME"))))

That won't work. A symbol is not a procedure; it cannot be applied:
('apprentice "obiwan")

--FC


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


Current Thread