Re: Maintaining multivariable state (newbie question)





Dimiter "malkia" Stanev wrote:
Special (dynamic) variables are one of the things that got me into Lisp.

OK, but you are only allowed by the finger shakers to use them for PRINT.


I grew tired of supporting an in-house tool (C++), which had to be extended with various options, and I've ended up making each function taking (..., int argc, char *argv[]) and then each function would parse it (a bit of greenspunning).

It occurs to me that the infinitive should be "to greenspin". Certainly "So there I am using the C preprocessor to greenspin macros and I hit a wall..." is easier to say.


Then I've put the stuff in global variables, and removed the (..., int argc, char *argv[]), but for some reason I needed to change some of the things temporarily, and restore them, so I've ended up doing something like a stack for each global variable.

And when I started reading lisp I understand the wisdom behind special variables, and all my wasted hours behind emulating what's already have been done.

That plus the multiple-value returns (Another invention that I needed these days in a C++ code to overcome total rewrite of foreign code portions in a much larger tool - mainly to avoid massive amounts of DLL's to be recompiled).

You need to read Bur***'s Road to Lisp. Then add your own. I think he was doing macros in C++.

OK, this NG has become unbearable with the stench of nooby diapers. What is the obscure niche language where I will be safe forever? I am thinking Forth. Yes? No?

kxo
.