On Fri, 14 Feb 2014, Michael Boldin wrote:
I can see the potential danger here, but if possible in a future
GRETL
release, it would be nice to be able to read from inside a function
any existing series (maybe with some type of write protection) without
needing to pre-specify a list with all of the series the function
'might' use.
I don't think we'll ever want to do what you suggest. If you want your
functions to be reusable and nicely modular, you have to avoid global
variables. The choice we made in hansl to forbid global variables
altogether is maybe a bit drastic (and perhaps a little patronising), but
I'm convinced it pays huge dividends in the long run. Try to debug a
complex gauss script that someone else wrote and you'll see exactly what I
mean.
In my 'use case' I am dynamically creating a set of
lagged explanatory variables for a model, with an additional
complication of not setting the exact lag length for each variable at
the start.
I don't see why you can't do this by passing a list to the function. Maybe
I'm missing something. If you describe your problem in more detail we may
be able to help.
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------