Static Scoping versus Dynamic Scoping
  Home FAQ Contact Sign in
gnu.emacs.help only
 
Advanced search
POPULAR GROUPS

more...

gnu.emacs.help Profile…
 Up
Static Scoping versus Dynamic Scoping         


Author: Davin Pearson
Date: May 13, 2007 01:12

I read somewhere that in the future dynamic scoping of variables
in
Emacs Lisp will be replaced with static
scoping.

I don't want this to happen because I often need to make use of
the
following
idiom:

(let ((case-fold-search
t))

(foo))

Inside the foo function case-fold-search's value is set to t,
whatever
the global value for case-fold-
search.

Could someone please reassure me that this precious feature will
not
be removed?
2 Comments
Re: Static Scoping versus Dynamic Scoping         


Author: David Kastrup
Date: May 13, 2007 01:31

Davin Pearson gmail.com> writes:
> I read somewhere that in the future dynamic scoping of variables in
> Emacs Lisp will be replaced with static scoping.
>
> I don't want this to happen because I often need to make use of the
> following idiom:
>
> (let ((case-fold-search
> t))
>
> (foo))
>
> Inside the foo function case-fold-search's value is set to t,
> whatever the global value for case-fold- search.
>
> Could someone please reassure me that this precious feature will not
> be removed?
Show full article (0.73Kb)
no comments
Re: Static Scoping versus Dynamic Scoping         


Author: Stefan Monnier
Date: Jun 9, 2007 14:58

> I read somewhere that in the future dynamic scoping of variables in Emacs
> Lisp will be replaced with static scoping.

You're confused. There is some work going on which attempts to *add*
static scoping (more seriously than provided by CL's lexical-let macro).
But there's no intention to drop dynamic scoping: it would break about 99%%
of existing Lisp code.

Stefan
no comments