Is package.d a good idea?

bauss jj_1337 at live.dk
Tue Jul 3 12:51:59 UTC 2018


On Tuesday, 3 July 2018 at 12:51:18 UTC, bauss wrote:
> On Sunday, 1 July 2018 at 11:36:51 UTC, Yuxuan Shui wrote:
>> In Rust, they have something call mod.rs, which is very 
>> similar to package.d. When you use a module 'foo' in Rust, it 
>> can either be 'foo.rs' or 'foo/mod.rs'. If 'foo' has 
>> sub-modules, it has to be 'foo/mod.rs'.
>>
>> Now in the Rust 2018 edition, they are getting rid of mod.rs. 
>> So when you import 'foo', rustc will always look for 'foo.rs', 
>> and if 'foo' has submodules, it can still reside in 
>> 'foo/submodule.rs'.
>>
>> This makes me think if package.d is a good idea, and if we 
>> should try to get rid of it as well.
>
> I use package.d for more than just submodules.
>
> I use it to share modules from different packages into a single 
> package too, as well symbols and more!

I should probably have added this to my post.

A good example of it is this:
https://github.com/DiamondMVC/Diamond/blob/master/database/package.d


More information about the Digitalmars-d mailing list