From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcin Borkowski Subject: Re: Why does evaluating a piece of Elisp code seemingly not expand a macro? Date: Fri, 15 Jan 2016 23:24:05 +0100 Message-ID: <87pox2cwhm.fsf@mbork.pl> References: <87a8o7duj6.fsf@mbork.pl> <87pox2mtuy.fsf@turing.flintfam.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52520) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aKCn9-00026j-Ky for emacs-orgmode@gnu.org; Fri, 15 Jan 2016 17:24:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aKCn6-0003LK-Cb for emacs-orgmode@gnu.org; Fri, 15 Jan 2016 17:24:23 -0500 Received: from mail.mojserwer.eu ([2a01:5e00:2:52::8]:41942) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aKCn6-0003IE-4w for emacs-orgmode@gnu.org; Fri, 15 Jan 2016 17:24:20 -0500 In-reply-to: <87pox2mtuy.fsf@turing.flintfam.org> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: "Samuel W. Flint" Cc: Org-Mode mailing list 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 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