<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hi,</p>
    <p><a class="moz-txt-link-freetext" href="https://codereview.scilab.org/#/c/20679/">https://codereview.scilab.org/#/c/20679/</a> says:</p>
    <p>add a %foo_clear overloading on mlist
      This overload will be called at the end of the scope when a
      variable
      will not be accessible anymore for clearing allocated data.</p>
    <p>So it does not say that %foo_clear is called when using "clear".
      The following example seems more relevant:</p>
    <p>function %test_clear(t)<br>
        disp cleared<br>
      end</p>
    <p>function foo()<br>
        m=mlist("test")<br>
      end</p>
    <p>--> foo()<br>
      <br>
        "cleared"<br>
    </p>
    <div class="moz-cite-prefix">S.</div>
    <div class="moz-cite-prefix"><br>
    </div>
    <div class="moz-cite-prefix">Le 01/07/2020 à 13:13, Samuel Gougeon a
      écrit :<br>
    </div>
    <blockquote type="cite"
      cite="mid:3a501904-9e8d-7cdd-e0f9-34ace88bf079@free.fr">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <p><font face="Arial">Hello,</font></p>
      <p><font face="Arial">Scilab 6.1.0 brings a feature about clearing
          mlists, that can now be overloaded.<br>
          <br>
          However, it's a special overloading feature, that does not
          replace the role of clear(), but that comes in addition to it,
          as documented in the clear page: <a
            class="moz-txt-link-freetext"
