Task

Invoke an object method where the name of the method to be invoked can be generated at run time.



Related tasks

 Respond to an unknown method call.
 Runtime evaluation


 
#lang racket 
(define greeter
  (new (class object% (super-new)
         (define/public (hello name)
           (displayln (~a "Hello " name "."))))))
 
; normal method call
(send greeter hello "World")
 
; sending an unknown method
(define unknown 'hello)
(dynamic-send greeter unknown "World")
 