Trouble using variables for function names in function declarations 
Author Message
 Trouble using variables for function names in function declarations

                                                Trouble using variables for function names in function declarations

The following function works and creates an object called op.

(define op (make <text-item>
                :parent c
                :coords (text-coords e)
                :text "<"
                :fill "red"
                :anchor "w"))

But I want to make a bunch of such objects so I want op to be
a variable. So I tried to define the following make-text-item!
function (2nd line). It attempts to get the symbol for each
element e and make an object with that name.
The function (get-symbol! e) defined in the first line is used
to find the symbol for e. It works fine by itself. It produces
a distinct symbol (eg. blu rf th yh etc.) for each e.

The combined function (make-text-item! e) does not work
however.  Can anbody tell me how to fix it or better yet
provide an example?

Thanks
-js

(define (get-symbol! e) (string->symbol (get-name! e)))

(define (make-text-item! e)

(define (get-symbol! e) (make <text-item>
                :parent c
                :coords (text-coords e)
                :text "<"
                :fill "red"
                :anchor "w"))
                )

(define (make-text-items! gr)
                (map (lambda (x) (make-text-item! x)) (set-edge->list (edges gr))))



Sat, 24 Apr 1999 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Trouble using variables for function names in function declarations

2. Name valid outside function, but error name inside function

3. VHDL function declaration (variable)

4. CVF: Problem with variable declaration for DLL functions

5. special variables in function declarations

6. Using a variable name for a variable name??

7. conflict class function name with ordinary function

8. Function parameter names within a function

9. Name of function within the function?

10. How to find out name of calling function from called function

11. Find function name in function

12. Retrieving the name of a function from within the function

 

 
Powered by phpBB® Forum Software