Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #27104 > unrolled thread
| Started by | Patricia Shanahan <pats@acm.org> |
|---|---|
| First post | 2013-12-28 19:14 -0800 |
| Last post | 2014-01-07 15:04 +0000 |
| Articles | 2 — 2 participants |
Back to article view | Back to comp.lang.java.programmer
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: literals and keywords Patricia Shanahan <pats@acm.org> - 2013-12-28 19:14 -0800
Re: literals and keywords Sigebriht <sigebriht@yahoo.com> - 2014-01-07 15:04 +0000
| From | Patricia Shanahan <pats@acm.org> |
|---|---|
| Date | 2013-12-28 19:14 -0800 |
| Subject | Re: literals and keywords |
| Message-ID | <q5ydnS2dYpQaDiLPnZ2dnUVZ_rGdnZ2d@earthlink.com> |
On 12/28/2013 8:15 AM, Stefan Ram wrote: > The JLS contains this wording: > > »While true and false might appear to be keywords, they > are technically Boolean literals (§3.10.3). Similarly, > while null might appear to be a keyword, it is > technically the null literal (§3.10.7).« > > Does it matter? > > Can you find any program, where one can observe the difference? > E.g., some program that does compile because they are not keywords, > but would not compile when they were keywords, or vice versa? > Or are there any other observable consequences of this difference? > "true" and "false" do need to be literals. That is used, for example, in the definition of constant expressions, http://docs.oracle.com/javase/specs/jls/se7/html/jls-15.html#jls-15.28 I suspect that not also classing them as keywords might be intended to keep classes of tokens disjoint. Each token is either a keyword, or a literal, or white space, etc. but cannot be more than one of those things. Patricia
[toc] | [next] | [standalone]
| From | Sigebriht <sigebriht@yahoo.com> |
|---|---|
| Date | 2014-01-07 15:04 +0000 |
| Message-ID | <lah526$b51$1@dont-email.me> |
| In reply to | #27104 |
On 29/12/2013 03:14, Patricia Shanahan wrote: > I suspect that not also classing them as keywords might be intended to > keep classes of tokens disjoint. Each token is either a keyword, or a > literal, or white space, etc. but cannot be more than one of those things. That certainly makes sense.
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.java.programmer
csiph-web