Can't use function with same name as module?

Shriramana Sharma not.sure.why.a.mail.id.is.needed.even.if.invalid at gmail.com
Tue Oct 17 08:08:19 UTC 2017


On Tuesday, 17 October 2017 at 07:33:15 UTC, evilrat wrote:
> Compiler made that way so it doesn't guess or assume too much, 
> because later on it will bite you when you don't even expect 
> that, and in some unpredictable place too.

Can you give an example for when it will bite me? It seems very 
natural to name a module with the name of the main class or 
function implemented in that module. Python modules like datetime 
follow this. What is the problem?

Especially in D the compiler is all-powerful and knows when to 
resolve to which symbol. If D compiler can resolve between 
multiple overloads in other cases, why not resolve here?


More information about the Digitalmars-d-learn mailing list