[Issue 11488] Disallow chaining of - operator

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun Feb 1 06:25:42 PST 2015


https://issues.dlang.org/show_bug.cgi?id=11488

Stewart Gordon <smjg at iname.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|FORTRAN "FORI=" Error       |Disallow chaining of -
                   |                            |operator

--- Comment #3 from Stewart Gordon <smjg at iname.com> ---
(In reply to Manfred Nowak from comment #2)
> If chaining of "-", "--". "+" and "++" is used heavily, then disallowing to
> shoot oneself is okay. Hint: "- -- -- -- - --- -- - -- ---- - -- - --x" is
> currently a legal expression and I doubt that one can _see_ in general the
> positions at which a significant space is wrongly placed or deleted.

But how would such an expression find its way into real-world code in the first
place?

> If chaining of those operators will never be used heavily, then there is no
> ratio for allowing the chaining.

In my mind, this is all the more reason that it isn't worth disallowing it and
thereby (a) adding extra complexity to the parser (b) precluding legitimate,
non-error-prone use cases.

Also, what does `FORTRAN "FORI=" Error` mean?  I used Fortran for a few years,
and never came across the term.  Probably a lot of people here have never used
Fortran, and have even less idea what it means.  As such, I'm changing the
summary line to make sense to D programmers.

--


More information about the Digitalmars-d-bugs mailing list