El Saturday 12 July 2008 14:29:30 Allin Cottrell escribió:
...
And what happens if the function writer tries to create a local
series named "x"? If the list argument is marked "const" you'll
get an error; if not, the external "x" will be silently
over-written. Bad.
A moment's thought shows that this problem is less tractable than
the first: it's a design flaw, and it can't be solved simply by
documenting clearly what the function does.
Here's a proposal for solving the second problem. It is
implemented in CVS but not by default, only if you edit
lib/src/gretl_func.c and change the definition
#define PROTECT_LISTS 0
to
#define PROTECT_LISTS 1
Reading Jack's message it seems that the solution causes many problems.
I think a solution may be leaving the things as initially were, and creating
an "--overwrite" switch for the "return" command.
gretl may then cause an error when executing a function that contains
a "return" command without the "--overwrite" switch, but complete the
function (overwriting the external variables) when the --overwrite switch is
active.
--
Ignacio Diaz-Emparanza
DEPARTAMENTO DE ECONOMÍA APLICADA III (ECONOMETRÍA Y ESTADÍSTICA)
UPV/EHU
Avda. Lehendakari Aguirre, 83 | 48015 BILBAO
T.: +34 946013732 | F.: +34 946013754
www.et.bs.ehu.es