Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 47 additions & 32 deletions changelog/split-std-datetime.dd
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,52 @@ std.datetime has been split into a package.
std.datetime is now a package containing the following modules:

$(UL
$(LI $(LINK2 $(PHOBOS_PATH)std_datetime_date.html, std.datetime.date))
$(LI $(LINK2 $(PHOBOS_PATH)std_datetime_interval.html, std.datetime.interval))
$(LI $(LINK2 $(PHOBOS_PATH)std_datetime_systime.html, std.datetime.systime))
$(LI $(LINK2 $(PHOBOS_PATH)std_datetime_timezone.html, std.datetime.timezone))
$(LI $(MREF std,datetime,date))
$(LI $(MREF std,datetime,interval))
$(LI $(MREF std,datetime,stopwatch))
$(LI $(MREF std,datetime,systime))
$(LI $(MREF std,datetime,timezone))
)

$(LINK2 $(PHOBOS_PATH)std_datetime.html, std.datetime.package) publicly imports
all of those modules. So, it should be the case that no existing code will
break, as everything in std.datetime will still be imported by importing
std.datetime. New code can choose to import the modules individually or to
import the entire package.

$(LINK2 $(PHOBOS_PATH)std_datetime_date.html, std.datetime.date) contains Date,
TimeOfDay, DateTime, and the related free functions. It also contains
DateTimeException.

$(LINK2 $(PHOBOS_PATH)std_datetime_interval.html, std.datetime.interval)
contains the *Interval and *IntervalRange types as well as the related free
functions.

$(LINK2 $(PHOBOS_PATH)std_datetime_systime.html, std.datetime.systime)
contains SysTime and the related free functions.

$(LINK2 $(PHOBOS_PATH)std_datetime_timezone.html, std.datetime.timezone)
contains the time zone types.

$(LINK2 $(PHOBOS_PATH)std_datetime.html, std.datetime.package) contains
StopWatch and the benchmarking functions (so, they can only be imported via
std.datetime and not via a submodule). As those functions use TickDuration,
they are slated for deprecation and will be replaced with corresponding
functions that use MonoTime and Duration. Eventually, the new functions will
end up in a submodule of std.datetime, and the old ones will have been removed,
leaving nothing in std.datetime.package except for documentation and the public
imports of the rest of std.datetime.
$(MREF std,datetime,package) publicly imports all of those modules. So, it
should be the case that no existing code will break, as everything in
std.datetime will still be imported by importing std.datetime. New code can
choose to import the modules individually or to import the entire package.

$(MREF std,datetime,date) contains Date, TimeOfDay, DateTime, and the related
free functions. It also contains DateTimeException.

$(MREF std,datetime,interval) contains the *Interval and *IntervalRange types
as well as the related free functions.

$(MREF std,datetime,systime) contains SysTime and the related free functions.

$(MREF std,datetime,timezone) contains the time zone types.

