Thank you Alex for your help. Considering the second example, in the reply, what if I need to return the object itself, for example: > #lang racket > (require (for-syntax racket/class)) > (define-for-syntax foo-class% > (class object% > (super-new) > (define/public (get-foo) "foo"))) > (define-syntax foo-object (new foo-class%)) > (define-syntax (say-hello stx) > (syntax-case stx () > [(_ foo) > (begin > ;; prints at compile time > (display (string-append "Hello " (send (syntax-local-value #'foo) > get-foo))) #`'#,(syntax-local-value #'foo))]))
This will print the foo-object: > (say-hello foo-object) Hello foo (object:foo-class% ...) However, if I call the foo method it gives this error: (send (say-hello foo-object) get-foo) Hello foo . . send: target is not an object target: (object:foo-class% ...) method name: get-foo Is there another way to do that? Thank you. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.