[plt-scheme] Programatically Constructed Symbol Used As An Identifier???

From: Veer (diggerrrrr at gmail.com)
Date: Fri Jun 26 12:42:11 EDT 2009

Using eval seems to work :

(define (add3 x y)
  (apply (eval (append-symbol 'add 'er))
     (list x y)))

On Fri, Jun 26, 2009 at 5:01 PM, Zelah Hutchinson<zelah at inbox.com> wrote:
> This is my problem:
> (define (append-symbol symbol1 symbol2)
>  (string->symbol
>    (string-append
>      (symbol->string symbol1)
>      (symbol->string symbol2))))
> (define (adder x y)
>  (+ x y))
> (define (add x y)
>  (apply (append-symbol 'add 'er)
>     (list x y)))
> The "add" function is where I run in to trouble. The problem seems to be that 'adder is not the same as the function "adder". How can I make this work the way I want it to. The important parts for me are that the function I wish to call is already defined somewhere in my program and for calling it I wish to construct the existing name at run-time.
> Thanks,
> -Zelah
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme

Posted on the users mailing list.