[Scilab-users] On parameters passing by name in scilab functions

Samuel Gougeon sgougeon at free.fr
Mon Feb 27 23:30:25 CET 2017


Adelson,

It could somewhat misleading to get conclusions about Scilab behavior  
with named parameters out of the current fft() behavior, because there 
are some pending bugs about fft(), independently from named arguments. 
IMHO, it would be safer to do tests about named arguments with another 
builtin but healthy function.

Yes, for macros things are "simpler". There is just that isdef() (or 
exists()) applied to a skipped input parameter (like in myfunc(a, ,c)) 
returns %T (or 1) although the parameter is not defined.

Samuel

Le 27/02/2017 à 22:57, Adelson Oliveira a écrit :
> Well, now scilab 6.0 ignores named parameters at fft calls. One can 
> check it with
>
> fft(eye(4,4),-1,dims=4,incr=1)-fft(eye(4,4),-1)
>
> the result is 4X4 matrix with zeros. This is different from (without 
> names):
>
> fft(eye(4,4),-1,4,1)-fft(eye(4,4),-1).
>
> Then, I guess it is to say optional parameters are no longer "fully" 
> optional, they must be provided in their order ...
>
> But anyway, it seems that my personal "macros" or functions still work 
> with named optional parameters (opt1, opt2, ....) treated as,
>
>    if exists('opt1','local') == 0 then
>       opt1 = default_opt1.;
>    end




More information about the users mailing list