Very instructive for making experiments! Such things often occur in incomplete
experiments as was the case with me Oleh
27 жовтня 2015, 23:48:26, від "Allin Cottrell" < cottrell(a)wfu.edu >:
This is by way of a P.S. (post scriptum).
On Tue, 27 Oct 2015, I quoted Oleh:
> This works:
>
> nulldata 1
> list nlist = null
> z = isnull(varname(nlist))
> z
>
> Another hack or legal?
and replied:
Note, the output from the above is:
<output>
? nulldata 1
periodicity: 1, maxobs: 1
observations range: 1 to 1
? list nlist = null
Generated list nlist
? z = isnull(varname(nlist))
Generated scalar z = 1
? z
1
Done
</output>
Well, it's certainly an oddity but it is legal, and if you think
it through it is consistent with the documentation for isnull().
The expression "varname(nlist)" produces an empty string -- in
conformity with its documentation, since nlist is empty. But the
empty string is not the name of any existing variable, so
isnull(<empty string>) correctly returns 1 (!).
I should perhaps point out that while the above is a perfectly legal
test, it's not what one might be looking for, namely a test for
emptiness of the list argument. Consider the following:
<hansl>
open data4-1
list L = price sqft
eval isnull(varname(L))
</hansl>
In this case, too, "eval" will produce an answer of 1. That's
because varname(L) returns the string "price,sqft", which is not the
name of any existing (or even possible!) hansl variable.
Allin
_______________________________________________
Gretl-devel mailing list
Gretl-devel(a)lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-devel