help-octave
[Top][All Lists]
Advanced

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

function space


From: Vic Norton
Subject: function space
Date: Tue, 21 Feb 2012 14:24:02 -0500

In the manual or help there seems to be a preference to write
   'sin (X)' rather than 'sin(X)'
or
   'sprintf ("%d", i)' rather than 'sprintf("%d", i)'.
However, in at least one case, the space between the function name and its 
argument list results in a "parse error".

For example
   i = 5;
   x = [ "min", sprintf("%d", i) ];
results in
   x = "min5".
However
   i = 5;
   x = [ "min", sprintf ("%d", i) ];
results in
   parse error:
   
     syntax error

   >>> x = [ "min", sprintf ("%d", i) ];


Is this a bug? Or should one just avoid putting a space after a function name?

In what other situations does a space after a function name result in a syntax 
error?

Regards,

Vic

reply via email to

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