On 2016-01-15, at 22:10, Samuel W. Flint <swfl...@flintfam.org> 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 macro
> (the result of the last expression in the implicit progn) needs to be a
> (quasi-)quoted expression.

IIUC, a macro is a function - a function returning a Lisp form.

> This macro simply evaluates to 42.  This should be a function.

Yes, I wanted it to evaluate to 42.  I expected the constant 42 in the
code.  (And this is what happens if I evaluate these forms outside an
Org block.)

> 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

But this is _not_ what I want!  What I want is to understand the
difference between just C-M-x'ing these forms and evaluating them in
Org-mode.

> Sam

Regards,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University

Reply via email to