Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #27710
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Steven Simpson <ss@domain.invalid> |
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: What allows closures in the JLS? |
| Date | Mon, 10 Mar 2014 13:31:42 +0000 |
| Organization | A noiseless patient Spider |
| Lines | 42 |
| Message-ID | <uer0va-cl5.ln1@s.simpson148.btinternet.com> (permalink) |
| References | <closures-20140308015312@ram.dialup.fu-berlin.de> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=ISO-8859-1; format=flowed |
| Content-Transfer-Encoding | 8bit |
| Injection-Info | mx05.eternal-september.org; posting-host="acde58fe4ecb49b864a5b7b2a919199b"; logging-data="12457"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+LiKx75vx4MmQhk1QMrblKDvEoi9PuwaU=" |
| User-Agent | Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 |
| In-Reply-To | <closures-20140308015312@ram.dialup.fu-berlin.de> |
| Cancel-Lock | sha1:+vV8z11XApomAO0GVUNKj7Q9TX4= |
| Xref | csiph.com comp.lang.java.programmer:27710 |
Show key headers only | View raw
On 08/03/14 01:01, Stefan Ram wrote: > The JLS, in fact contains the following word sequence: > > "local variables from the surrounding method may be > referred to" > > - JLS7, 8.1.3, Example 8.1.3-2. > > and this is just what I was looking for. Why do I still post > this question here? Because this sentence "only" appears in > an example (Example 8.1.3-2). I am looking for the same > contents in a more normative part. I think these might cover it: <http://docs.oracle.com/javase/specs/jls/se7/html/jls-6.html#jls-6.3> > The /scope/ of a declaration is the region of the program within which > the entity declared by the declaration can be referred to using a > simple name, provided it is visible (§6.4.1). > The scope of a formal parameter of a method (§8.4.1) or constructor > (§8.8.1) is the entire body of the method or constructor. <http://docs.oracle.com/javase/specs/jls/se7/html/jls-6.html#jls-6.5.6.1> > If an expression name consists of a single /Identifier/, then there > must be exactly one declaration denoting either a local variable, > parameter, or field visible (§6.4.1) at the point at which the > /Identifier/ occurs. Otherwise, a compile-time error occurs. Also, this would be redundant if you couldn't reference parameters in an inner class: <http://docs.oracle.com/javase/specs/jls/se7/html/jls-8.html#jls-8.1.3> > Any local variable, formal parameter, or exception parameter used but > not declared in an inner class must be declared final. -- ss at comp dot lancs dot ac dot uk
Back to comp.lang.java.programmer | Previous | Next | Find similar | Unroll thread
Re: What allows closures in the JLS? Steven Simpson <ss@domain.invalid> - 2014-03-10 13:31 +0000
csiph-web