> Does it mean that C-M-x is different than loading?
Yes.
> Or C-x C-e, for that matter?
As well.
> Is this covered by the manual? (If not, it might need correcting.)
Not really. The basic idea is that macroexpansion can take place
*anytime* (tho, before the code is actually executed). If
On 2016-01-18, at 14:54, Stefan Monnier wrote:
>> Does it mean that C-M-x is different than loading?
>
> Yes.
>
>> Or C-x C-e, for that matter?
>
> As well.
>
>> Is this covered by the manual? (If not, it might need correcting.)
>
> Not really. The basic idea is that
> Does that mean that it's possible that a function definition contains
> unexpanded macros?
Yes.
> Does that mean that `symbol-function' will expand them?
AFAIK it currently never happens there, but if your code relies on this
property it's probably got a bug.
> Does that mean that if I
On 2016-01-15, at 11:57, Oleh Krehel wrote:
> Marcin Borkowski writes:
>
>> Why?
>
> Macro-expand the defun to get:
>
> (defalias 'print-answer
> #'(lambda nil
> (message
> "The answer is %s."
>
Marcin Borkowski writes:
> Why?
Macro-expand the defun to get:
(defalias 'print-answer
#'(lambda nil
(message
"The answer is %s."
(forty-two
`lambda' is a macro that /quotes/ its body. Therefore, the body of
`defun' is not
This piece of code:
#+BEGIN_SRC elisp :results value verbatim :exports both
(defmacro forty-two ()
(* 6 7))
(defun print-answer ()
(message "The answer is %s." (forty-two)))
(symbol-function 'print-answer)
#+END_SRC
yields this:
#+RESULTS:
: (lambda nil (message "The answer
> Marcin Borkowski writes:
MB> This piece of code: #+BEGIN_SRC elisp :results value verbatim
MB> :exports both (defmacro forty-two () (* 6 7))
That is not a macro. That's a function. The return value of a macro
(the result of the last expression in the implicit progn) needs to be a
swfl...@flintfam.org (Samuel W. Flint) writes:
>> Marcin Borkowski writes:
>
> MB> This piece of code: #+BEGIN_SRC elisp :results value verbatim
> MB> :exports both (defmacro forty-two () (* 6 7))
>
> That is not a macro. That's a function. The return value of a macro
> (the result of the
On 2016-01-15, at 22:10, Samuel W. Flint wrote:
>> Marcin Borkowski writes:
>
> MB> This piece of code: #+BEGIN_SRC elisp :results value verbatim
> MB> :exports both (defmacro forty-two () (* 6 7))
>
> That is not a macro. That's a function. The return value of a