[Gretl-devel] bug with null list in functions

Sven Schreiber svetosch at gmx.net
Wed May 2 07:36:59 EDT 2007


Hi,
I stumbled over nonsense output in py4gretl, but "fortunately" it's a
gretl bug!

<Example_script>
function test(int i1, const list l1[null], const list l2[null])
scalar a = nelem(l1)
scalar b = nelem(l2)
print a			# <- should give 0 for the call below
print b			# <- should be 1
print l1		# list should be empty/null
end function

open denmark
list myl2 = LRM
test(1, null, myl2)
</Example_script>

Instead this produces:

...
? test(1, null, myl2)

              a =  1.00000


              b =  0.000000



11.6326  11.6042  11.5815  11.6018  11.5863  11.6045  11.6533  11.7642
11.7529  11.7655  11.7806  11.7702  11.7459  11.7687  11.7498  11.7487
11.7049  11.7034  11.7030  11.7037  11.6789  11.7078  11.6762  11.6859
11.6416  11.6352  11.6093  11.6576  11.6278  11.6289  11.6038  11.6291
11.6020  11.6038  11.5946  11.6038  11.6171  11.6881  11.7265  11.7813
11.7976  11.8419  11.8403  11.9236  11.9030  11.9268  11.9710  12.0259
12.0512  12.0755  12.0562  12.0716  12.0280  12.0398  12.0153

Hope this can be fixed for 1.6.3,
sven



More information about the Gretl-devel mailing list