[Scilab-users] Arguments of functions in Scilab

Samuel Gougeon sgougeon at free.fr
Sun Mar 5 16:15:35 CET 2017


Le 05/03/2017 à 16:06, Samuel Gougeon a écrit :
>
> Le 04/03/2017 à 12:27, Pierre Vuillemin a écrit :
>>
>> 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?
>>
>
> I agree with you: since g is written without (empty) (), considering 
> it as the function handle instead of a function call would be more 
> consistent, as when we write: d = g  // to set an alias of g.

Hmm, actually, such a change would prevent handy calls like
--> help
Having to enter
--> help()
would be definitely less handy.

Samuel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20170305/05a65dac/attachment.htm>


More information about the users mailing list