[Scilab-users] ipcv vs scicv

Chin Luh Tan tanchinluh at gmail.com
Fri Dec 4 01:57:09 CET 2020


Hi all,

Stephane, Thanks for the quick  examples to illustrate this.

Claus, as shown by Stephane, this could be now by ourselves now from our
own modules. Stephane has illustrated a quick demo on this, while the one I
was testing with is the copy of toolbox skeleton inside the Scilab contrib,
modified to 2 modules, installed with atoms and let it load at start,
results are the same.

There are 2 potential issues which we should take notes:
1. The module which is loaded last, will have the "dominant" in the base
function. for e.g.: the example that Stephane showed, we could call
"lib1.foo" and "lib2.foo", and calling just "foo" will be the same as
"lib2.foo".
2. Only macros function could be called this way, if a module has a scilab
gateway that called direct from Scilab, (such as scicv), you could not call
scicvlib.imread as the imread is directly expose from the C lib to Scilab.
So during the design of the module, you could have a macros wrapper to call
the gateway functions so that they could be listed in the library's macros
list.

Thanks.

rgds,
CL

On Fri, 4 Dec 2020 at 00:36, Stéphane Mottelet <stephane.mottelet at utc.fr>
wrote:

> This is the way it works in scilab for libraries:
>
> mkdir lib1mputl("function y=foo(x);y=x;end","lib1/foo.sci")genlib("lib1","lib1")mkdir lib2mputl("function y=foo(x);y=2*x;end","lib2/foo.sci")genlib("lib2","lib2")lib("lib1")lib("lib2")
> -> lib1.foo(1)
>  ans  =
>
>    1.
> --> lib2.foo(1)
>  ans  =
>
>    2.
>
>
> S.
>
> Le 03/12/2020 à 17:28, Antoine Monmayrant a écrit :
>
>
> On 03/12/2020 02:10, TanCL wrote:
>
> Hi, my previous message seems like not able to get posted due to some reason,
> just to add some comment on this, I think the functions with same name under
> 2 different modules could be possibly called by:
>
> That is exactly how things are working in Ada:
>
> myfunc : local definition in the current file
> somepackage.myfunc : definition one can find in somepackage that is
> included in the current file by "with somepackage;"
>
> And one can rename the package with "package S renames somepackage" which
> allow writting "s.myfunc"
> I assume it's similar in Python too.
>
> Antoine
>
> moduleA.myfunc
>
> moduleB.myfunc
>
>
> ______________________
>
> Start Toolbox A
> 	Load macros
>
> Start Toolbox B
> 	Load macros
>
>
> --> toolboxAlib.scilab_sum(2,1)
>
>   "This is function from ToolboxA"
>  ans  =
>
>    3.
>
> --> toolboxBlib.scilab_sum(2,1)
>
>   "This is function from ToolboxB"
>  ans  =
>
>    3.
>
>
>
>
>
> --
> Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html <https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html>
> _______________________________________________
> users mailing listusers at lists.scilab.orghttp://lists.scilab.org/mailman/listinfo/users <https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users>
>
>
> _______________________________________________
> users mailing listusers at lists.scilab.orghttps://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users
>
> --
> Stéphane Mottelet
> Ingénieur de recherche
> EA 4297 Transformations Intégrées de la Matière Renouvelable
> Département Génie des Procédés Industriels
> Sorbonne Universités - Université de Technologie de Compiègne
> CS 60319, 60203 Compiègne cedex
> Tel : +33(0)344234688http://www.utc.fr/~mottelet
>
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20201204/c015c7a9/attachment.htm>


More information about the users mailing list