[phobos] Deprecation of std.date

Jonathan M Davis jmdavisProg at gmx.com
Sat Jan 15 20:49:15 PST 2011


On Saturday 15 January 2011 20:28:33 Jonathan M Davis wrote:
> I've been going through the process of making Phobos use std.datetime
> instead of std.date. It isn't all that many changes, but it does mean that
> we're going to need to deprececate several functions outside of std.date
> and std.dateparse (all in std.file IIRC) and of course the modules
> std.gregorian, std.date, and std.dateparse. That's fine. The problem,
> however, is marking them as "scheduled for deprecation" with a pragma
> rather than just marking them as deprecated. It works just fine to mark
> them as scheduled for deprecation with a pragma, but it means that the
> output for the unittest build of Phobos spits out
> 
> std.date has been scheduled for deprecation. Please use std.datetime
> instead. std.dateparse has been scheduled for deprecation. Please use
> std.datetime instead.
> 
> almost every other line (as opposed to std.gregorian, which prints out its
> message once or twice). It's definitely annoying, albeit temporary.
> 
> Is it acceptable to pollute the output for the build that thoroughly, or
> should I should I just mark the std.date-related stuff as deprecated
> instead of scheduled to be deprecated, or are we willing to have the build
> output flooded with "scheduled for deprecation" messages for a release or
> two?

And from the looks of it, _anyone_ using std.file will end up getting those 
pragma messages, even if they _don't_ use std.date or std.dateparse at all, 
simply because std.file uses them for functions which are going to be deprecated. 
So, it seems to me that it's going to be highly annoying all around to use the 
pragmas instead of just deprecating them. I expect that if the pragmas weren't 
as heavy-handed, it wouldn't be as big an issue, but they seem to print just 
because you used a module that used a module that has such a pragma in it - even 
if you didn't directly or indirectly use any of the functionality which was 
scheduled for deprecation.

- Jonathan M Davis


More information about the phobos mailing list