We cannot overload some macros.
Reported by Michael BAUDIN
The following example:
function z = %TDFFCD_acosh(x)
v = acosh(x.v)
dv = 1 ./ sqrt(x.v.^2-1).*x.dv
z = mlist(["TDFFCD";"v";"dv"],0,1)
endfunction
x = mlist(["TDFFCD";"v";"dv"],0,1);
acosh(x)
produces:
-->acosh(x)
!--error 10000
acosh: Wrong type for input argument #1: Real or complex matrix expected.
at line 25 of function acosh called by :
acosh(x)
This is because acosh is a macro, and not a compiled (gateway) function.
For example, the following code:
function z = %TDFFCD_acos(x)
v = acos(x.v)
dv = -1 ./ sqrt(1-x.v.^2).*x.dv
z = mlist(["TDFFCD";"v";"dv"],0,1)
endfunction
x = mlist(["TDFFCD";"v";"dv"],0,1);
acos(x)
perfectly works, because acos is a compiled gateway.
The overload module seems to be the answer :
http://atoms.scilab.org/toolboxes/Overload_Toolbox
Why is it not integrated in Scilab ?