www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Suggest aesthetic way to Naming a module or a package with illegal

reply BoQsc <vaidas.boqsc gmail.com> writes:
Do not ask why I want to do that, you can however suggest 
alternative variations.

As you all might know,

 2. The Identifiers preceding the rightmost are the Packages 
 that the module is in. The packages correspond to directory 
 names in the source file path. Package and module names cannot 
 be Keywords.
https://dlang.org/spec/module.html#module_declaration The D Spec literally says that we cannot use these words in the Module Names: https://dlang.org/spec/lex.html#Keyword Example, we can't Name Modules or Packages like that:
 module auto.alias.abstract;
 void main(){


}
I would like to know if there is any way to make it possible to name Modules/Packages via preoccupied lexical words, or at least receive some suggestions on some aesthetic naming for a module/package that includes these lexical d words. Examples:
 module dauto.dalias.dabstract;
 void main(){


}
 module CustomAuto.CustomAlias.CustomAbstract;
 void main(){


}
Jun 16 2019
parent reply rikki cattermole <rikki cattermole.co.nz> writes:
The style guide has an opinion about this (you don't have to follow it).

https://dlang.org/dstyle.html#naming_keywords
Jun 16 2019
parent reply BoQsc <vaidas.boqsc gmail.com> writes:
On Sunday, 16 June 2019 at 11:38:27 UTC, rikki cattermole wrote:
 The style guide has an opinion about this (you don't have to 
 follow it).

 https://dlang.org/dstyle.html#naming_keywords
So if I follow dstyle guidelines on keywords, this would be a correct non-conflicting result:
module _auto._alias._abstract;
 void main(){


}
The underscore way, I kind of liking it, thanks for sourcing the idea.
Jun 16 2019
parent Jonathan M Davis <newsgroup.d jmdavisprog.com> writes:
On Sunday, June 16, 2019 5:53:30 AM MDT BoQsc via Digitalmars-d-learn wrote:
 On Sunday, 16 June 2019 at 11:38:27 UTC, rikki cattermole wrote:
 The style guide has an opinion about this (you don't have to
 follow it).

 https://dlang.org/dstyle.html#naming_keywords
So if I follow dstyle guidelines on keywords, this would be a correct non-conflicting result:
module _auto._alias._abstract;

 void main(){

}
The underscore way, I kind of liking it, thanks for sourcing the idea.
Well, technically, per the style guide, the underscores would go at the end of the names, not the front, but that's only if you're trying to follow the style guide rather than be inspired by it. - Jonathan M Davis
Jun 16 2019