[plt-scheme] Converting symbols to procedures?
Warren Henning skrev:
> Hi,
>
> I wanted to write some function dispatching code. I wanted to find a
> way to convert strings to procedure references, and of course there's
> string->symbol, but I can't find anything like symbol->procedure.
>
> Is there any way to convert from symbols to procedures?
Do you know them all before hand? If so use
(define (symbol->procedure s)
(case s
((+) +)
((-) -)
<etc>))
or similar (i.e. a hash-table).
Otherwise loookup namespace-variable-value in the HelpDesk.
--
Jens Axel Søgaard