$(MREF std,datetime,package) contains StopWatch and the benchmarking functions
(so, they can only be imported via std.datetime and not via a submodule). As
those functions use $(REF TickDuration,core,time) (which is being replaced by
$(REF MonoTime,core,time), they are slated for deprecation.

$(MREF std,datetime,stopwatch) has been added. It contains versions of
StopWatch and benchmark which have almost the same API as the existing symbols,
but they use $(REF MonoTime,core,time) and $(REF Duration,core,time) instead of
$(REF TickDuration,core,time). In the next major release, the old functions in
std.datetime.package will be deprecated, so code which uses the old
benchmarking functions should be updated to use std.datetime.stopwatch.

However, note that in order to avoid irreconcilable symbol conflicts between
the new and old versions, std.datetime.stopwatch will not be publicly imported
by std.datetime.package until the old symbols have been removed. So, for the
time being, code using $(REF StopWatch,std,datetime,stopwatch) or
$(REF StopWatch,std,datetime,benchmark) will need to import
std.datetime.stopwatch directly. Code which imports both std.datetime and
std.datetime.stopwatch will need to either use selective imports or fully
qualified symbols to reconcile the symbol conflicts, but no code will be
affected by the changes until it's updated to import std.datetime.stopwatch,
and when the old symbols are finally removed, the selective imports and fully
qualified paths to the new symbols will continue to work and won't break
(though at that point, simply importing std.datetime will work, since
std.datetime.package will have been updated to publicly import
std.datetime.stopwatch). Code that simply imporst std.datetime.stopwatch without
importing std.datetime will not have to worry about symbol conflicts.
4 changes: 2 additions & 2 deletions posix.mak
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ PACKAGE_std_experimental = checkedint typecons
PACKAGE_std_algorithm = comparison iteration mutation package searching setops \
sorting
PACKAGE_std_container = array binaryheap dlist package rbtree slist util
PACKAGE_std_datetime = date interval package systime timezone
PACKAGE_std_datetime = date interval package stopwatch systime timezone
PACKAGE_std_digest = crc digest hmac md murmurhash ripemd sha
PACKAGE_std_experimental_logger = core filelogger \
nulllogger multilogger package
Expand Down Expand Up @@ -558,7 +558,7 @@ publictests: $(LIB)
has_public_example: $(LIB)
# checks whether public function have public examples (for now some modules are excluded)
rm -rf ./out
DFLAGS="$(DFLAGS) $(LIB) -defaultlib= -debuglib= $(LINKDL)" $(DUB) --compiler=$${PWD}/$(DMD) --root=../tools/styles -c has_public_example -- --inputdir . --ignore "etc,array.d,allocator,base64.d,bitmanip.d,concurrency.d,conv.d,csv.d,datetime/date.d,datetime/interval.d,datetime/package.d,datetime/systime.d,datetime/timezone.d,demangle.d,digest/hmac.d,digest/sha.d,encoding.d,exception.d,file.d,format.d,getopt.d,index.d,internal,isemail.d,json.d,logger/core.d,logger/nulllogger.d,math.d,mathspecial.d,net/curl.d,numeric.d,parallelism.d,path.d,process.d,random.d,range,regex/package.d,socket.d,stdio.d,string.d,traits.d,typecons.d,uni.d,unittest.d,uri.d,utf.d,uuid.d,xml.d,zlib.d"
DFLAGS="$(DFLAGS) $(LIB) -defaultlib= -debuglib= $(LINKDL)" $(DUB) --compiler=$${PWD}/$(DMD) --root=../tools/styles -c has_public_example -- --inputdir . --ignore "etc,array.d,allocator,base64.d,bitmanip.d,concurrency.d,conv.d,csv.d,datetime/date.d,datetime/interval.d,datetime/package.d,datetime/stopwatch.d,datetime/systime.d,datetime/timezone.d,demangle.d,digest/hmac.d,digest/sha.d,encoding.d,exception.d,file.d,format.d,getopt.d,index.d,internal,isemail.d,json.d,logger/core.d,logger/nulllogger.d,math.d,mathspecial.d,net/curl.d,numeric.d,parallelism.d,path.d,process.d,random.d,range,regex/package.d,socket.d,stdio.d,string.d,traits.d,typecons.d,uni.d,unittest.d,uri.d,utf.d,uuid.d,xml.d,zlib.d"

.PHONY : auto-tester-build
auto-tester-build: all checkwhitespace
Expand Down
24 changes: 24 additions & 0 deletions std/datetime/package.d
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,12 @@ alias AutoStart = Flag!"autoStart";


/++
$(RED This will be deprecated in 2.076. Please use
$(REF StopWatch,std,datetime,stopwatch) instead. It uses
$(REF Monotime,core,time) and $(REF Duration,core,time) rather
than $(REF TickDuration,core,time), which will also be deprecated in
2.076.)

$(D StopWatch) measures time as precisely as possible.

This class uses a high-performance counter. On Windows systems, it uses
Expand Down Expand Up @@ -416,6 +422,12 @@ private:


/++
$(RED This will be deprecated in 2.076. Please use
$(REF benchmark,std,datetime,stopwatch) instead. It uses
$(REF Monotime,core,time) and $(REF Duration,core,time) rather
than $(REF TickDuration,core,time), which will also be deprecated in
2.076.)

Benchmarks code for speed assessment and comparison.

Params:
Expand Down Expand Up @@ -526,6 +538,12 @@ private:


/++
$(RED This will be deprecated in 2.076. Please use
$(REF benchmark,std,datetime,stopwatch) instead. This function has
not been ported to $(REF Monotime,core,time) and
$(REF Duration,core,time), because it is a trivial wrapper around
benchmark.)

Benchmark with two functions comparing.

Params:
Expand Down Expand Up @@ -568,6 +586,12 @@ ComparingBenchmarkResult comparingBenchmark(alias baseFunc,


/++
$(RED This will be deprecated in 2.076. Please use
$(REF StopWatch,std,datetime,stopwatch) instead. This function has
not been ported to $(REF Monotime,core,time) and
$(REF Duration,core,time), because it is a trivial wrapper around
StopWatch.)

Function for starting to a stop watch time when the function is called
and stopping it when its return value goes out of scope and is destroyed.

Expand Down
Loading