PasteRack.org
Paste # 58867
2016-04-24 13:44:06

Fork as a new paste.

Paste viewed 94 times.


Embed:

  1. #lang racket
  2.  
  3. (define-syntax (@ stx)
  4.   (syntax-case stx ()
  5.     [(_ object method)
  6.      #'(send object method)]))
  7.  
  8. (define a (new (class object%
  9.                  (super-new)
  10.                  (define/public (foo) "bar"))))
  11.  
  12. (@ a foo)

=>