Proposal for a standard for D library naming

Gregor Richards Richards at codu.org
Tue Sep 26 13:00:17 PDT 2006


Bruno Medeiros wrote:
> Lars Ivar Igesund wrote:
> 
>> Bruno Medeiros wrote:
>>
>>> Gregor Richards wrote:
>>>
>>>>         o The only rule is that any module must be in the most
>>>> specifically-named library corresponding to that module. That is, if 
>>>> you
>>>> have libD.a.b.so.0 and libD.a.so.0, the module a.b.c should be in
>>>> libD.a.b.so.0, not libD.a.so.0. Doing otherwise is fairly ridiculous
>>>> anyway.
>>>>
>>>>
>>>>
>>> Why so? Why should a given library be splited across multiple so/dll
>>> files according to package, instead of being compiled in just one file?
>>>
>>>
>>
>> You totally missed the point, if the library _is_ split, then there 
>> should
>> be a standardized way to decide which part a module is in.
>>
> 
> I see.
> 
> Well, But then I think it is a bad code "convention" to have 
> subdivisions (packages) are not at the same level. That means that one 
> should either have:
>   a.*   // a lib with 'a' and all subpackages and modules
> or have:
>   // three related libs, each with it's subpackages and modules.
>   a.b.*
>   a.c.*
>   a.d.*
> This means that in the second option, package 'a' cannot have 
> sub-modules, only sub-packages.
> 

No it doesn't - the rule is that a module is in the /most specific/ 
library.  So, if you wanted to split out a.b, a.c and a.d, but had a 
module a.mod, there would be a library libD.a.{so,a,lib,whatever}, but 
it would only contain the module a.mod, no subpackages.  A library is 
not assumed to be fully inclusive - it is assumed to be inclusive of 
everything that isn't in a more specifically-named library.

  - Gregor Richards

PS: Yes, I thought this all through :)



More information about the Digitalmars-d mailing list