On Sat, 22 Jan 2011, Sven Schreiber wrote:
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...
Granted. But IMO it would be very odd to think otherwise in gretl.
One plausible mode of working is: run a script then take
interactive control to do something further. I'd be cross if I
tried to do that and found that everything created by the script
had been collected as "garbage", just because the script had come
to an end.
ok, so what about extending those delete/clear commands... :-)
That'll probably happen soon.
Allin