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


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

Re: Operators

From Arne Vajhøj <arne@vajhoej.dk>
Newsgroups comp.lang.java.programmer
Subject Re: Operators
Date 2016-09-13 22:18 -0400
Organization Aioe.org NNTP Server
Message-ID <nrac1g$5lh$1@gioia.aioe.org> (permalink)
References <operators-20160908014132@ram.dialup.fu-berlin.de> <nqsrvj$15u5$1@gioia.aioe.org> <e57ce88e-78d3-4a8f-b278-6b95b3f20f1b@googlegroups.com>

Show all headers | View raw


On 9/13/2016 8:47 PM, Lew wrote:
> On Thursday, September 8, 2016 at 4:24:51 PM UTC-7, Arne Vajhøj wrote:
>> On 9/7/2016 8:45 PM, Stefan Ram wrote:
>>>       »3.12 Operators
>>>
>>>       38 tokens, formed from ASCII characters, are the
>>>       operators.
>>>
>>>       Operator: one of
>>>
>>>       =  >  <  !  ~  ?  :  ->
>>>
>>>       == >= <= != && || ++ --
>>>
>>>       +  -  *  /  &  |  ^  %  <<  >>  >>>
>>>
>>>       += -= *= /= &= |= ^= %= <<= >>= >>>=«
>>>
>>>     JLS8
>>>
>>>   This is the complete sections 3.12.
>>>
>>>   Does this mean that »a?b:c« contains /two/
>>>   operators, but »(int)3.2«, »(3)« and »f(x)«
>>>   do not contain an operator?
>>
>> I think that common terminology among Java developers
>> would be that:
>>
>> ?: is a single operator
>> cast is not an operator
>> parenthesis are not operators
>> method call is not an operator
>
> Whatever is common or rare among programmers is irrelevant. What is relevant is
> https://docs.oracle.com/javase/specs/jls/se8/html/jls-3.html#jls-3.12

Also note that 3.12 seems to say that "?" is one operator and ":" is one
operator, but 15.25 calls "? :" one operator.

https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.25

<quote>
15.25. Conditional Operator ? :

The conditional operator ? : ...
</quote>

I will stick the one operator claim!

Arne


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


Thread

Re: Operators Arne Vajhøj <arne@vajhoej.dk> - 2016-09-08 19:24 -0400
  Re: Operators Roedy Green <inquiry@mindprod.com> - 2016-09-12 22:13 -0700
  Re: Operators Lew <lewbloch@gmail.com> - 2016-09-13 17:47 -0700
    Re: Operators Arne Vajhøj <arne@vajhoej.dk> - 2016-09-13 22:15 -0400
    Re: Operators Arne Vajhøj <arne@vajhoej.dk> - 2016-09-13 22:18 -0400
    Re: Operators Roedy Green <inquiry@mindprod.com> - 2016-09-13 19:51 -0700
      Re: Operators Arne Vajhøj <arne@vajhoej.dk> - 2016-09-14 20:23 -0400

csiph-web