emacs-devel
[Top][All Lists]
Advanced

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

Re: crazy interaction between buffer-locality and function-locality of v


From: Ami Fischman
Subject: Re: crazy interaction between buffer-locality and function-locality of variables
Date: Sun, 2 Nov 2008 15:59:33 -0800

>    Is the behavior of binding function arguments variables subject to the
>    locality of the current buffer at function call time intentional?
> That's a confusing way to describe things.

I intentionally described the behavior I observed in a way as
confusing as I found the behavior to be, hoping to draw attention to
the deficiency I considered in the behavior.

> The current buffer
> when the function is called has no direct effect on the function.
> What does have an effect is switching buffers within the function.

This distinction lacks a difference to me.  Buffer-switching is a
standard idiom of elisp and normally considered an implementation
detail of a function, not part of its external contract.  If including
buffer-switching in a function's code unbinds variables bound in that
function then that promotes the presence of buffer-switching from
implementation detail to externally-visible effect.  Put another way,
a function that uses buffer-switching is always at the mercy of the
buffers in which it is invoked, to avoid making local variables with
the same names as the function's arguments or let-bound variables.
This is what I was hoping was unintentional and fixable, though you
and Stefan have now told me that it is the lesser evil (and by
implication here to stay).

> We should probably change the name of that variable in Gnus.
> to something like `gnus-timestamp'.

I have posted a request for something similar to the gnus mailing list:
http://thread.gmane.org/gmane.emacs.gnus.general/67732

-a




reply via email to

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