href="https://antispam.utc.fr/proxy/2/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/help.scilab.org/docs/6.1.0/en_US/clear.html"
            moz-do-not-send="true">https://help.scilab.org/docs/6.1.0/en_US/clear.html</a></font></p>
      <p><font face="Arial">"Note: </font><code class="literal"
          dir="ltr" style="font-size: 13px; color: rgb(0, 0, 0);
          font-style: normal; font-variant-ligatures: normal;
          font-variant-caps: normal; font-weight: 400; letter-spacing:
          normal; orphans: 2; text-align: start; text-indent: 0px;
          text-transform: none; white-space: normal; widows: 2;
          word-spacing: 0px; -webkit-text-stroke-width: 0px;
          text-decoration-style: initial; text-decoration-color:
          initial;">clear()</code><span style="color: rgb(0, 0, 0);
          font-family: sans-serif; font-size: 16px; font-style: normal;
          font-variant-ligatures: normal; font-variant-caps: normal;
          font-weight: 400; letter-spacing: normal; orphans: 2;
          text-align: start; text-indent: 0px; text-transform: none;
          white-space: normal; widows: 2; word-spacing: 0px;
          -webkit-text-stroke-width: 0px; text-decoration-style:
          initial; text-decoration-color: initial; display: inline
          !important; float: none;"><span> </span>can be overloaded for
          any<span> </span></span><code class="literal" dir="ltr"
          style="font-size: 13px; color: rgb(0, 0, 0); font-style:
          normal; font-variant-ligatures: normal; font-variant-caps:
          normal; font-weight: 400; letter-spacing: normal; orphans: 2;
          text-align: start; text-indent: 0px; text-transform: none;
          white-space: normal; widows: 2; word-spacing: 0px;
          -webkit-text-stroke-width: 0px; text-decoration-style:
          initial; text-decoration-color: initial;">mlist("foo")</code><span
          style="color: rgb(0, 0, 0); font-family: sans-serif;
          font-size: 16px; font-style: normal; font-variant-ligatures:
          normal; font-variant-caps: normal; font-weight: 400;
          letter-spacing: normal; orphans: 2; text-align: start;
          text-indent: 0px; text-transform: none; white-space: normal;
          widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;
          text-decoration-style: initial; text-decoration-color:
          initial; display: inline !important; float: none;"><span> </span>type,
          by defining a<span> </span></span><code class="literal"
          dir="ltr" style="font-size: 13px; color: rgb(0, 0, 0);
          font-style: normal; font-variant-ligatures: normal;
          font-variant-caps: normal; font-weight: 400; letter-spacing:
          normal; orphans: 2; text-align: start; text-indent: 0px;
          text-transform: none; white-space: normal; widows: 2;
          word-spacing: 0px; -webkit-text-stroke-width: 0px;
          text-decoration-style: initial; text-decoration-color:
          initial;">%foo_clear()</code><span style="color: rgb(0, 0, 0);
          font-family: sans-serif; font-size: 16px; font-style: normal;
          font-variant-ligatures: normal; font-variant-caps: normal;
          font-weight: 400; letter-spacing: normal; orphans: 2;
          text-align: start; text-indent: 0px; text-transform: none;
          white-space: normal; widows: 2; word-spacing: 0px;
          -webkit-text-stroke-width: 0px; text-decoration-style:
          initial; text-decoration-color: initial; display: inline
          !important; float: none;"><span> </span>macro. It will be
          called either when<span> </span></span><code class="literal"
          dir="ltr" style="font-size: 13px; color: rgb(0, 0, 0);
          font-style: normal; font-variant-ligatures: normal;
          font-variant-caps: normal; font-weight: 400; letter-spacing:
          normal; orphans: 2; text-align: start; text-indent: 0px;
          text-transform: none; white-space: normal; widows: 2;
          word-spacing: 0px; -webkit-text-stroke-width: 0px;
          text-decoration-style: initial; text-decoration-color:
          initial;">clear</code><span style="color: rgb(0, 0, 0);
          font-family: sans-serif; font-size: 16px; font-style: normal;
          font-variant-ligatures: normal; font-variant-caps: normal;
          font-weight: 400; letter-spacing: normal; orphans: 2;
          text-align: start; text-indent: 0px; text-transform: none;
          white-space: normal; widows: 2; word-spacing: 0px;
          -webkit-text-stroke-width: 0px; text-decoration-style:
          initial; text-decoration-color: initial; display: inline
          !important; float: none;"><span> </span>is explicitly applied
          to any mlist of this type, or implicitly when any mlist of
          this type is deleted when leaving the environment where it has
          been defined."</span></p>
      <p><span style="color: rgb(0, 0, 0); font-family: sans-serif;
          font-size: 16px; font-style: normal; font-variant-ligatures:
          normal; font-variant-caps: normal; font-weight: 400;
          letter-spacing: normal; orphans: 2; text-align: start;
          text-indent: 0px; text-transform: none; white-space: normal;
          widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px;
          text-decoration-style: initial; text-decoration-color:
          initial; display: inline !important; float: none;">Now, when i
          try to use this feature, i do not get what i understand we
          should expect. Example:</span></p>
      <p><tt><span style="color: rgb(0, 0, 0); font-size: 16px;
            font-style: normal; font-variant-ligatures: normal;
            font-variant-caps: normal; font-weight: 400; letter-spacing:
            normal; text-align: start; text-indent: 0px; text-transform:
            none; white-space: normal; word-spacing: 0px;
            -webkit-text-stroke-width: 0px; text-decoration-style:
            initial; text-decoration-color: initial; display: inline
            !important; float: none;">--> m = mlist("test");<br>
            --> typeof(m)<br>
             ans  =<br>
              "test"<br>
            <br>
            --> function %test_clear()<br>
              >     disp("mlist test cleared")<br>
              > endfunction<br>
            <br>
            --> clear m<br>
          </span></tt><tt>-->     <<<< nothing is
          printed. We would expect "mlist test cleared", wouldn't we?</tt></p>
      <p><br>
      </p>
      <p>What am i doing wrong?</p>
      <p>Regards<br>
        Samuel<br>
      </p>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
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="https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users">https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users</a>
</pre>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
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)344234688
<a class="moz-txt-link-freetext" href="http://www.utc.fr/~mottelet">http://www.utc.fr/~mottelet</a>
</pre>
  </body>
</html>