Name lookups in D

kdevel kdevel at vogtner.de
Mon Dec 14 19:50:11 UTC 2020


On Monday, 14 December 2020 at 18:54:58 UTC, Steven Schveighoffer 
wrote:

> But the compiler can only tell what you want from the code you 
> write, it can't look at the intentions behind it. Especially 
> when you make a mistake.

Until AI takes over this is clearly the case. I just wonder if 
selective
imports are worth the additional typing. They obviously prevent 
the
namespace pollution with greedy function templates like text.

> I've had countless times where I reach for 
> something.to!somethingelse and I forgot to import std.conv, but 
> I've happened to import std.datetime (which has a similar ufcs 
> `to` function).

Thanks for this warning ;-)



More information about the Digitalmars-d mailing list