Lisp HUG Maillist Archive

redefining defun/defmethod

Hi list,

I am using a custom method definition macro like :

(defmacro mydefmethod (name &rest args) `(defmethod ,name ,.args))

=> Is there a way I can declare it so that 'mydefmethod' gets recognised by LispWorks as a method definition ?
 (IDE, indenting, source tracking, syntax coloring etc.) 

Thank you

Jean



Re: redefining defun/defmethod


On 14 Dec 2016, at 23:46, Jean Bresson <Jean.Bresson@ircam.fr> wrote:

Hi list,

I am using a custom method definition macro like :

(defmacro mydefmethod (name &rest args) `(defmethod ,name ,.args))

=> Is there a way I can declare it so that 'mydefmethod' gets recognised by LispWorks as a method definition ?
 (IDE, indenting, source tracking, syntax coloring etc.) 


Name it: define-my-method
In general, lisp editors will infer that a macro is a defining macro if its name starts with def or define-.


-- 
__Pascal J. Bourguignon__



Re: redefining defun/defmethod

Can't you just work in a package that shadows DEFMETHOD with the
equivalent of mydefmethod?

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html

Re: redefining defun/defmethod

> On Dec 14, 2016, at 4:46 PM, Jean Bresson <Jean.Bresson@ircam.fr> wrote:
> 
> I am using a custom method definition macro like :
> 
> (defmacro mydefmethod (name &rest args) `(defmethod ,name ,.args))
> 
> => Is there a way I can declare it so that 'mydefmethod' gets recognised by LispWorks as a method definition ?
>  (IDE, indenting, source tracking, syntax coloring etc.) 


source tracking:

Look at the documentation for dspec:define-form-parser and dspec:define-dspec-alias.


indent:

(editor:setup-indent "mydefmethod" 2 2 2)


John DeSoi, Ph.D.


_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html

Updated at: 2020-12-10 08:31 UTC