<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hi all,</p>
<p>I'm a bit confused by functions in Scilab and specifically the
way they handle their arguments. For instance, in the following
code</p>
<p><font size="-1">deff('g(x)','disp(x)');</font><br>
<font size="-1">g; // produces an error saying x is not defined</font><br>
<font size="-1">x = 1;</font><br>
<font size="-1">g; // call the function g and displays x...</font><br>
</p>
<p>leads to two questions,<br>
</p>
<ul>
<li>the function g is called each time, shouldn't it be only
displayed?</li>
<li>the second call 'works' and display x, even if the argument of
the function has not been provided. I've read the page
concerning <a
href="https://wiki.scilab.org/howto/global%20and%20local%20variables">scoping
of variables</a> in Scilab, but shouldn't it says that the
function was expecting 1 argument?<br>
</li>
</ul>
<p>This feels a bit unsafe to me, I'm wondering what is the reason
behind this choice?<br>
</p>
<p>Best regards,</p>
<p>Pierre<br>
</p>
</body>
</html>