Resolution of core.time.Duration...

Jonathan M Davis jmdavisProg at gmx.com
Tue May 17 13:03:53 PDT 2011


On 2011-05-17 12:34, Sean Kelly wrote:
> On May 17, 2011, at 11:06 AM, Jonathan M Davis wrote:
> > I very much support the idea of deprecating all of the functions in
> > druntime and phobos which take naked time values. And then if a function
> > that sleeps at nanosecond resolution is considered to be of real value
> > (which I question), then we can add that as something like nanoSleep.
> 
> That was the plan.  I just wanted a few releases with the new Duration
> routines before deprecating the old ones.  Now sounds like a good time.

As I understand it, deprecation is supposed to be a 3 stage process.

1. Mark the item to be deprecated as scheduled to be deprecated in the 
documentation, and if possible, give it a pragma which says it as well (though 
that generally involves turning the function in question into a template 
function if it isn't already so that the pragma will only kick in if the 
function is actually used).

2. Mark it with @deprecated so that -d is required to use it.

3. Fully remove it from the code.

None of those functions have actually had #1 happen to them yet, so for the 
most part, people have likely kept on using them as they have been. So, they 
should probably be marked as scheduled for deprecation for at least a release 
before they're actually deprecated.

Unfortunately, we haven't actually decided on how long each phase of 
deprecation is supposed to be. It's been brought up a time or two, but no 
decision has ever been made. I keep intending to bring it up again, since the 
last couple of releases have seen several items enter phase 1, but I keep 
forgetting.

- Jonathan M Davis


More information about the Digitalmars-d mailing list