From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Why does evaluating a piece of Elisp code seemingly not expand a macro? Date: Fri, 15 Jan 2016 17:06:05 -0500 Message-ID: <87y4bq4hwy.fsf@alphaville.usersys.redhat.com> 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]:48180) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aKCVe-0005zv-NH for emacs-orgmode@gnu.org; Fri, 15 Jan 2016 17:06:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aKCVa-0007oE-Mb for emacs-orgmode@gnu.org; Fri, 15 Jan 2016 17:06:18 -0500 Received: from plane.gmane.org ([80.91.229.3]:56097) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aKCVa-0007o7-FV for emacs-orgmode@gnu.org; Fri, 15 Jan 2016 17:06:14 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1aKCVZ-0001VW-8p for emacs-orgmode@gnu.org; Fri, 15 Jan 2016 23:06:13 +0100 Received: from nat-pool-bos-t.redhat.com ([66.187.233.206]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 15 Jan 2016 23:06:13 +0100 Received: from ndokos by nat-pool-bos-t.redhat.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 15 Jan 2016 23:06:13 +0100 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: emacs-orgmode@gnu.org swflint@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 last expression in the implicit progn) needs to be a > (quasi-)quoted expression. > Not so. > This macro simply evaluates to 42. This should be a function. > Maybe it should be a function, but it *is* a macro: --8<---------------cut here---------------start------------->8--- (defmacro forty-two () (* 6 7)) ==> forty-two (symbol-function 'forty-two) ==> (macro lambda nil (* 6 7)) --8<---------------cut here---------------end--------------->8--- > If you want a macro, you could have: > > #+BEGIN_SRC: emacs-lisp > (defmacro forty-two () > '(* 6 7)) > #+END_SRC > That's a different macro: --8<---------------cut here---------------start------------->8--- (defmacro forty-two () '(* 6 7)) ==> forty-two (symbol-function 'forty-two) ==> (macro lambda nil (quote (* 6 7))) --8<---------------cut here---------------end--------------->8--- -- Nick