[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Why does evaluating a piece of Elisp code seemingly not expand a
From: |
Samuel W. Flint |
Subject: |
Re: [O] Why does evaluating a piece of Elisp code seemingly not expand a macro? |
Date: |
Fri, 15 Jan 2016 16:10:45 -0500 |
User-agent: |
Gnus/5.130014 (Ma Gnus v0.14) Emacs/24.5 (gnu/linux) |
>>>>> 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
(quasi-)quoted expression.
This macro simply evaluates to 42. This should be a function.
If you want a macro, you could have:
#+BEGIN_SRC: emacs-lisp
(defmacro forty-two ()
'(* 6 7))
#+END_SRC
For what you want, you could have it be:
#+BEGIN_SRC: emacs-lisp
(defmacro forty-two ()
`,(* 6 7))
#+END_SRC
[...]
HTH,
Sam
--
Samuel W. Flint
4096R/266596F4
(9477 D23E 389E 40C5 2F10 DE19 68E5 318E 2665 96F4)
(λs.s s) λs.s s
signature.asc
Description: PGP signature
Re: [O] Why does evaluating a piece of Elisp code seemingly not expand a macro?,
Samuel W. Flint <=