[Scilab-Dev] problem with function overloading

Samuel Gougeon Samuel.Gougeon at univ-lemans.fr
Wed Mar 10 15:24:38 CET 2010


----- Message d'origine -----
De : Samuel Gougeon
Date : 10/03/2010 15:03:
> There is no reason that SCI/modules/gui/%h_delete exists, since the 
> "h" = graphic
> handle data type is the default one for the delete() primitive. So, 
> %h_delete likely
> cannot be called by scilab, unless maybe it is aimed to be used with a 
> _vector_ of
> handles instead of a scalar handle (whether the primitive is defined 
> only for a scalar
> handle as input argument).
I did not check this assumption before my prior post. It is done. 
Actually, it is right.
* In %h_delete , comment all lines and add disp("Hello from %h_delete")
* Rebuild the library exec("buildmacros.sce")
* Quit and restart scilab
plot2d()
e=gce();
delete(e.children(1))
// Here, the primitive is called, because the handle is scalar
// Then, only 2 curves remain over the 3
clf
plot2d()
e=gce();
delete(e.children([1 3]))
// Here, the overloading is performed "Hello from %h_delete" is 
displayed as expected.

Conclusion : The overload is called not only in case of unsupported default
data types, but also in case of unsupported data size for supported data 
types.

Samuel




More information about the dev mailing list