From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nicolas Richard Newsgroups: gmane.emacs.help Subject: compiler macros without byte-compilation Date: Fri, 20 Mar 2015 10:44:06 +0100 Message-ID: <871tkkf1g9.fsf@yahoo.fr> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1426844618 16514 80.91.229.3 (20 Mar 2015 09:43:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 20 Mar 2015 09:43:38 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Mar 20 10:43:31 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YYtSf-00063E-H6 for geh-help-gnu-emacs@m.gmane.org; Fri, 20 Mar 2015 10:43:25 +0100 Original-Received: from localhost ([::1]:43008 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYtSe-0002q4-U2 for geh-help-gnu-emacs@m.gmane.org; Fri, 20 Mar 2015 05:43:24 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:32864) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYtST-0002pm-22 for help-gnu-emacs@gnu.org; Fri, 20 Mar 2015 05:43:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YYtSO-0008UE-3S for help-gnu-emacs@gnu.org; Fri, 20 Mar 2015 05:43:13 -0400 Original-Received: from mxin.ulb.ac.be ([164.15.128.112]:29194) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYtSN-0008U9-Tn for help-gnu-emacs@gnu.org; Fri, 20 Mar 2015 05:43:08 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aq0EAN/qC1WkD4Xx/2dsb2JhbABchnKwcQabDwEBAQEBAX2FLCQ0AQSIdgEUogaRN5JYAYY0hgqCLYduhBcFmjmGdI00IoFFDIIePYJ0AQEB Original-Received: from mathsrv4.ulb.ac.be (HELO localhost) ([164.15.133.241]) by smtp.ulb.ac.be with ESMTP; 20 Mar 2015 10:43:07 +0100 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 164.15.128.112 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:103222 Archived-At: Hello, Consider the following: (progn (defun foobar () (declare (compiler-macro (lambda (arg) "compiler-macro"))) (message "Done !")) (list (symbol-function 'foobar) (foobar))) hit C-x C-e : => ((lambda nil (message "Done !")) "compiler-macro") Now I'm puzzled : why does this happen ? foobar wasn't compiled here ! Looking at readevalloop in lread.c, I thought it was maybe because of eager macro expansion [which the manual only mentions as happenning at load time], and in particular I tried changing (symbol-function 'internal-macroexpand-for-load), but that doens't seem to have any influence on the above behaviour: (cl-letf (((symbol-function 'internal-macroexpand-for-load) nil)) (progn (defun foobar () (declare (compiler-macro (lambda (arg) "compiler-macro"))) (message "Done !")) (list (symbol-function 'foobar) (foobar)))) => ((lambda nil (message "Done !")) "compiler-macro") Could someone shed some light on this ? -- Nicolas Richard