unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* need for 'dynamical-let'?
@ 2015-07-23 20:54 Stephen Leake
  2015-07-23 20:58 ` Stephen Leake
                   ` (4 more replies)
  0 siblings, 5 replies; 16+ messages in thread
From: Stephen Leake @ 2015-07-23 20:54 UTC (permalink / raw)
  To: emacs-devel

I'm switching on lexical-binding in some files.

In several cases, the byte compiler is complaining:

xgit.el:993:30:Error: add-to-list cannot use lexical var `branch-list'

So I have to change code like this:

(let (branch-list
      ...)
   (add-to-list branch-list (substring branch-entry 2) t)


to:

(defvar dvc-branch-list);; add-to-list can't use lexical var
(let (
      ...)
   (add-to-list 'dvc-branch-list (substring branch-entry 2) t)


This pollutes the global name space, and disguises the local nature of
'branch-list'.

Can we define a macro 'dynamical-let' that would implement this
pattern, but with hidden variables?

-- 
-- Stephe



^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2015-07-26 15:37 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-23 20:54 need for 'dynamical-let'? Stephen Leake
2015-07-23 20:58 ` Stephen Leake
2015-07-23 21:03 ` Dmitry Gutov
2015-07-24  8:16   ` Stephen Leake
2015-07-24  9:38     ` Dmitry Gutov
2015-07-24  4:23 ` Stephen J. Turnbull
2015-07-24  4:40   ` David Kastrup
2015-07-24  7:58   ` Stephen Leake
2015-07-24 16:54 ` Dmitri Paduchikh
2015-07-25  6:41   ` Dmitri Paduchikh
2015-07-25 22:22     ` Stefan Monnier
2015-07-26  0:02       ` Dmitri Paduchikh
2015-07-26  6:51         ` Stefan Monnier
2015-07-26  8:17           ` Dmitri Paduchikh
2015-07-26 15:37         ` raman
2015-07-24 23:32 ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).