tests/hard_coded/*.m:
Update programming style, unless doing so would change
the meaning of the test, in particular:
- use '.' as a module qualifier in place of '__'
- use {write,print}_line where appropriate
- use if-then-else in place of C -> T ; E
- use state variables in place of DCGs
tests/hard_coded/dir_test.m:
Document what the expected outputs correspond to.
Use a uniform module qualifier in the output.
tests/hard_coded/dir_test.exp*:
Conform to the above change.
library/time.m:
Deprecate non-pure functions `localtime/1' and `mktime/1'.
They depend on the current time zone, which depends on the
environment that the program is running in, and may also be
changed at run time (e.g. by setting the environment variable
"TZ").
Add replacement predicates `localtime/4' and `mktime/4' that
thread the I/O state.
Deprecate the non-pure function `ctime/1'. It does not seem
necessary to add a pure replacement for it, being a minor
convenience at best.
Try to clarify some documentation.
library/calendar.m:
Conform to above changes.
tests/hard_coded/dst_test.m:
tests/hard_coded/time_test.m
Conform to above changes.
Update code style.
extras/curs/samples/nibbles.m:
extras/graphics/easyx/samples/bounce.m:
extras/graphics/easyx/samples/mclock.m:
extras/log4m/log4m.m:
Conform to above changes.
NEWS:
Announce changes.
tests/accumulator/*.m:
tests/analysis_*/*.m:
tests/benchmarks*/*.m:
tests/debugger*/*.{m,exp,inp}:
tests/declarative_debugger*/*.{m,exp,inp}:
tests/dppd*/*.m:
tests/exceptions*/*.m:
tests/general*/*.m:
tests/grade_subdirs*/*.m:
tests/hard_coded*/*.m:
Make these tests use four-space indentation, and ensure that
each module is imported on its own line. (I intend to use the latter
to figure out which subdirectories' tests can be executed in parallel.)
These changes usually move code to different lines. For the debugger tests,
specify the new line numbers in .inp files and expect them in .exp files.
Estimated hours taken: 18
Branches: main
Move the univ, maybe, pair and unit types from std_util into their own
modules. std_util still contains the general purpose higher-order programming
constructs.
library/std_util.m:
Move univ, maybe, pair and unit (plus any other related types
and procedures) into their own modules.
library/maybe.m:
New module. This contains the maybe and maybe_error types and
the associated procedures.
library/pair.m:
New module. This contains the pair type and associated procedures.
library/unit.m:
New module. This contains the types unit/0 and unit/1.
library/univ.m:
New module. This contains the univ type and associated procedures.
library/library.m:
Add the new modules.
library/private_builtin.m:
Update the declaration of the type_ctor_info struct for univ.
runtime/mercury.h:
Update the declaration for the type_ctor_info struct for univ.
runtime/mercury_mcpp.h:
runtime/mercury_hlc_types.h:
Update the definition of MR_Univ.
runtime/mercury_init.h:
Fix a comment: ML_type_name is now exported from type_desc.m.
compiler/mlds_to_il.m:
Update the the name of the module that defines univs (which are
handled specially by the il code generator.)
library/*.m:
compiler/*.m:
browser/*.m:
mdbcomp/*.m:
profiler/*.m:
deep_profiler/*.m:
Conform to the above changes. Import the new modules where they
are needed; don't import std_util where it isn't needed.
Fix formatting in lots of modules. Delete duplicate module
imports.
tests/*:
Update the test suite to confrom to the above changes.
Estimated hours taken: 3
Branches: main
Revised the test cases for the time library.
tests/time_test.m:
mktime(localtime(Time)) is now considered to be close enough to the
original Time if it is less than 1 second earlier.
tests/dst_test.m:
Tests daylight savings time is implemented correctly.
Also tests localtime vs gmtime on the changeover dates.
tests/dst_test.exp:
corresponding expected output.
tests/Mmakefile:
Added dst_test to the list.
Added rule for dst_test, which sets the TZ environmental variable
to 'Australia/Melbourne' before running the test.