Proposal on improvement to deprecated

Jacob Carlborg doob at me.com
Mon Oct 3 00:21:12 PDT 2011


On 2011-10-03 07:59, Walter Bright wrote:
> On 10/2/2011 10:13 PM, Jonathan M Davis wrote:
>> I really think that making it so that deprecated doesn't actually stop
>> compilation (but rather just prints the message) would improve things
>
> The user has two choices:
>
> 1. get deprecation messages and fix the code
> 2. add -d and ignore it
>
> I don't see any point in printing messages and ignoring them. I don't
> believe it improves the user experience.
>
> The user is going to have to eventually fix the code, and that WILL BE
> ANNOYING to him. Guaranteed. There's no way to deprecate things and not
> annoy people.

Since we already are using pragma(msg, "scheduled for deprecation") 
where possible, i.e. in templates, why can't we have a proper language 
construct for doing it?

deprecated("message") {}
deprecated {}

Behave as it currently does, except that the first form will print a 
message as well.

deprecated("message", scheduled) {}

Will behave just as pragma(msg, "") does when a symbol is used that is 
wrapped in the "deprecated" block.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list