[D-runtime] druntime commit, revision 410

Jonathan M Davis jmdavisProg at gmx.com
Tue Nov 9 13:06:31 PST 2010


On Friday 05 November 2010 13:11:46 Sean Kelly wrote:
> On Nov 5, 2010, at 1:04 PM, Jonathan M Davis wrote:
> > On Friday, November 05, 2010 07:06:59 Sean Kelly wrote:
> >> On Nov 4, 2010, at 6:43 PM, Jonathan M Davis wrote:
> >>> Looking at core.time, I'd really suggest just moving over
> >>> std.datetime.Duration to core.time along with TickDuration, FracSec,
> >>> and the dur!() function for creating Durations, possibly along with
> >>> some of the helper functions (which I believe are primarily restricted
> >>> to template constraints).
> >> 
> >> Are there still 4 distinct duration types?
> > 
> > No. Just two. Much as I liked the 4, and I thought that they worked quite
> > well (for the most part, you didn't have to care about the types),
> > pretty much everyone else thought that it was overly complicated. So, I
> > reduced it to two. Now it's TickDuration (which was SHOO's Ticks), which
> > is used when getting the time from the system, and Duration (which
> > essentially was HNSecDuration), which holds the number of hnsecs. It's
> > similar to what you have, but it does have functionality which yours
> > doesn't have to fit in better with std.datetime, and it makes heavier
> > use of templates than yours does. For instance, to create one, you'd use
> > calls like dur!"seconds(5) or dur!"(usecs)(502), and getter functions
> > like seconds are aliases for get - e.g. get!"seconds" - so it's far
> > better suited to generic programming.
> > 
> > I'll try and have a proposed core.time tonight or tomorrow, though it
> > should be noted that it may need further changes based on how the review
> > of the current datetime code goes, even if it seems entirely acceptable
> > on its own.
> 
> I rolled these changes into druntime now because I figure there's plenty of
> time before the next release to sort out the details, so no rush :-)

Well, it took longer than I expected (primarily due to the lack of access to 
Phobos functions in core code), but here's my updated datetime with time split 
out as a proposed core.time: http://is.gd/gSwDv

I ended up moving or copying over a bit more than I would have liked, and there 
are a few symbols which I had to tack t or T on the front of to make them not 
conflict with other stuff (even though they were private), but datetime's Duration 
does now appear to have been successfully split out. I posted the update to the 
D list as well, though that thread has been pretty quiet.

- Jonathan M Davis


More information about the D-runtime mailing list