Phobos - breaking existing code

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Sun Nov 30 18:44:21 PST 2014


On 11/30/2014 6:01 PM, H. S. Teoh via Digitalmars-d wrote:
> On Sun, Nov 30, 2014 at 03:03:37PM -0800, Walter Bright via Digitalmars-d wrote:
> [...]
>> Keeping around a deprecated alias translating the old symbol to the
>> new one is a good approach. For a more detailed message, instead of
>> the @disabled enhancement, a simpler way is:
>>
>>    void fnmatch()(...) {
>>      static assert(0, "use globMatch instead of fnmatch");
>>    }
> [...]
>
> That's a good idea.

Thanks! I like pressing existing features into use over inventing new ones :-)


> Keep in mind, though, that in this particular case, std.path was
> essentially replaced wholesale, so does that mean that every time we
> replaced a module, we have to keep the entire old set of symbols around
> basically forever?

Why not?

D's module system is very good at avoiding name collisions, and dealing with 
them when they do arise. Not only that, it's probably a good idea for new 
modules in Phobos to avoid collisions with old names, even when the old names 
are removed, so that people are not confused when they try to recompile old 
projects.



More information about the Digitalmars-d mailing list