deprecate deprecated?

Nathan M. Swan nathanmswan at gmail.com
Wed Nov 7 00:19:43 PST 2012


On 11/06/2012 10:03 PM, monarch_dodra wrote:
> On Tuesday, 6 November 2012 at 23:56:13 UTC, Walter Bright wrote:
>> I know there's been some long term unhappiness about the deprecated
>> attribute - it's all-or-nothing approach, poor messages, etc. Each
>> change in it changes the language and the compiler.
>
> I *just* had a conversation about this, but there *needs* to be a way to
> to tell the compiler: "don't use deprecated stuff": If it merely issues
> a warning, then you'll end up calling deprecated code, because traits
> will answer positively to something that is actually deprecated:
>
> For example if a range has "deprecated opIndex", and you try a search on
> that range, the implementation will take the RA road...
>
> I had proposed a "three state -d":
> -- : Deprecated stuff just can't be used
> -d : You can use deprecated stuff, but you get no warning
> -dw : You can use deprecated stuff, and are served with a warning
>
>

I'm in favor of this; we can stop filling Phobos with "scheduled for 
deprecation," and just deprecate things. People using e.g. std.xml would 
get warnings but not have to refactor all their code at once.

NMS


More information about the Digitalmars-d mailing list