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

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

Re: managing my keybindings


From: Stefan Monnier
Subject: Re: managing my keybindings
Date: Wed, 08 Dec 2010 15:07:39 -0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

>   (let (my-func)
>     (setq my-func (intern (concat "my-" (symbol-name func))))

This is kind of like:

   int my-func = 0;
   my-func = <somethingelse>;

except that Elisp's semantics make it harder for the (byte-)compiler to
eliminate the redundant initialization.

A generally good rule of thumb is "setq (aka assignment) is bad for your
karma".  So just write:

   (let ((my-func (intern (concat "my-" (symbol-name func)))))


-- Stefan


reply via email to

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