<div dir="ltr"><div>Please enlighten me....on my PC the current situation is like this:</div><div></div><div><br></div><div>Scilab 6.1.0</div><div><br></div><div>Loading order 1:</div><div>- scicv</div><div>- IPCV</div><div></div><div>--> in console: help imread</div><div></div><div><br></div><div>--> img = imread(filename[,flag]) // hence the imread function from scicv is found / used (?)<br></div><div><br></div><div>-------<br></div><div>
<div>Loading order 2:</div><div><br></div><div>- IPCV</div><div>- scicv<br></div><div>--> in console: help imread</div><div><br></div><div>--> im = imread(filename)</div><div>--> im = imread(url) // hence the imread function from IPCV is found / used (?)</div>
</div><div><br></div><div>Does this not describe what Chin Luh has mentioned?</div><div><br></div><div><br></div><div>The behaviour described above would be different, when there is:</div><div></div><div>scicv.imread</div><div>IPCV.imread<br></div><div></div><div><br></div><div>...which is indeed python-like.<br></div><div><br></div><div>Thanks for your patience.</div><div><br></div><div>Philipp<br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Am Sa., 5. Dez. 2020 um 01:56 Uhr schrieb Chin Luh Tan <<a href="mailto:tanchinluh@gmail.com">tanchinluh@gmail.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi Samuel, <div><br></div><div>Thanks for your details explanations and examples, they are really helpful. Yes you're right, the functions loaded are base on what you have describe, not depending on the order the modules being loaded. Thanks for pointing this out. </div><div><br></div><div>Regards,</div><div>Chin Luh</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, 5 Dec 2020 at 02:37, Samuel Gougeon <<a href="mailto:sgougeon@free.fr" target="_blank">sgougeon@free.fr</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<div>Hello Chin Luh,</div>
<div><br>
</div>
<div>Le 04/12/2020 à 01:57, Chin Luh Tan a
écrit :<br>
</div>
<blockquote type="cite">
<div dir="ltr">Hi all,
<div><br>
</div>
<div>Stephane, Thanks for the quick examples to illustrate
this.</div>
<div><br>
</div>
<div>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. </div>
<div><br>
</div>
<div>There are 2 potential issues which we should take notes: </div>
<div>1. The module which is loaded last, will have the
"dominant" in the base function. <br>
</div>
</div>
</blockquote>
<p>Are you sure about this? This was the rule with Scilab 5, but the
removal of the variables stack changed it within Scilab 6. I
noticed with Scilab 6.0 that the libraries are scanned for the
required function only after sorting their names in
anti-alphabetical order.<br>
So if both alib.myfunc() and zlib.myfunc() exist, myfunc() will
call zlib.myfunc(), whatever is the loading order of alib and
zlib.<br>
</p>
<p>On this respect, neither the
<a href="https://help.scilab.org/docs/6.1.0/en_US/library.html" target="_blank">https://help.scilab.org/docs/6.1.0/en_US/library.html</a> page is
up-to-date, not other pages dealing with libraries, like the
genlib().<br>
Here is the test:</p>
<pre style="font-family:Monospaced;font-style:normal"><span style="color:rgb(0,0,0)">File</span> <span style="color:rgb(92,92,92)">=</span> <span style="color:rgb(218,112,214)">TMPDIR</span><span style="color:rgb(92,92,92)">+</span><span style="color:rgb(188,143,143)">"</span><span style="color:rgb(188,143,143)">\test\</span><span style="color:rgb(188,143,143)">"</span><span style="color:rgb(0,0,0)">;</span>
<span style="color:rgb(0,0,0)">mkdir</span><span style="color:rgb(74,85,219)">(</span><span style="color:rgb(0,0,0)">File</span><span style="color:rgb(92,92,92)">+</span><span style="color:rgb(188,143,143)">"</span><span style="color:rgb(188,143,143)">alib</span><span style="color:rgb(188,143,143)">"</span><span style="color:rgb(74,85,219)">)</span><span style="color:rgb(0,0,0)">;</span>
<span style="color:rgb(0,0,0)">mkdir</span><span style="color:rgb(74,85,219)">(</span><span style="color:rgb(0,0,0)">File</span><span style="color:rgb(92,92,92)">+</span><span style="color:rgb(188,143,143)">"</span><span style="color:rgb(188,143,143)">zlib</span><span style="color:rgb(188,143,143)">"</span><span style="color:rgb(74,85,219)">)</span><span style="color:rgb(0,0,0)">;</span>
<span style="color:rgb(0,0,0)">code</span> <span style="color:rgb(92,92,92)">=</span> <span style="color:rgb(74,85,219)">[</span> <span style="color:rgb(188,143,143)">"</span><span style="color:rgb(188,143,143)">function test()</span><span style="color:rgb(188,143,143)">"</span> <span style="color:rgb(0,0,0)">;</span> <span style="color:rgb(188,143,143)">"</span><span style="color:rgb(188,143,143)"> disp(""test from alib"")</span><span style="color:rgb(188,143,143)">"</span> <span style="color:rgb(0,0,0)">;</span> <span style="color:rgb(188,143,143)">"</span><span style="color:rgb(188,143,143)">endfunction</span><span style="color:rgb(188,143,143)">"</span><span style="color:rgb(74,85,219)">]</span><span style="color:rgb(0,0,0)">;</span>
<span style="color:rgb(50,185,185)">mputl</span><span style="color:rgb(74,85,219)">(</span><span style="color:rgb(0,0,0)">code</span><span style="color:rgb(0,0,0)">,</span> <span style="color:rgb(0,0,0)">File</span><span style="color:rgb(92,92,92)">+</span><span style="color:rgb(188,143,143)">"</span><span style="color:rgb(188,143,143)">alib\test.sci</span><span style="color:rgb(188,143,143)">"</span><span style="color:rgb(74,85,219)">)</span><span style="color:rgb(0,0,0)">;</span>
<span style="color:rgb(50,185,185)">genlib</span><span style="color:rgb(74,85,219)">(</span><span style="color:rgb(188,143,143)">"</span><span style="color:rgb(188,143,143)">alib</span><span style="color:rgb(188,143,143)">"</span><span style="color:rgb(0,0,0)">,</span> <span style="color:rgb(0,0,0)">File</span><span style="color:rgb(92,92,92)">+</span><span style="color:rgb(188,143,143)">"</span><span style="color:rgb(188,143,143)">alib</span><span style="color:rgb(188,143,143)">"</span><span style="color:rgb(74,85,219)">)</span><span style="color:rgb(0,0,0)">;</span>
<span style="color:rgb(0,0,0)">code</span> <span style="color:rgb(92,92,92)">=</span> <span style="color:rgb(74,85,219)">[</span> <span style="color:rgb(188,143,143)">"</span><span style="color:rgb(188,143,143)">function test()</span><span style="color:rgb(188,143,143)">"</span> <span style="color:rgb(0,0,0)">;</span> <span style="color:rgb(188,143,143)">"</span><span style="color:rgb(188,143,143)"> disp(""test from zlib"")</span><span style="color:rgb(188,143,143)">"</span> <span style="color:rgb(0,0,0)">;</span> <span style="color:rgb(188,143,143)">"</span><span style="color:rgb(188,143,143)">endfunction</span><span style="color:rgb(188,143,143)">"</span><span style="color:rgb(74,85,219)">]</span><span style="color:rgb(0,0,0)">;</span>
<span style="color:rgb(50,185,185)">mputl</span><span style="color:rgb(74,85,219)">(</span><span style="color:rgb(0,0,0)">code</span><span style="color:rgb(0,0,0)">,</span> <span style="color:rgb(0,0,0)">File</span><span style="color:rgb(92,92,92)">+</span><span style="color:rgb(188,143,143)">"</span><span style="color:rgb(188,143,143)">zlib\test.sci</span><span style="color:rgb(188,143,143)">"</span><span style="color:rgb(74,85,219)">)</span><span style="color:rgb(0,0,0)">;</span>
<span style="color:rgb(50,185,185)">genlib</span><span style="color:rgb(74,85,219)">(</span><span style="color:rgb(188,143,143)">"</span><span style="color:rgb(188,143,143)">zlib</span><span style="color:rgb(188,143,143)">"</span><span style="color:rgb(0,0,0)">,</span> <span style="color:rgb(0,0,0)">File</span><span style="color:rgb(92,92,92)">+</span><span style="color:rgb(188,143,143)">"</span><span style="color:rgb(188,143,143)">zlib</span><span style="color:rgb(188,143,143)">"</span><span style="color:rgb(74,85,219)">)</span><span style="color:rgb(0,0,0)">;</span>
<span style="color:rgb(50,185,185)">clear</span> <span style="color:rgb(188,143,143)">alib</span> <span style="color:rgb(188,143,143)">zlib</span>
<span style="color:rgb(50,185,185)">load</span><span style="color:rgb(74,85,219)">(</span><span style="color:rgb(0,0,0)">File</span><span style="color:rgb(92,92,92)">+</span><span style="color:rgb(188,143,143)">"</span><span style="color:rgb(188,143,143)">zlib\lib</span><span style="color:rgb(188,143,143)">"</span><span style="color:rgb(74,85,219)">)</span>
<span style="color:rgb(50,185,185)">load</span><span style="color:rgb(74,85,219)">(</span><span style="color:rgb(0,0,0)">File</span><span style="color:rgb(92,92,92)">+</span><span style="color:rgb(188,143,143)">"</span><span style="color:rgb(188,143,143)">alib\lib</span><span style="color:rgb(188,143,143)">"</span><span style="color:rgb(74,85,219)">)</span>
<span style="color:rgb(0,0,0)">test</span><span style="color:rgb(74,85,219)">(</span><span style="color:rgb(74,85,219)">)
<font face="monospace">--> test()
"test from zlib"</font>
</span></pre>
<blockquote type="cite">
<div dir="ltr">
<div>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".</div>
<div>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.</div>
</div>
</blockquote>
<p>This is true only if the homonymous function is called without
specifying its library. Otherwise, the name resolution works:</p>
<pre style="font-family:Monospaced;font-style:normal"><span style="color:rgb(0,0,0)">File</span> <span style="color:rgb(92,92,92)">=</span> <span style="color:rgb(218,112,214)">TMPDIR</span><span style="color:rgb(92,92,92)">+</span><span style="color:rgb(188,143,143)">"</span><span style="color:rgb(188,143,143)">\test\</span><span style="color:rgb(188,143,143)">"</span><span style="color:rgb(0,0,0)">;</span>
<span style="color:rgb(0,0,0)">mkdir</span><span style="color:rgb(74,85,219)">(</span><span style="color:rgb(0,0,0)">File</span><span style="color:rgb(92,92,92)">+</span><span style="color:rgb(188,143,143)">"</span><span style="color:rgb(188,143,143)">alib</span><span style="color:rgb(188,143,143)">"</span><span style="color:rgb(74,85,219)">)</span><span style="color:rgb(0,0,0)">;</span>
<span style="color:rgb(0,0,0)">code</span> <span style="color:rgb(92,92,92)">=</span> <span style="color:rgb(74,85,219)">[</span> <span style="color:rgb(188,143,143)">"</span><span style="color:rgb(188,143,143)">function cos(a)</span><span style="color:rgb(188,143,143)">"</span> <span style="color:rgb(0,0,0)">;</span> <span style="color:rgb(188,143,143)">"</span><span style="color:rgb(188,143,143)"> disp(""cos() from alib"")</span><span style="color:rgb(188,143,143)">"</span> <span style="color:rgb(0,0,0)">;</span> <span style="color:rgb(188,143,143)">"</span><span style="color:rgb(188,143,143)">endfunction</span><span style="color:rgb(188,143,143)">"</span><span style="color:rgb(74,85,219)">]</span><span style="color:rgb(0,0,0)">;</span>
<span style="color:rgb(50,185,185)">mputl</span><span style="color:rgb(74,85,219)">(</span><span style="color:rgb(0,0,0)">code</span><span style="color:rgb(0,0,0)">,</span> <span style="color:rgb(0,0,0)">File</span><span style="color:rgb(92,92,92)">+</span><span style="color:rgb(188,143,143)">"</span><span style="color:rgb(188,143,143)">alib\cos.sci</span><span style="color:rgb(188,143,143)">"</span><span style="color:rgb(74,85,219)">)</span><span style="color:rgb(0,0,0)">;</span>
<span style="color:rgb(50,185,185)">genlib</span><span style="color:rgb(74,85,219)">(</span><span style="color:rgb(188,143,143)">"</span><span style="color:rgb(188,143,143)">alib</span><span style="color:rgb(188,143,143)">"</span><span style="color:rgb(0,0,0)">,</span> <span style="color:rgb(0,0,0)">File</span><span style="color:rgb(92,92,92)">+</span><span style="color:rgb(188,143,143)">"</span><span style="color:rgb(188,143,143)">alib</span><span style="color:rgb(188,143,143)">"</span><span style="color:rgb(74,85,219)">)</span><span style="color:rgb(0,0,0)">;</span>
<span style="color:rgb(50,185,185)">clear</span> <span style="color:rgb(188,143,143)">alib</span>
<span style="color:rgb(50,185,185)">load</span><span style="color:rgb(74,85,219)">(</span><span style="color:rgb(0,0,0)">File</span><span style="color:rgb(92,92,92)">+</span><span style="color:rgb(188,143,143)">"</span><span style="color:rgb(188,143,143)">alib\lib</span><span style="color:rgb(188,143,143)">"</span><span style="color:rgb(74,85,219)">)
</span><span style="color:rgb(50,185,185)">cos</span><span style="color:rgb(74,85,219)">(</span><span style="color:rgb(188,143,143)">1</span><span style="color:rgb(74,85,219)">)</span>
<span style="color:rgb(0,0,0)">alib</span><span style="color:rgb(92,92,92)">.</span><span style="color:rgb(170,170,170)">cos</span><span style="color:rgb(74,85,219)">(</span><span style="color:rgb(188,143,143)">1</span><span style="color:rgb(74,85,219)">)
</span></pre>
<p><font face="monospace">--> cos(1)<br>
ans =<br>
0.5403023<br>
<br>
--> alib.cos(1)<br>
"cos() from alib"</font><br>
</p>
<p>Best regards<br>
Samuel<br>
<br>
</p>
</div>
_______________________________________________<br>
users mailing list<br>
<a href="mailto:users@lists.scilab.org" target="_blank">users@lists.scilab.org</a><br>
<a href="http://lists.scilab.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.scilab.org/mailman/listinfo/users</a><br>
</blockquote></div>
_______________________________________________<br>
users mailing list<br>
<a href="mailto:users@lists.scilab.org" target="_blank">users@lists.scilab.org</a><br>
<a href="http://lists.scilab.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.scilab.org/mailman/listinfo/users</a><br>
</blockquote></div>