1)  ok!
2)
# a native function
nulldata 20
setobs 1 1960 --time-series
set seed 13
series sin = normal()

series y = sin(1)

eval getinfo(y)
/*
bundle anonymous:
 has_string_table = 0
 lag = -1
 parent = sin
 name = y
 coded = 0
 discrete = 0
 transform = lags
 description = sin(1)
 */
# y is described as lag of 'sin'  
# but
/*
1960    0.8414710
1961    0.8414710
1962    0.8414710
1963    0.8414710
1964    0.8414710
...
*/
# i.e. y is a constant series, its values are equal to sin(1)
series x = sin
eval getinfo(x)
eval y - x(1)
eval y[1]-sin(1)

list z = round(sin(1))
eval varname(z)
eval z[1]

# user-specified function activated before
# reading/creating series
nulldata 20
setobs 1 1960 --time-series

function scalar x (scalar z)
   return exp(1)*z
end function

set seed 13
series x = normal()
series y = x(1)
eval getinfo(y)

catch ols x x(-1 to -2) -s
eval errmsg($error)
catch ols x x(-1) -s
eval errmsg($error)

# we see that currently
# functions override lags creation

# It seems, a case with unquoted (-1 to -2)
# can be easily saved, since
# functions do not take unquoted
# -1 to -2 argument (have I missed some function?)

# But what to do with x(-1) ?

Oleh



24 жовтня 2018, 23:59:59, від "Allin Cottrell" <cottrell@wfu.edu>:

On Wed, 24 Oct 2018, oleg_komashko@ukr.net wrote:

> Please, run the following to see some strange behavior
>
> open keane.gdt -q
> series lp_mfx_print = normal()
>
> include lp-mfx.gfn
> smpl (year==87) --restrict
> logit status 0 educ exper expersq black --multinomial -q
> bundle b = mlogit_mfx(status, $xlist, $coeff, $vcv, $sample)
>
> Then press b icon at session icon view

A mess, to be sure. Fortunately it was easy to fix; the fix is now 
in git.

When the bundle-print function of a package is invoked via the GUI, 
we know perfectly well it's a function call and nothing to do with 
lags of a series that a trickster may have created. We just weren't 
conveying that knowledge to "genr"; now we do.

Allin
_______________________________________________
Gretl-devel mailing list
Gretl-devel@lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-devel