Function: majutsu-template-defmethod
majutsu-template-defmethod is a macro defined in majutsu-template.el.
Signature
(majutsu-template-defmethod NAME OWNER ARGS SIGNATURE &rest BODY)
Documentation
Declare or define template method NAME applicable to OWNER type.
ARGS describe parameters after the implicit SELF argument.
When BODY is omitted, this declares metadata for a native/rendered method.
When BODY is present, the method becomes a local lowering method in the DSL:
receiver dispatch applies BODY instead of emitting a literal .name(...)
segment. Use majutsu-template-defkeyword for zero-argument methods intended
to participate in keyword sugar.
Source Code
;; Defined in /nix/store/jagqw3nms546pad0gxi5f3wsckk6pji7-emacs-packages-deps/share/emacs/site-lisp/majutsu-template.el
(defmacro majutsu-template-defmethod (name owner args signature &rest body)
"Declare or define template method NAME applicable to OWNER type.
ARGS describe parameters after the implicit SELF argument.
When BODY is omitted, this declares metadata for a native/rendered method.
When BODY is present, the method becomes a local lowering method in the DSL:
receiver dispatch applies BODY instead of emitting a literal `.name(...)'
segment. Use `majutsu-template-defkeyword' for zero-argument methods intended
to participate in keyword sugar."
(declare (indent defun))
(if body
(let ((extended-args (cons `(self ,owner) args)))
`(majutsu-template-defun ,name ,extended-args
,(majutsu-template-def--inherit-signature signature owner)
,@body))
`(eval-and-compile
(majutsu-template--register-function
,(majutsu-template-def--owned-meta-form name owner args signature nil)))))