On Fri, 19 Jun 2015, Sven Schreiber wrote:
instead of creating an interim list variable I wanted to use the
returned list from a function directly for further operations, but that
failed:
<hansl>
function list checkl(void)
genr time
list out = const time
return out
end function
matrix v = zeros(2,1)
list foo = checkl()
series hey1 = lincomb(foo, v) # works
print hey1
series hey2 = lincomb(checkl(), v) # doesn't work
print hey2
</hansl>
I would think that's a bug.
I agree. On examining the relevant code (the function eval_ufunc(), in
the source file geneval.c) I found an if-condition with a comment
dated 2015-02-02 which reads:
"collect" the return value [from a user-defined function that
returns a list] only on direct assignment
It's easy enough to remove that condition (which then makes your
example work), but I need to try to remember what prompted me to
insert it in the first place -- I presume it was in response to some
other bug. (Note to self: write more explicit comments!)
Allin