[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.
Regards
Pascal
--
View this message in context:
http://octave.1599824.n4.nabble.com/function-space-tp4408021p4408264.html
Sent from the Octave - General mailing list archive at Nabble.com.