Scilab Bag Of Tricks: The Scilab-2.5.x IAQ (Infrequently Asked Questions) | ||
---|---|---|
Prev | Chapter 2. Common Pitfalls | Next |
Scilab treats the first (logical) line of a function definition, the function head, differently form any other line in a sci-file. Any non-whitespace after the closing parenthesis must be avoided. It is even illegal to add a comment at the end of the function head. On the other hand it is legal to extend the function head over more than one physical line by using ".." as long as the continuation happens before the final parenthesis.
Here are some correct function heads:
function y = foo(x)
function y .. = foo(x)
function y = foo(a, b, c, d, .. e, f, g, h)
The following examples are all illegal:
function y = foo(x) // This is foo!
function y = save_space(x); y = 1 + x
function y = bar(x) .. y = 1 + x
See also Section 5.1.