tests/hard_coded/*.m:
Rename modules as mentioned above.
In a few cases, where the main module's name itself had a suffix,
such as "_mod_a" or "_main", remove that suffix. This entails
renaming the .exp file as well. (In some cases, this meant that
the name of a helper module was "taken over" by the main module
of the test case.)
Update all references to the moved modules.
General updates to programming style, such as
- replacing DCG notation with state var notation
- replacing (C->T;E) with (if C then T else E)
- moving pred/func declarations to just before their code
- replacing io.write/io.nl sequences with io.write_line
- replacing io.print/io.nl sequences with io.print_line
- fixing too-long lines
- fixing grammar errors in comments
tests/hard_coded/Mmakefile:
tests/hard_coded/Mercury.options:
Update all references to the moved modules.
Enable the constant_prop_int test case. The fact that it wasn't enabled
before is probably an accident. (When constant_prop_int.m was created,
the test case was added to a list in the Mmakefile, but that list
was later removed due to never being referenced.)
tests/hard_coded/constant_prop_int.{m,exp}:
Delete the calls to shift operations with negative shift amounts,
since we have added a compile-time error for these since the test
was originally created.
library/array2d.m:
Add lookup and unsafe_lookup, in both function and predicate forms,
as alternatives to rafe's ^elem notation.
Use meaningful variable names in both code and documentation.
For example, use NumRows and NumColumns instead of M and N.
Replace the implementation of the function that converts a 2d array
back to lists. The new implementation has one loop over rows and one
loop over columns, while the old one had a single loop that did
both jobs. The new one returns [] (meaning no rows) for a 0x0 array,
while the old returned [[]] (meaning one row with no columns).
NEWS:
Announce the changes.
tests/hard_coded/test_array2d.m:
Use a lookup instead of ^elem.
tests/hard_coded/test_array2d.exp:
Expect the updated output from lists. Expect any exceptions to come
from lookup functions, not ^elem functions (since the latter now
just call the former).
library/io.m:
Add predicates io.write_array/[56] which are are similar to
io.write_list but work on arrays and do _not_ require converting
the array into a list first.
library/array2d.m:
Add array2d.is_empty/1.
NEWS:
Announce the above additions.
tests/hard_coded/Mmakefile:
tests/hard_coded/write_array.{m,exp}:
Add a test for write_array.
tests/hard_coded/test_array2d.{m,exp}:
Extend this test to cover is_empty/1.
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.
library/array.m:
library/array2d.m:
library/bitmap.m:
library/store.m:
library/thread.semaphore.m:
library/version_array2d.m:
library/version_bitmap.m:
library/version_hash_table.m:
library/version_store.m:
Delete predicates that were deprecated in Mercury 13.05 and before.
library/version_array.m
Delete the deprecated function new/2.
Deprecate unsafe_new/2 and unsafe_init/2 to replace it.
(We had overlooked this previously.)
library/string.m:
Delete the deprecated function set_char_char/3.
(We will leave the other deprecated procedures in this module
for at least another release.)
library/svlist.m:
library/svpqueue.m:
library/svstack.m:
Delete these modules: they were only ever needed as a transitional
mechanism.
library/library.m:
Conform to the above changes.
doc/Mmakefile:
Unrelated change: delete references to files that have been
deleted since we moved to git.
tests/hard_coded/*/*.m
tests/tabling/*.m:
Update test cases where they made use of predicates that have
now been deleted from the standard library.
Estimated hours taken: 0.5
Branches: main
tests/hard_coded/test_array2d.m:
Fix a test case that was failing due to a type
ambiguity caused by the addition of string.string/1
to the library.
Estimated hours taken: 4
Branches: main
Added a new library module, array2d.m, implementing 2d rectangular arrays.
NEWS:
Report the new addition.
library/array2d.m:
Added.
library/library.m:
Added import for array2d.
compiler/modules.m:
Added clause for array2d to mercury_std_library_module/1.
tests/hard_coded/test_array2d.m:
tests/hard_coded/test_array2d.exp:
tests/hard_coded/Mmakefile:
Test case added.