[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

quasiquote in a class definition



hi

i am trying to use quasiquote inside the definition of a class (see code
below). the quasi expression is supposed to create an association list
of some methods defined within the class. this A-list is used by another
method within the class to search for a given method and return its
value. when executing, i always get that the target method (in the
assoc-list) is #<undefined>. i resolved the problem by defining the
method as a global procedure, but i need it to be in the class.

i have read the doc on quasiquote, but it seems that i am missing
something.

any clues
thanks
Hassoun

---
(define myframe%
  (class* frame% (myframe<%>) (name-string the_parent the_width
the_height pos_x pos_y given_style)
    (inherit create-status-line set-status-text set-cursor)
    (private
      [current_command '()]
      [command_list `((output_coords ,output_coords))] <---the
association list
      )
    (public
	...
      [get_current_command (lambda () current_command)]
      [output_coords (lambda (x y) (display x) (display "  ") (display
y) (newline))]
      [set_current_command! 	<--- the method that uses the association
list
       (lambda (given_command)
         (let ((tempo (assq given_command command_list)))
           (display tempo)
           (newline)
           (if tempo (begin (set! current_command (cadr tempo)) (display
current_command))
               (begin
                 (display tempo)
                 (error 'set_current_command "check given_command")))))]
      
      ...

-- 
Hassoun Karam
hassoun@sympatico.ca
http://www3.sympatico.ca/hassoun
--------------------------