Am 22.01.2011 20:29, schrieb Allin Cottrell:
On 01/22/2011 01:52 PM, Sven Schreiber wrote:
> [I]t should be acknowledged that it is a real
> limitation of gretl to have only global variables (apart from the
> function scope), not to turn that around into a feature.
In my view the gretl script is an arbitrary textual unit, and
it does not make sense to limit the scope of variables based
on the script.
I can see a case for local variables, but these should be local
to non-arbitrary code blocks. For example it would be quite nice
to be able to say, within a loop or an if-block for example,
local matrix foo = whatever
so that the object would be destroyed automatically on exit
from the block. But scripts are not (logically) code blocks.
The latter statement (last sentence) constitutes a design decision, and
I have no problem with accepting it. (The whole thing is not as
important as it now sounds, anyway.)
However, it is not a self-evident truth. There's a good case to be made
to use files to organize your software, and there's quite a few
programming languages which do that. (BTW, this includes compiled as
well as interpreted languages, this distinction has nothing to do with
that issue.)
Jack once said that it would be good to have a scripting manual, and
this discussion probably confirms it. This doesn't mean that I'm asking
for it, rather that I think somebody like me should eventually
contribute to it. However, I really cannot commit to doing it, because
the danger of not delivering is too great given the usual time
constraints etc.
ok, so what about extending those delete/clear commands... :-)
thanks,
sven