[] badly handled by [list double] overload %l_c_s() + inner disp() canceled
Reported by Samuel GOUGEON (@sgougeon)
BUG DESCRIPTION:
----------------
Let
--> function L = %l_c_s(L,N)
> disp(argn(2))
> L = lstcat(L, N)
> endfunction
--> L = list("abc");
--> [L %pi]
2. // disp & argn(2) OK
ans =
ans(1)
abc
ans(2)
3.1415927 // %pi appended: OK
--> [L []]
ans = // disp(argn(2)) disapeared
ans(1)
abc
// [] ignored
This behavior does not occur when %l_c_s() is called directly:
--> %l_c_s(L,[])
2.
ans =
ans(1)
abc
ans(2)
[]
The bug does not occur on Scilab 5, that yields expected results.
NOW, let's see with exactly the same definition, but set in %l_s_s() instead of %l_c_s():
--> function L = %l_s_s(L,N)
> disp(argn(2))
> L = lstcat(L, N)
> endfunction
--> L-[]
2. // now disp(argn(2)) works as expected
ans =
ans(1)
abc
ans(2)
[] // also OK
I have not tried with more overloads.
ERROR LOG:
----------
Bad behavior.
HOW TO REPRODUCE THE BUG:
-------------------------
function L = %l_c_s(L,N)
disp(argn(2))
L = lstcat(L, N)
endfunction
L = list("abc");
[L %pi]
[L []]
%l_c_s(L, [])
function L = %l_s_s(L,N)
disp(argn(2))
L = lstcat(L, N)
endfunction
L-[]