This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; alternative designs: | |
;; * everything outside defplugin | |
(defplugin | |
(cmdkey [args] | |
body...) | |
(cmdkey [args] | |
body...) | |
(cmdkey [args] | |
body...)) | |
;; The core of this defplugin would then be | |
;; (you still need to flesh it out with your load/unload mechanism) | |
(defmacro defplugin [& body] | |
`(do | |
~@(for [[cmdkey & method-stuff] body] | |
`(defmethod respond ~cmdkey ~@method-stuff)))) | |
;; * interleaved | |
(defplugin | |
some init code | |
; a top-level map denot a set of commands | |
{cmdkey ([args] | |
body...) | |
cmdkey ([args] | |
body...) | |
cmdkey ([args] | |
body...)} | |
something else | |
;; more commands | |
{cmdkey ([args] | |
body...) | |
cmdkey ([args] | |
body...)} | |
cmdkey ([args] | |
body...)} | |
other stuff) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment