[Top][All Lists]

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

[Octave-bug-tracker] [bug #62552] In-place operator spacing works for 'i

From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #62552] In-place operator spacing works for 'i' and 'j', but not other variable names
Date: Thu, 2 Jun 2022 12:44:48 -0400 (EDT)

Follow-up Comment #22, bug #62552 (project octave):

The wording in the news file is still not quite right.  We shouldn't say
anything about assignment here because that's not the issue.  It's all about
how command-style function calls are parsed.  For example,

a + b -c

is not a problem.  This expression doesn't look like a command-style function
call because there is a space after the first operator.  It would be a
command-style function call if it were written like this:

a +b - c

I can take a shot at the news entry.  Maybe it's best to also reference the
"Command Syntax and Function Syntax" section in the manual.  That section also
needs some examples an explanation of what happens with operators, not just
word-list commands.  And the section describing binary operators should
probably also link to the command/function call syntax section.

Note that command-style function call parsing is entirely syntax based.  In
earlier versions of Octave (and I thought Matlab) the parser tried to
determine whether the first word in the statement was a variable and if it
was, didn't accept things like "a +b" as command-style function calls.  It no
longer does that.

Also, if we were completely compatible with Matlab, then even

foo += bar

would be parsed as a command-style function call because there is no "+="
operator in Matlab and this is a case of a binary operator not followed by a
space.  But if we followed that rule, then the OP= operators would be almost
completely worthless.

FWIW, I've never liked the way command-style function calls are parsed, but we
have to do it for compatibility with Matlab.


Reply to this item at:


Message sent via Savannah

reply via email to

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