octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #51045] ?: ternary operator


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #51045] ?: ternary operator
Date: Wed, 17 May 2017 16:10:58 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0

Update of bug #51045 (project octave):

                  Status:            Works For Me => Wont Fix               
             Open/Closed:                    Open => Closed                 

    _______________________________________________________

Follow-up Comment #3:

This has come up before and we've always decided against it.

For example, here is the discussion that resulted in the merge function:

http://octave.1599824.n4.nabble.com/conditional-expr-operator-in-Octave-td1636741.html

and here's an example of someone who actually added the ?: operator:

http://gnu-octave.blogspot.com/2007/11/octave-ternary-operator.html

However, even if it were a good idea to add this new syntax, I don't think we
would want to use ?: syntax because the way that ':' is already used would
either lead to trouble for the grammar, or at least a lot of confusion about
intent, even if you worked out some precedence rules that would allow it.

But the bigger problem is that adding new syntax to Octave is not desirable
because it introduces the possibility of conflicts with Matlab in the future,
and those are always a lot of trouble to fix.  For example, see the recent
introduction of double-quoted strings in Matlab.  That one will be enough fun.
 We don't need to add more potential future conflicts if we can avoid them.


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?51045>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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