[scilab-Users] Strange behavior

Maki 1sy8 debian1sy8 at gmail.com
Tue Nov 4 11:21:55 CET 2008


On Tue, Nov 4, 2008 at 9:58 AM, Jacco Kramer <jacco.kramer at teb.nl> wrote:
> You defined your function to use the variables a and b. If you don't
> pass these to the function, it will use the environment a and b. Since
> you filled them with 7 and -1 the step before it, it uses them as input.
>
>
> Now, when you call it without arguments, and without defining multiple
> outputs it just does the first output (x=a+b), which is 7+-1 = 6.
>
> I'm not sure I explained correctly and clearly, but it's something along
> these lines.
>

It's completely clear, thank you!! I forgot about the default behavior
of function calls without arguments I read about somewhere in the
help: they use whatever existing variables happen to correspond to
their arguments!

In fact, it happened to me as I was playing around with the
autocompletion feature both at the prompt and in scipad.
Thanks!



More information about the users mailing list