<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hello Philippe,<br>
<br>
The overloading mechanism is not systematic. It is implemented (or
not) function per function.<br>
It is currently proposed for some of them, but not all of them.<br>
If you need it for double(), you shall post a wish on Bugzilla.<br>
<br>
Best regards<br>
Samuel<br>
<br>
PS: for instance, iconvert(p,0) makes the same as double(), and is
overloadable:<br>
<br>
<font size="-1"><tt>--> iconvert(%z,0)</tt><tt><br>
</tt><tt>in builtin iconvert </tt><tt><br>
</tt><tt><br>
</tt><tt>Function not defined for given argument type(s),</tt><tt><br>
</tt><tt> check arguments or define function %p_iconvert for
overloading.</tt><tt><br>
</tt></font><br>
Le 21/08/2018 à 17:11, philippe a écrit :<br>
</div>
<blockquote cite="mid:plh9ud$bha$1@blaine.gmane.org" type="cite">
<pre wrap="">Hi,
I want to overload some usual scilab functions, I made it for abs and
sign but strangely it doesn't work for double ! Let's take an example ,
I want to extend sign and double for polynomials :
--> X=poly(0,"x"); // a polynomial
--> sign(X)
dans la fonction native sign
Fonction non définie pour les types fournis.
vérifier les arguments ou définir la fonction %p_sign pour la surcharge.
--> double(X)
double : Types erronés des arguments d'entrée : entiers, booléens ou
réels attendus.
so I define overloading for the two functions and "p" type :
function y=%p_sign(x)
y="OK"
endfunction
function y=%p_double(x)
y="OK"
endfunction
Now I can call sign on a polynomial, but this doesn't work for double
--> sign(X)
ans =
OK
--> double(X)
double : Types erronés des arguments d'entrée : entiers, booléens ou
réels attendus.
How can I do this for double ? If not why this doesn't work ? Both sign
and double are "fptr" type , I thought that scilab-6 doesn't make
difference between function and fptr any more .
Philippe
_______________________________________________
users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:users@lists.scilab.org">users@lists.scilab.org</a>
<a class="moz-txt-link-freetext" href="http://lists.scilab.org/mailman/listinfo/users">http://lists.scilab.org/mailman/listinfo/users</a>
</pre>
</blockquote>
<p><br>
</p>
</body>
</html>