[bug #68101] Missed error with missing tilde in function output
Rik <[email protected]>
| Newsgroups | gmane.comp.gnu.octave.bugs |
|---|---|
| Message-ID | <[email protected]> |
Please use the bug tracker to post updates to a bug report. The mailing list is intended as a read-only notification stream. Info posted to this mailing list address won't appear in the tracker database where it is most useful.
Follow-up Comment #6, bug #68101 (group octave):
I'm familiar with Perl which also allows a trailing comma for the last
element. That makes sense to me. On the other hand, I don't think ignoring a
leading comma makes sense. The comma is a separator, and so there must have
been something that was supposed to be just before the separator.
It also leads to inconsistent parsing. If initial commas are not significant,
then logically it should be possible to have more than one in a row. But,
that is not what Octave's parser does.
octave:2> x = [,2,3]
x =
2 3
octave:3> y = [,,2,3]
error: syntax error
>>> y = [,,2,3]
This seems like something worth changing, even though it will introduce an
incompatibility with Matlab. I don't know how much Matlab code actually
relies on this parsing "feature", but we could make it a configurable option
and if *octave* is invoked with the *--traditional* argument then the parser
could behave in a Matlab-compatible way.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?68101>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc
(application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQQk97aszIMMAvLLwm6qLAuaBUf3TgUCaaRc5QAKCRCqLAuaBUf3 Tl3QAP97d45lsXaq5dMlQGIaUDUKPI2XbnFAV+ea6PSYrnIaowD+JvGCAU9zAHAB WAo77neFD4DLFgdBq4wHgghyCBX+Ewo= =SvCn -----END PGP SIGNATURE-----