(defmacro event-handler (link: argsv & body)
`(reify EventHandler (~'handle ~argsv ~@body)))
(macroexpand
'(macrolet (link: (add-handler [& body)
`(event-handler
(link: ~'this ~'e) ~@body))]
(add-handler 1)))
结果会在 handle
之后和 (link: this e)
之前出现额外的括号(请注意)
(do (reify* (link: javafx.event.EventHandler) (handle ((link: this e) 1))))