Proposal: this.d

Kirk McDonald kirklin.mcdonald at gmail.com
Sun Sep 9 14:11:22 PDT 2007


Downs wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Kirk McDonald wrote:
> 
>>When a user says "import pkg;" (where pkg is a package), it should
>>actually import a special module called "pkg/this.d". The name "this",
>>being a keyword, cannot be used as a regular module name, and so there
>>is no chance of it interfering with existing packages. It also evokes
>>existing D syntax.
>>
> 
> 
> On the other hand, using all.d has the advantage of working better with
> existing libraries (which often use this naming), as well as being more
> obvious.
>  --downs' 2¢

Such packages would only have to add:

//this.d
module pkg;
public import pkg.all;

-- 
Kirk McDonald
http://kirkmcdonald.blogspot.com
Pyd: Connecting D and Python
http://pyd.dsource.org



More information about the Digitalmars-d mailing list