[Issue 5481] Support deprecated("message")

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jan 24 08:11:38 PST 2011


http://d.puremagic.com/issues/show_bug.cgi?id=5481


Jonathan M Davis <jmdavisProg at gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jmdavisProg at gmx.com


--- Comment #1 from Jonathan M Davis <jmdavisProg at gmx.com> 2011-01-24 08:09:34 PST ---
A related feature would be to be able to have "soft" vs "hard" deprecation, so
that you can mark a symbol as scheduled for deprecation (so, the programmer is
notified like you get with the pragma messages now - though preferably with
something more like what's being suggested here with deprecated) without fully
deprecating it yet. Then you make it full deprecated and -d becomes required
for compilation to succeed (in addition to giving the programmer the message
about what they should be using instead).

Right now, the best we have is the ill-suited pragma messages for indicating
"scheduled for deprecation." And then we're stuck changing them (to indicate
deprecated rather than scheduled for deprecation) and keeping them around on
top of marking something as deprecated so that they'll tell the programmer what
to use now that the symbol in question has been deprecated.

So, I'm not sure what the best syntax is, but doing something like adding an
enum indicating Soft or Hard deprecation which could be fed to deprecated along
with the message would be ideal. e.g.

deprecated("Use newStuff instead.", Soft);
deprecated("Use newStuff instead.", Hard);

Presumably, Hard would be the default, as that how deprecated currently works.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list