Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #35572

Re: Operators

From Martin Gregorie <martin@address-in-sig.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: Operators
Date 2016-09-08 15:04 +0000
Organization A noiseless patient Spider
Message-ID <nqrumq$qt3$1@dont-email.me> (permalink)
References <operators-20160908014132@ram.dialup.fu-berlin.de> <3as2tbd4l409tvfjl9pltu8u4qvtgqg7vu@4ax.com>

Show all headers | View raw


On Thu, 08 Sep 2016 07:13:27 -0700, Roedy Green wrote:

> On 8 Sep 2016 00:45:16 GMT, ram@zedat.fu-berlin.de (Stefan Ram) wrote:
> 
>>  Does this mean that »a?b:c« contains /two/ operators, but »(int)3.2«,
>>  »(3)« and »f(x)«
>>  do not contain an operator?
> I am not a language lawyer.
> 
> I would say ( is not an operator because it does not order any
> particular computation.
> 
> From a parsing point of view ? and : are separate operators.  From a
> syntactic point of view there is a single operator with 3 operands.
> 
> Precise vocabulary is not one of Java's strong points.

Agreed: I've often seen '?' referred to as a 'ternary operator', i.e. its 
a single operator which takes three operands, just as '++' is a unary 
operator which takes a single operand and '+' is a binary operator which 
takes two operands. 


-- 
martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Re: Operators Roedy Green <inquiry@mindprod.com> - 2016-09-08 07:13 -0700
  Re: Operators Martin Gregorie <martin@address-in-sig.invalid> - 2016-09-08 15:04 +0000

csiph-web