[slime-devel] Re: Intentionally dynamic variables in elisp?
Peter Seibel
peter at gigamonkeys.com
Tue Mar 8 17:42:07 UTC 2005
Luke Gorrie <luke at synap.se> writes:
> Peter Seibel <peter at gigamonkeys.com> writes:
>
>> Since variables in elisp are by default dynamically scoped, is there a
>> coding convention for when you mean to take advantage of a variable
>> being dynamic?
>
> The convention that comes to mind is to only do this with variables
> that have been defvar'd and not just use it as a cheesy way to avoid
> passing parameters to subroutines.
Well, the situation is this: in slime (the function) I have a piece of
information which eventually needs to get hung off the connection
object. I can either add a parameter to a half-dozen functions between
slime and the function that actually gets the connection object or I
can bind a dynamic variable (which I'm happy to defvar). Which do you
prefer?
-Peter
--
Peter Seibel peter at gigamonkeys.com
Lisp is the red pill. -- John Fraser, comp.lang.lisp
More information about the slime-devel
mailing list