From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Joost Kremers Newsgroups: gmane.emacs.help Subject: Re: Concern around use of eval Date: 20 Mar 2015 19:54:16 GMT Message-ID: References: NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1426881326 28407 80.91.229.3 (20 Mar 2015 19:55:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 20 Mar 2015 19:55:26 +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 20:55:26 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 1YZ30s-0000hE-1H for geh-help-gnu-emacs@m.gmane.org; Fri, 20 Mar 2015 20:55:22 +0100 Original-Received: from localhost ([::1]:45529 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YZ30r-0003LA-FZ for geh-help-gnu-emacs@m.gmane.org; Fri, 20 Mar 2015 15:55:21 -0400 Original-Path: usenet.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 29 Original-X-Trace: individual.net PLEZvwf61e4W61XI+JLU+AQSqhCdv1tn6Fn7piyRXY8TQvr2DP Cancel-Lock: sha1:lJnFTWigzsZ9moMTswkuoopGhk8= Mail-Copies-To: nobody X-Editor: Emacs of course! User-Agent: slrn/pre1.0.0-18 (Linux) Original-Xref: usenet.stanford.edu gnu.emacs.help:210951 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:103231 Archived-At: Tassilo Horn wrote: > Joost Kremers writes: > >> Why not do it at the top level directly? E.g.: >> >> ,---- >> | (defvar lh/labels '("label1" "label2" "label3")) >> | >> | (defmacro lh/gen-predicate (label) >> | `(defun ,(intern (concat "lh/" label "-p")) () >> | (member ,label *lh/system-label-store*))) >> | >> | (mapc (lambda (label) >> | (lh/gen-predicate label)) >> | lh/labels) >> `---- > > That won't work because. When reading the mapc form, emacs sees that > `lh/gen-predicate' is a macro and tries to expand it with the symbol > label as argument. The macroexpansion takes place before the actual > execution of the code. Thanks, that explains a few things. -- Joost Kremers joostkremers@fastmail.fm Selbst in die Unterwelt dringt durch Spalten Licht EN:SiS(9)