help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: never use `eval' (was: Re: How to mapcar or across a list?)


From: Emanuel Berg
Subject: Re: never use `eval' (was: Re: How to mapcar or across a list?)
Date: Thu, 16 Jul 2015 03:13:18 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

Barry Margolin <barmar@alum.mit.edu> writes:

>> (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 ,<expr> <val>))
>
> can practically always be replaced with:
>
> (setf (symbol-value <expr>) <val>)

Aha, that one! Got it. Please ignore previous question
which one is "eval setq".

-- 
underground experts united
http://user.it.uu.se/~embe8573




reply via email to

[Prev in Thread] Current Thread [Next in Thread]