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

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

Re: cl-generic


From: Pierre Lorenzon
Subject: Re: cl-generic
Date: Wed, 29 Apr 2015 19:58:41 +0200 (CEST)

Hi Stefan


thanks for your answer.



From: Stefan Monnier <monnier@iro.umontreal.ca>
Subject: Re: cl-generic
Date: Sun, 26 Apr 2015 19:33:03 -0400

>> 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.

  For me it was in fact not really a bug but much more an
  information about what effect will really have the
  byte-compile command.





> 
>> (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).


  OK !



> 
> You'd have to use
> 
>     (eval (byte-compile '(cl-defmethod mymethod ....)))

      I'll do that !

      Thanks Again





> 
> to byte-compile this particular method.
> 
> 
>         Stefan



reply via email to

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