From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Barry Margolin Newsgroups: gmane.emacs.help Subject: Re: never use `eval' (was: Re: How to mapcar or across a list?) Date: Wed, 15 Jul 2015 20:01:55 -0400 Organization: A noiseless patient Spider Message-ID: References: <87io9lmb4z.fsf@mbork.pl> <87oajdkqc7.fsf@kuiper.lan.informatimago.com> NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1437005123 16635 80.91.229.3 (16 Jul 2015 00:05:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 16 Jul 2015 00:05:23 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jul 16 02:05:23 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 1ZFWfx-0002l6-Sf for geh-help-gnu-emacs@m.gmane.org; Thu, 16 Jul 2015 02:05:22 +0200 Original-Received: from localhost ([::1]:37867 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZFWfx-0007B0-68 for geh-help-gnu-emacs@m.gmane.org; Wed, 15 Jul 2015 20:05:21 -0400 Original-Path: usenet.stanford.edu!news.kjsl.com!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!barmar.motzarella.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 36 Injection-Info: barmar.motzarella.org; posting-host="2be9e9f5dd9af768b8861af71b85fc28"; logging-data="26060"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18/atlXAyCU3IyONPUAU2NG" User-Agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) Cancel-Lock: sha1:BnPRHIDQ5v9T6CObxGOh8b/QVWA= Original-Xref: usenet.stanford.edu gnu.emacs.help:213467 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:105754 Archived-At: In article , Emanuel Berg wrote: > "Pascal J. Bourguignon" > writes: > > > It's always a bad idea to use eval, because eval > > evalutes in the nil environment, not in the local > > lexical envrionment. > > I have used `eval' eight times in my current setup of > 75 files. > > Tho some of this code I wrote several years ago, I'd > be happy to correct it. Any hints - general or > specific - are appreciated. > > ;; From: http://user.it.uu.se/~embe8573/conf/emacs-init/faces.el > > (defun set-color-face (name front &optional bold back) > (eval `(defvar ,(make-symbol name))) > (eval `(setq ,(intern name) > `((t (:foreground ,front > :background ,back > :bold ,bold) ))))) (eval `(setq , )) can practically always be replaced with: (setf (symbol-value ) ) -- Barry Margolin, barmar@alum.mit.edu Arlington, MA *** PLEASE post questions in newsgroups, not directly to me ***