<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hi,<br>
</p>
<div class="moz-cite-prefix">Le 24/11/2021 à 18:07, Samuel Gougeon a
écrit :<br>
</div>
<blockquote type="cite"
cite="mid:50880f14-0fad-5eb4-b8c3-c79a38c99fe9@free.fr">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<div class="moz-cite-prefix">Le 24/11/2021 à 09:51, Stéphane
Mottelet a écrit :<br>
</div>
<blockquote type="cite"
cite="mid:d2524bec-c4bd-7a40-d74b-baf5eab7edb8@utc.fr">
<meta http-equiv="Content-Type" content="text/html;
charset=UTF-8">
<p>Hi,<br>
</p>
<div class="moz-cite-prefix">Le 24/11/2021 à 01:42, Federico
Miyara a écrit :<br>
</div>
<blockquote type="cite"
cite="mid:1250650f-0161-3eff-37ee-1ea69b625508@fceia.unr.edu.ar">
<meta http-equiv="Content-Type" content="text/html;
charset=UTF-8">
<br>
<font face="Courier New">I'm not completely sure, but I think
this is not possible since what is passed to the function
isn't a variable but the value contained in the variable.</font></blockquote>
<font face="Courier New">No. Internally, input arguments are
passed as references to the true object. There is no copy <font
color="#0000ff"><i>unless an input argument <b>is modified</b></i></font>
in the function (in that case a copy with local scope only). </font><br>
</blockquote>
<p><br>
</p>
<p>Are you sure about that? Not when they are only reached in read
mode?</p>
<p>I might have misunderstood, but i remember a discussion with
Clément during the last ScilabTech. Clément was categorically
stating that all input arguments are copied, only and always
copied.</p>
</blockquote>
<p>It depends on the type of Callable. If you are talking about
Scilab macros, inputs are (hopefully) never copied. However, if
you are talking about old-style Scilab 5 C-gateways, yes, there is
a wrapper that triggers a copy :</p>
<p><a class="moz-txt-link-freetext" href="https://github.com/opencollab/scilab/blob/master/scilab/modules/ast/src/cpp/types/function.cpp#L333">https://github.com/opencollab/scilab/blob/master/scilab/modules/ast/src/cpp/types/function.cpp#L333</a></p>
<p>New cppsci gateways always pass arguments by reference, which
allows to modify arguments. This is a feature which is used (at
least) in Julia, and the convention they use adds a exclamation
mark at the end of the name. This feature is not used in Scilab,
this is a pity...<br>
</p>
<p>S.<br>
</p>
<p><br>
</p>
<blockquote type="cite"
cite="mid:50880f14-0fad-5eb4-b8c3-c79a38c99fe9@free.fr"> Samuel<br>
<br>
<fieldset class="moz-mime-attachment-header"></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="http://lists.scilab.org/mailman/listinfo/users">http://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>