Package name semantics

Stephan Herrmann stephan.herrmann at berlin.de
Tue May 23 20:37:20 UTC 2017


On 23.05.2017 22:12, Alex Buckley wrote:
> On 5/23/2017 1:04 PM, Stephan Herrmann wrote:
>> The 2017-05-18 update of JLS 6.5.3.2 introduces the concept of
>> unique visibility, but still has this unchanged sentence:
>>
>> "The package name Q.Id names a package that is the member named Id
>>    within the package named by Q."
>>
>> If "the" in "the member named Id" is to be taken literally, then
>> the specification still doesn't work, as I may elaborate if needed.
>> But I assume, dropping "the" in favor of "a" or a similar change
>> easily fixes this to reflect the intention, right?
> 
> The full text is:
> 
> -----
> If a package name is of the form Q.Id, then Q must also be a package name. The package name Q.Id names a package that is the member 
> named Id within the package named by Q.
> 
> [DELETED]If Q does not name an observable package (§7.4.3), or Id is not the simple name of an observable subpackage of that 
> package, then a compile-time error occurs.[/DELETED]
> 
> [ADDED]If Q.Id does not name a package that is uniquely visible to the current module (§7.4.3), then a compile-time error 
> occurs.[/ADDED]
> -----
> 
> The editorial style of this section has historically been rather odd, because the first paragraph makes assertions that are true 
> only if the second paragraph's compile-time error doesn't occur. I have continued with that style in JLS9: the first paragraph can 
> say "_the_ member named Id" because the second paragraph assures a unique Q.Id.
> 
> Alex
> 

To tersely illustrate my confusion: "the" _could_ imply that the existence of several
packages named Q.Id forces separate parent packages Q, so that each Q indeed contains
exactly one member named Id.

 From your mail I infer that this is not your intention.

I read you as saying: even a single package named Q can contain arbitrary many
member packages named Id, provided that (at the location of each package reference)
exactly one of those packages is visible (or a compile time error occurs), right?

Stephan


More information about the jigsaw-dev mailing list