<div dir="auto">Please remove me from this mailing list.<div dir="auto"><br></div><div dir="auto">Thank you,</div><div dir="auto">Namrata</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Feb 26, 2021, 7:29 PM Stéphane Mottelet <<a href="mailto:stephane.mottelet@utc.fr">stephane.mottelet@utc.fr</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi devs,<br>
<br>
Just after changing the rule in macro.cpp I see this at startup, and I <br>
am laughing out loud ;-)<br>
<br>
Scilab branch-6.1 (Feb 19 2021, 14:37:51)<br>
at line    44 of function mdelete            ( <br>
/Users/mottelet/git/scilab_6.1.orig/scilab/modules/fileio/macros/mdelete.sci <br>
line 57 )<br>
at line    26 of function atomsAUWriteAccess ( <br>
/Users/mottelet/git/scilab_6.1.orig/scilab/modules/atoms/macros/atoms_internals/atomsAUWriteAccess.sci <br>
line 42 )<br>
at line    11 of function atomsSystemInit    ( <br>
/Users/mottelet/git/scilab_6.1.orig/scilab/modules/atoms/macros/atomsSystemInit.sci <br>
line 27 )<br>
<br>
Wrong number of input arguments.<br>
<br>
--><br>
<br>
Does it mean that we use the "crappy shortcut" as a feature in Scilab <br>
internals ?<br>
<br>
S.<br>
<br>
Le 26/02/2021 à 14:38, Stéphane Mottelet a écrit :<br>
> Hi all,<br>
><br>
> In Scilab the scope of variables is quite permissive but even in Julia <br>
> (really strict rules) we can have the following behavior:<br>
><br>
> function y=f(x)<br>
>  y=x+a;<br>
> end<br>
><br>
> a=1;<br>
> f(2)<br>
> a=2;<br>
> f(3)<br>
><br>
> -> a=1;<br>
><br>
> --> f(2)<br>
>  ans  =<br>
><br>
>    3.<br>
><br>
> --> a=2;<br>
><br>
> --> f(3)<br>
>  ans  =<br>
><br>
>    5.<br>
><br>
> Yesterday afternoon I was my students for a Scilab beginners tutorial, <br>
> and by accident one of them had "x" defined before in the main <br>
> workspace and tried to call f without arguments. I reproduce the <br>
> experiment here by explicitely defining x before the call:<br>
><br>
> x=1;<br>
> f<br>
><br>
> --> x=1;<br>
><br>
> --> f<br>
>  ans  =<br>
><br>
>    3.<br>
><br>
> Allowing the function inner scope to see variables of the outer scope <br>
> is one thing, you may or may not agree this is not the point here, but <br>
> allowing to call f without arguments just because the formal input <br>
> parameter has the same symbol as an outer scope symbol is another <br>
> thing. I knew this was possible even if i never used such a feature, <br>
> but my students were so puzzled by this, particularly those who <br>
> already learned other low-level languages, that I decided to propose <br>
> the suppression of this, that I consider as a serious potential source <br>
> of many bugs. Don't tell me that this would break some user code <br>
> because I frankly have no consideration for this kind of crappy <br>
> shortcut and, sorry if it may sound rude, for programmers who use it...<br>
><br>
> S.<br>
><br>
-- <br>
Stéphane Mottelet<br>
Ingénieur de recherche<br>
EA 4297 Transformations Intégrées de la Matière Renouvelable<br>
Département Génie des Procédés Industriels<br>
Sorbonne Universités - Université de Technologie de Compiègne<br>
CS 60319, 60203 Compiègne cedex<br>
Tel : +33(0)344234688<br>
<a href="http://www.utc.fr/~mottelet" rel="noreferrer noreferrer" target="_blank">http://www.utc.fr/~mottelet</a><br>
<br>
_______________________________________________<br>
dev mailing list<br>
<a href="mailto:dev@lists.scilab.org" target="_blank" rel="noreferrer">dev@lists.scilab.org</a><br>
<a href="http://lists.scilab.org/mailman/listinfo/dev" rel="noreferrer noreferrer" target="_blank">http://lists.scilab.org/mailman/listinfo/dev</a><br>
</blockquote></div>