importing modules with non-identifier names

Don nospam at nospam.com
Sat Oct 31 11:58:32 PDT 2009


Andrei Alexandrescu wrote:
> Has anyone been irked by this? If you have a module called 5th-element.d 
> there is no way to import that. I don't think it's a major issue, but 
> I'm also seeing it as a limitation that should have a better explanation.
> 
> One way to circumvent that may be
> 
> import fifth = "5th-element.d";
> 
> i.e., specify the file as a string and assign to it a regular D 
> identifier. Probably similar things have been discussed in the past, 
> what's the general impression?

It's just one of a great many cases which would be fixed by introducing 
__identifier("XXX"). (That's also a construct which would do wonders for 
string mixins, BTW).



More information about the Digitalmars-d mailing list