On Sat, 27 Feb 2021, Riccardo (Jack) Lucchetti wrote:
The getinfo() function, as you know, is used to for retrieving the
metadata
of a series. For example, the code
<hansl>
open data4-1 -q
b = getinfo(sqft)
print b
</hansl>
returns
<output>
bundle b:
coded = 0
transform = "none"
parent = ""
discrete = 0
name = "sqft"
description = "square feet of living area (Range 1065 - 3000)"
lag = 0
has_string_table = 0
</output>
The function currently returns an error if applied to a series that is
created "on the fly", as in "getinfo(log(sqrt))". This is IMO
undesirable, so
I was going to modify the function to have it return a bundle anyway.
The question is: what should it contain? I was inclined to fill all the slots
with "sensible" values, perhaps setting "name" as
"anonymous" and
"description" with something meaningful if possible. Or should we just return
an empty bundle? Would it make sense to include an "anonymous" binary flag?
Something else?
First reaction: I'd say this is a case for use of "catch" rather
than having getinfo return an empty or bogus bundle. An on-the-fly
series is just a raw array of doubles and it seems to me the only
information gretl can provide about it is the numerical values.
Well, I suppose we could get a rudimentary "description" by
extracting the argument to getinfo itself as a string:
getinfo(log(sqft)) -> description: "log(sqft)"
But would that serve a purpose?
Allin