Time to split up std.datetime into a package?

Jonathan M Davis jmdavisProg at gmx.com
Fri Jun 21 09:48:49 PDT 2013


On Friday, June 21, 2013 14:23:48 Wyatt wrote:
> On Thursday, 20 June 2013 at 18:54:20 UTC, Jonathan M Davis wrote:
> > IMHO, the obvious split (and what I've wanted to do for some
> > time) is
> > 
> > std/datetime/common.d
> > std/datetime/interval.d
> > std/datetime/timepoint.d
> > std/datetime/timezone.d
> > 
> > common would primarily have the free functions; interval would
> > have the three
> > interval types and their related range stuff; timepoint would
> > have all four of
> > the time point types (SysTime, DateTime, Date, and TimeOfDay);
> > and timezone
> > would have the time zone types.
> 
> If possible, I'd like to have a separate submodule for the
> StopWatch/Benchmarking stuff; that's probably more than 90% of
> what I use std.datetime for.

Eventually, it's supposed to go in std.benchmark. I'm not quite sure what I'm 
going to do with it right now though.

> Even if importing
> std.datetime.stopwatch ends up pulling most of the rest
> implicitly, I think the improvement to the documentation alone
> would be worthwhile.

It's doesn't use any of the rest of std.datetime. It uses core.time for 
TickDuration (though at this point, I'm inclined to think that TickDuration 
should never have existed, and we should have just used Duration), but it was 
created by SHOO, not me, before std.datetime was created, so its dependency on 
the rest of std.datetime is very low.

- Jonathan M Davis


More information about the Digitalmars-d mailing list