What is a language construct? (was Re: Comment on state of Project Jigsaw)
alex.buckley at oracle.com
Wed Dec 21 15:11:27 PST 2011
On 12/21/2011 2:39 PM, Rémi Forax wrote:
> Java is a programming languages with several sources files
> and jigsaw introduces a rule to find the module declaration
> from a source file. This rule used a convention instead of a
> declaration i.e. you don't have to edit all class files
> to declare that they are part of a module but you have to use
> a precise source layout.
> If this layout is defined in the language spec so I don't see the problem.
As Mark said, a module declaration is just another kind of declaration
within a compilation unit. The JLS has never made normative statements
about the physical form or layout of compilation units. (Nor, for that
matter, has the JVM Spec with regard to class files).
A compiler for the Java language is free to make up rules for the
placement on a file system of files that represent compilation units.
The file system placement of a compilation unit containing a module
declaration should no more be specified in the JLS than the placement of
a compilation unit containing a type declaration.
I am still curious to know how Neal would integrate statements or
declarations into the Java language that determine the visibility of
types ("observability", in JLS terms) for code within the scope of the
statements or declarations.
More information about the jigsaw-dev