On Sun, Apr 6, 2025 at 2:37 PM Sven Schreiber
<sven.schreiber(a)fu-berlin.de> wrote:
Hi all,
sorry, this is going to be long and a bit involved. While working on a
package, I encountered some weirdness when creating new gretl list
objects off of a $model coming from a GUI model window after doing OLS.
Here's a further response to Sven after doing some more investigation.
It's unlikely to be of interest to anyone who's not in the business of
writing packaged functions that key off models represented in windows
in the gretl GUI.
The key question is this: under what conditions does gretl, inside a
function, "know about" series that exist at the level from which the
function was called? The answer:
1) Obviously, gretl knows about series that were explicitly passed as arguments.
2) In addition, gretl knows about series that are referenced in a
"list" passed as an argument. Such series are temporarily "localized"
to the function, then returned to their original level when the
function returns.
3) As an extension of point 2, we also temporarily "localize" series
that are referenced in a list contained in a bundle passed as an
argument to the function in question.
And that's all. What Sven was trying to do would work if and only if
we also "localize" series referenced in a list contained in a bundle
that's _not_ passed as an argument but is made available within the
function via the $model accessor -- something we have not attempted to
date.
Allin