emacs-devel
[Top][All Lists]
Advanced

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

Re: Emacs Lisp and Guile


From: Stefan Monnier
Subject: Re: Emacs Lisp and Guile
Date: Fri, 09 Aug 2002 02:50:52 -0400

>     Right now, a variable is a strictly passive data container.  You can't
>     intercept accesses to it.  A variable reference is a direct reference
>     to memory, not a function call.  We would have to change this model to
>     also allow 'active' variables that can run arbitrary code when they
>     are accessed.
> 
> That is not what I am suggesting.  Variables in Emacs do not run
> arbitrary code when accessed; I think that would be a misguided
> feature.

In Scheme we can use fluid-let to implement Elisp-style dynamic binding.
The only difference with Elisp is that you use `fluid-let' instead
of `let' when binding a variable dynamically.

I think we should aim to move in the direction where most let-bound
variables are lexically scoped and the rest (i.e. `defvar'd variables)
is accessed/modified via special functions/macros.

In most cases (in Elisp practice) lexical or dynamic scoping of let-bound
(and not defvar'd) variables has exactly the same semantics.  Miles'
`lexbind' branch is trying to do just that as is someone on the XEmacs
side (the means are different, tho).

If we can get high enough compatibility (maybe full compatibility is
even possible), that would mean that running "arbitrary code" when
accessing a dynamic variable is at least not a performance problem
(and it can be very convenient when debugging).  It could also be
useful for meta-variables (such that setting them modifies all
those that depend on it: it currently can be done in very limited
ways via the :set parameter to defcustom).


        Stefan




reply via email to

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