On Sun, 27 Sep 2015, Allin Cottrell wrote:
On Fri, 25 Sep 2015, Sven Schreiber wrote:
> for an example please save both attached files next to each other, and then
> execute script "check1.inp".
> I don't think doing an 'include' inside a function is valid, but gretl
> seems to stumble over this. Note for example that the function hu2() in
> check2.inp is never called, but I still get a printout of "hello" before I
> get an error message.
> This is with 1.10.2 (not the latest snapshot).
Thanks, Sven. In principle, using "include" within a function should work OK
-- provided that it doesn't result in trying to define a function inside a
function, as happens in your example.
That is explicitly declared to the invalid in the User's Guide and there's
supposed to be a guard in place against it, but either the guard has been
subject to bitrot or it's somehow defeated by the wrapping of a function
definition in "include". Anyway, the behavior exposed by your example is a
bug, and I'll see about fixing it.
OK, it wasn't bitrot; the "include" was masking the definition of a
function within a function. That's now fixed in CVS and snapshots;
the error message should now be more informative.