[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**: |
Nicholas Jankowski |

**Subject**: |
[Octave-bug-tracker] [bug #62552] In-place operator spacing works for 'i' and 'j', but not other variable names |

**Date**: |
Wed, 1 Jun 2022 13:41:25 -0400 (EDT) |

Follow-up Comment #6, bug #62552 (project octave):
matlab 2022a doesn't recognze ++ and += (the error correction actually
suggests b++ --> b = b+1 and b+=c --> b = b + c), looking at the behavior with
other operators:
>*> b = 1*
b =
1
>*> b + 1*
ans =
2
>*> b+ 1*
ans =
2
>*> b +1*
Unrecognized function or variable 'b'.
>*> i + 1*
ans =
1.0000 + 1.0000i
>*> i+ 1*
ans =
1.0000 + 1.0000i
>*> i +1*
ans =
1.0000 + 1.0000i
>*> i = 1*
i =
1
>*> i + 1*
ans =
2
>*> i+ 1*
ans =
2
>*> i +1*
ans =
2
So, Octave's behavior does seem to be matlab compatible. I personally think
both error messages are lacking. Matlab's is worse than Octave's, as I've just
defined a variable and it's telling me "Unrecognized function or variable",
when the reality is it's looking for a function and not finding one.
Octave's message "k used as variable and later as function" is also confusing,
as it's likely not clear to anyone not familiar with the command vs function
syntax why the missing space matters when operator whitespace doesn't matter
in so many other contexts, and when it's a new set of error occurrences in
Octave 7 (I get no errors on any of these statements in v6.4.0).
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?62552>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/

**[Octave-bug-tracker] [bug #62552] In-place operator spacing works for 'i' and 'j', but not other variable names**, *Arun Giridhar*, `2022/06/01`
**[Octave-bug-tracker] [bug #62552] In-place operator spacing works for 'i' and 'j', but not other variable names**,
*Nicholas Jankowski* **<=**
**[Octave-bug-tracker] [bug #62552] In-place operator spacing works for 'i' and 'j', but not other variable names**, *Arun Giridhar*, `2022/06/01`
**[Octave-bug-tracker] [bug #62552] In-place operator spacing works for 'i' and 'j', but not other variable names**, *John W. Eaton*, `2022/06/01`
**[Octave-bug-tracker] [bug #62552] In-place operator spacing works for 'i' and 'j', but not other variable names**, *Arun Giridhar*, `2022/06/01`
**[Octave-bug-tracker] [bug #62552] In-place operator spacing works for 'i' and 'j', but not other variable names**, *Markus Mützel*, `2022/06/02`
**[Octave-bug-tracker] [bug #62552] In-place operator spacing works for 'i' and 'j', but not other variable names**, *Arun Giridhar*, `2022/06/02`
**[Octave-bug-tracker] [bug #62552] In-place operator spacing works for 'i' and 'j', but not other variable names**, *Markus Mützel*, `2022/06/02`
**[Octave-bug-tracker] [bug #62552] In-place operator spacing works for 'i' and 'j', but not other variable names**, *Markus Mützel*, `2022/06/02`
**[Octave-bug-tracker] [bug #62552] In-place operator spacing works for 'i' and 'j', but not other variable names**, *Arun Giridhar*, `2022/06/02`
**[Octave-bug-tracker] [bug #62552] In-place operator spacing works for 'i' and 'j', but not other variable names**, *Markus Mützel*, `2022/06/02`
**[Octave-bug-tracker] [bug #62552] In-place operator spacing works for 'i' and 'j', but not other variable names**, *Arun Giridhar*, `2022/06/02`