[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: function space

From: CdeMills
Subject: Re: function space
Date: Tue, 21 Feb 2012 12:49:55 -0800 (PST)

The choice was made, in the design of scripts, to have
a (x)

mean both 'call the function "a" with argument "x"' and 'take the component
at index "x" of vector "a".
The choice is made depending on the existing of a function called "a" or a
variable called "a". This is the opposite of the C language, where the array
access operator, "[", is different from function call "(".

So the additionnal space in the docs is there to emphasise the fact that
parens are used in the context of function call. Now the "[" make the
interpreter enter a specific mode, where space counts. So
a =[ sin (x) ]  

becomes incorrect, as the interpreter tries to call sin without arguments.



View this message in context:
Sent from the Octave - General mailing list archive at

reply via email to

[Prev in Thread] Current Thread [Next in Thread]