<div dir="ltr">It is a curious example, but the availability of variables from the outer scope 

makes global variable declarations and multiple input arguments unnecessary in many cases. 

I think it deserves praise, in fact it is one of the best advantages of Scilab over certain software whose name starts with M.<div><div>By the way, the pause - resume command pair is another Scilab's marvel, <a href="https://bugzilla.scilab.org/buglist.cgi?quicksearch=pause%20resume">it should be fixed</a></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">El vie, 26 feb 2021 a las 9:02, Stéphane Mottelet (<<a href="mailto:stephane.mottelet@utc.fr" target="_blank">stephane.mottelet@utc.fr</a>>) escribió:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Le 26/02/2021 à 14:50, Stéphane Mottelet a écrit :<br>
<br>
> 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>
of course nobody uses it, my patch waas a little bit rude. We have the <br>
right to call macros with less arguments than the number of formal input <br>
arguments, hence when inheriting the outer context then there is a <br>
complete confusion between the formal parameter name and the same name <br>
of a symbol in the outer context. Inheritance should be OK for all <br>
symbols BUT formal input parameters.<br>
<br>
S.<br>
<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 <br>
>> Julia (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 <br>
>> tutorial, and by accident one of them had "x" defined before in the <br>
>> main 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, <br>
>> but allowing to call f without arguments just because the formal <br>
>> input parameter has the same symbol as an outer scope symbol is <br>
>> another thing. I knew this was possible even if i never used such a <br>
>> feature, but my students were so puzzled by this, particularly those <br>
>> who already learned other low-level languages, that I decided to <br>
>> propose the suppression of this, that I consider as a serious <br>
>> potential source of many bugs. Don't tell me that this would break <br>
>> some user code because I frankly have no consideration for this kind <br>
>> of crappy shortcut and, sorry if it may sound rude, for programmers <br>
>> 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" target="_blank">http://www.utc.fr/~mottelet</a><br>
<br>
_______________________________________________<br>
dev mailing list<br>
<a href="mailto:dev@lists.scilab.org" target="_blank">dev@lists.scilab.org</a><br>
<a href="http://lists.scilab.org/mailman/listinfo/dev" rel="noreferrer" target="_blank">http://lists.scilab.org/mailman/listinfo/dev</a><br>
</blockquote></div>

<br>
<b style="color:rgb(34,34,34);font-family:Calibri,sans-serif;font-size:14.6667px;font-style:normal;letter-spacing:normal;text-align:justify;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255)"><span style="font-size:6.5pt;line-height:9.96667px;font-family:"Ancizar Sans",sans-serif;color:black">Aviso legal:</span></b><span style="font-style:normal;font-weight:400;letter-spacing:normal;text-align:justify;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);font-size:6.5pt;line-height:9.96667px;font-family:"Ancizar Sans",sans-serif;color:black"> El contenido de este mensaje y los archivos adjuntos son confidenciales y de uso exclusivo de la Universidad Nacional de Colombia. Se encuentran dirigidos sólo para el uso del destinatario al cual van enviados. La reproducción, lectura y/o copia se encuentran prohibidas a cualquier persona diferente a este y puede ser ilegal. Si usted lo ha recibido por error, infórmenos y elimínelo de su correo. Los Datos Personales serán tratados conforme a la Ley 1581 de 2012 y a nuestra Política de Datos Personales que podrá consultar en la página web </span><span style="color:rgb(34,34,34);font-family:Calibri,sans-serif;font-style:normal;font-weight:400;letter-spacing:normal;text-align:justify;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);font-size:6.5pt;line-height:9.96667px"><a href="http://www.unal.edu.co/" style="color:blue" target="_blank"><span style="font-family:"Ancizar Sans",sans-serif">www.unal.edu.co</span></a></span><span style="font-style:normal;font-weight:400;letter-spacing:normal;text-align:justify;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);font-size:6.5pt;line-height:9.96667px;font-family:"Ancizar Sans",sans-serif;color:black">.<u><span> </span></u>Las opiniones, informaciones, conclusiones y cualquier otro tipo de dato contenido en este correo electrónico, no relacionados con la actividad de la Universidad Nacional de Colombia, se entenderá como personales y de ninguna manera son avaladas por la Universidad.</span><br><span style="color:rgb(245,132,111);font-family:ClearSans-Regular,Arial,Verdana,Helvetica,sans-serif;font-size:14px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);display:inline!important;float:none"><span></span></span><span style="color:rgb(245,132,111);font-family:ClearSans-Regular,Arial,Verdana,Helvetica,sans-serif;font-size:14px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);display:inline!important;float:none"><span></span></span>