help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cl-generic


From: Stefan Monnier
Subject: Re: cl-generic
Date: Sun, 26 Apr 2015 19:33:03 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

> With the old functions I was able to give a byte compile form
> as method body but it does not seem to be possibl with
> cl-defmethod. One might always define a method :

Of course eieio-defmethod and eieio--defmethod are still available, as
backward compatibility, and otherwise you can use the new
cl-generic-define-method.

But in any case, such issues should be reported via M-x report-emacs-bug
rather than in gnu.emacs.help.

> (cl-defmethod mymethod ....  and then execute (byte-compile
> 'mymethod) but I wonder if doing that the method body is really
> byte compiled.

No, that won't byte compile the method: (byte-compile 'mymethod) will
only try to compile `mymethod' which is a generic function (which
dispatches to the various possible methods) and is already
byte-compiled anyway (I could imagine extending `byte-compile' so that
it understands the internal structure of generic functions and tries to
byte-compile all the methods when applied to a generic function, but
currently it doesn't do that).

You'd have to use

    (eval (byte-compile '(cl-defmethod mymethod ....)))

to byte-compile this particular method.


        Stefan


reply via email to

[Prev in Thread] Current Thread [Next in Thread]