Re: The pervasiveness of DEFVAR and the Lisp curse



RG <rNOSPAMon@xxxxxxxxxxx> wrote:
+---------------
| "Pascal J. Bourguignon" <pjb@xxxxxxxxxxxxxxxxx> wrote:
| > Rather, I'd tend to tell newbies that they should not use global
| > variables anyways.
|
| That's generally good advice. But Lisp prides itself as a language for
| exploratory programming. When doing exploratory programming one often
| generates intermediate results interactively that one wishes to retain
| for later use. The most common and convenient way to do that is by
| binding (or assigning) the result to a global variable.
+---------------

I completely agree with this latter point, which is why all of my
CL init files load my DEFLEX macro:

http://rpw3.org/hacks/lisp/deflex.lisp

Note that I have no particular attachment to *my* implementation
of DEFLEX, but at this point I would assume that nearly every
serious CL programmer uses *some* implementation of DEFLEX or
DEFLEXICAL or DEFGLOBAL [assuming it's lexical] or whatever.


-Rob

-----
Rob Warnock <rpw3@xxxxxxxx>
627 26th Avenue <http://rpw3.org/>
San Mateo, CA 94403

.



Relevant Pages