[D-runtime] druntime commit, revision 410

Jonathan M Davis jmdavisProg at gmx.com
Thu Nov 4 15:15:55 PDT 2010


On Thursday, November 04, 2010 12:51:36 Steve Schveighoffer wrote:
> Without looking at it at all, my firm belief is that std.datetime should
> use core.time.Duration as its duration type.  One of the big issues I had
> with Tango before implementing the time types was that you had 3 or 4
> different ways to specify time.
> 
> In all likelyhood you are going to be using std.datetime to do most of your
> code since it provides mechanisms that work with the local clock.  If you
> then have to convert your std.datetime structs to core.time structs in
> order to call core functions, that's going to be a huge turnoff.
> 
> In addition, std.datetime should publicly import core.time so it's seamless
> to the person who wants to work with time structures.
> 
> I know the datetime stuff is not final yet, but Jonathan, can we look at
> what duration type should be moved to core.time?

I'll take a look at it, but I do know that it won't be possible to directly move 
std.datetime's Duration over to core.time, because it does have some code which 
interacts with other stuff in std.datetime like TickDuration and FracSec, as well 
as using some helper functions which are in std.datetime (as well as my 
unittesting functions of course). However, some or all of that could be moved to 
core.time or duplicated there. I'll have to see what core.time looks like 
though. I definitely didn't just port over Boost's duration API, though IIRC it's 
certainly similar.

- Jonathan M Davis


More information about the D-runtime mailing list