Dear all,
<hansl>
function list das(void)
list da = seq(1,$nvars - 1)
return da
end function
function scalar mynelem (const list alist)
return nelem(alist)
end function
function series get_global(int i)
txt = sprintf("ols 0 %d -q",i)
@txt
return $xlist[1]
end function
#eval get_values(global)
function string get_globnames(void)
ret = ""
loop i=1..($nvars - 1) -q
ret = ret~" "~getinfo(i).name
endloop
return ret
end function
function void spoil100(bundle *b)
s = nelem(b.xlist)
end function
function list spoil200(const bundle b)
list li = das()
s = mynelem(b.xlist)
nams = get_globnames()
ser = get_global(1)
return li
end function
function void fu(string name)
catch eval @name
end function
nulldata 20
set seed 13
y = normal()
x1 = normal()
x2 = normal()
bundle bu
list bu.xlist = x1 x2
fu("x1")
fu("x2")
fu("y")
# no effect
spoil100(&bu)
fu("x1")
fu("x2")
fu("y")
# "penetrating" the only difference
# between spoil100 and spoil200 is in
# using user-specified mynelem and
# the native nelem; with mynelem
# being just wrapper over nelem
list lis = spoil200(bu)
fu("x1")
fu("x2")
fu("y")
lis
<hansl>
goes as expected on fresh git!
A minor problem has left:
function list spoil300(const bundle b)
s = mynelem(b.xlist)
nams = get_globnames()
ser = get_global(1)
list li = das()
return li
end function
list lis2 = spoil300(bu)
fu("x1")
fu("x2")
fu("y")
lis2
Generated list lis2
? fu("x1")
x1
? fu("x2")
x2
? fu("y")
y
? lis2
index y x1 x2 ser
I. e. ser has penetrated into global
data set
Olewh