[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #60882] error parsing command syntax
From: |
Markus Mützel |
Subject: |
[Octave-bug-tracker] [bug #60882] error parsing command syntax |
Date: |
Fri, 6 Aug 2021 03:39:10 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36 Edg/92.0.902.62 |
Follow-up Comment #36, bug #60882 (project octave):
Matlab and Octave differentiate between command syntax and function syntax
(see section 11.13 of the current manual).
`x ++` is interpreted as command syntax. Thus, it requires that `x` is valid
function identifier. If it is not, an error is emitted.
`y = x ++` cannot be interpreted in command syntax (because of the assignment
which is impossible in command syntax). Thus, it is treated as function
syntax. That means `++` cannot be a function argument (or the user would need
to write `y = x('++')`). Thus, it is treated as an operator.
`x ++ + 3` evaluating to 3 might be a bug. IIUC, it should be evaluated the
same as `x('++', '+', '3')` which should result in an error if `x` is not a
valid function identifier.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?60882>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/