JEP325: Switch expressions spec
Guy Steele
guy.steele at oracle.com
Thu May 10 14:34:35 UTC 2018
> On May 10, 2018, at 8:28 AM, Gavin Bierman <gavin.bierman at oracle.com> wrote:
>
>
>> On 9 May 2018, at 00:08, Dan Smith <daniel.smith at oracle.com> wrote:
>> . . .
>> 14.11: somewhat arbitrarily, '->' is considered an "operator" while ':' is considered a "separator". Should match that terminology.
>
> Where is ‘:’ called a separator? I used the word ‘operator’ which is the terminology from JLS§3.12. I’d be happy to use other terminology (I wanted to avoid saying token.)
Section 3.11 lists the separators, which include ; and :: but NOT :. As Gavin points out, plain : is listed as an operator in Section 3.12.
(It must be admitted that this distinction was originally somewhat arbitrary. Back in 1995, we listed plain : as an operator because it is part of the ternary operator ? :, even though it also functions more as a separator in constructions such as statement labels and case labels.)
—Guy
More information about the amber-spec-experts
mailing list