Hi all,

I'm a bit confused by functions in Scilab and specifically the way they handle their arguments. For instance, in the following code

deff('g(x)','disp(x)');
g; // produces an error saying x is not defined
x = 1;
g; // call the function g and displays x...

leads to two questions,

 * the function g is called each time, shouldn't it be only displayed?
 * the second call 'works' and display x, even if the argument of the
   function has not been provided.  I've read the page concerning
   scoping of variables
   <https://wiki.scilab.org/howto/global%20and%20local%20variables> in
   Scilab, but shouldn't it says that the function was expecting 1
   argument?

This feels a bit unsafe to me, I'm wondering what is the reason behind this choice?

Best regards,

Pierre

_______________________________________________
users mailing list
[email protected]
http://lists.scilab.org/mailman/listinfo/users

Reply via email to