<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Hello Guylaine,<br>
      <br>
      Le 31/07/2015 11:46, Collewet Guylaine a écrit :<br>
    </div>
    <blockquote cite="mid:002601d0cb75$ba412cb0$2ec38610$@irstea.fr"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-1">
      <meta name="Generator" content="Microsoft Word 14 (filtered
        medium)">
      <style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal"><span lang="EN-US">Hello,<o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">I want to use together
            two atoms modules that have some functions with the same
            names. <o:p></o:p></span></p>
        <p class="MsoNormal"><span lang="EN-US">Is there a way to
            indicate the name of the module I want to use when I call
            one function ?</span></p>
      </div>
    </blockquote>
    If both functions -- say fun() -- are functions written in Scilab
    language -- i mean none of them is a built-in function --,<br>
    then in dictinct ATOMS modules they should belong to two distinct 
    libraries, say atoms1_lib and atoms2_lib.<br>
    As far as i remember, the default foo() that will be called by foo()
    is the one belonging to the library<br>
    that has been the most recently loaded. Anyway, to force using a
    instanciation rather than the other, you<br>
    can use either atoms1_lib.foo()  or atoms2_lib.foo() syntax. This
    forces Scilab to use the specified library.<br>
    <br>
    In case of conflict between a built-in and a function (aka "macro")
    : if you define a macro with the name of<br>
    a previously loaded built-in, the macro crushes the built-in. I do
    not know whether it is possible to still call <br>
    the built-in as is. But you can clone it before overwritting its
    first name -- say atoms1_foo = foo (*), and then <br>
    use atoms1_foo() when required -- before crushing it with the
    forthcoming foo(). Humm, <br>
    "you can" do that in an absolute way ; but if both  ATOMS modules
    are autoloaded, you cannot introduce <br>
    such a cloning instruction in the autoloading stack.<br>
    In such a case, you may cancel autoloading for both modules, and add
    loading and cloning instructions in<br>
    the your personal startup file.<br>
    <br>
    HTH <br>
    Samuel<br>
    <br>
    (*) this way of doing becomes the only one possible in Scilab 6,
    because newfun() and funptr() are being <br>
    removed from SCilab 6. But i met some cases for which this kind of
    cloning failed, while it was OK when <br>
    cloning with newfun("atoms1_foo", funptr("foo")). I did not clearly
    caught from where and when it occurred<br>
    -- may be when foo is used recursively.. --, but after some
    investigations i found that (still in scilab 5.5.2):<br>
    // after<br>
    -->funptr("disp")<br>
     ans  = <br>
        33004.  <br>
    <br>
    -->d = disp<br>
     d  =<br>
     <br>
    -->funptr("d")<br>
     ans  = <br>
        0.  <br>
     <br>
    -->clear d<br>
     <br>
    -->newfun("d", funptr("disp"))<br>
     <br>
    -->funptr("d")<br>
     ans  = <br>
        33004.  <br>
    <br>
    It is somewhat reported there: <a class="moz-txt-link-freetext" href="http://bugzilla.scilab.org/12965">http://bugzilla.scilab.org/12965</a><br>
    About effects of cloning built-in:=, see also
    <a class="moz-txt-link-freetext" href="http://bugzilla.scilab.org/8281">http://bugzilla.scilab.org/8281</a><br>
    <br>
  </body>
</html>