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

From: Zelah Hutchinson (zelah at inbox.com)
Date: Fri Jun 26 07:31:32 EDT 2009

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 


Posted on the users mailing list.