[jsr294-modularity-eg] 294 EG conf call, 2009-04-15

Bryan Atsatt bryan.atsatt at oracle.com
Thu Apr 23 13:09:05 EDT 2009


I'm having difficulty with "optional requires" :^). Maybe 'optional' 
should substitute for 'requires' here?

  optional module  N @ 1.0+;
  requires package P @ (1.0,2.0];

Or use 'import' and 'export' instead of requires/provides?

  optional import module  N @ 1.0+;
  import package P @ (1.0,2.0];

// Bryan

Alex Buckley wrote:
> Bryan Atsatt wrote:
>> module M @ 5.0 {
>>    requires module "N at 1.0+; optional=true";
>>    requires package "P@(1.0,2.0]";
>>    permits  module "O";  // Module O is M's friend
>>    provides module "M at 4.5+";  // M v5.0 is compatible with 4.5+
>>    provides package "m"; // Exports package 'm'
>> }
>
> 0) Can I suggest that 'requires system ...' is as good as 'system ...' ?
>
> 1) Can I suggest putting modifiers like 'optional' first:
>
>   optional requires module  N @ 1.0+;
>            requires package P @ (1.0,2.0];
>
> This mirrors class/method/field signatures and allows a simple, 
> flexible grammar for the content of a module compilation unit: (Id == 
> identifier)
>
>   Id* ('requires'|'permits'|'provides') Id Id ['@' VStart VPart*] ';'
>
> VStart:
>   digit
>   '['
>   '('
>
> VPart:
>   InputCharacter but not FF, Space, Tab, '"', '\'', '\\', ';'
>   // InputCharacter is any UnicodeInputCharacter except CR and LF
>   // Note it includes comma and dot, allowing version ranges like
>   // 1.0,2.0 at the cost of disallowing multiple operands per requires
>
> Alex
> _______________________________________________
> jsr294-modularity-eg mailing list
> jsr294-modularity-eg at cs.oswego.edu
> http://cs.oswego.edu/mailman/listinfo/jsr294-modularity-eg
>


More information about the jsr294-modularity-eg mailing list