4 Commits

Author SHA1 Message Date
Zoltan Somogyi
3459266a7a Carve stdlib module ra_list.m out of bt_array.m.
library/ra_list.m:
    As above.

    Rename ra_list_lookup to ra_list_search, since it fails if the item
    to be accessed does not exist. Add a version, ra_list_lookup, which
    aborts in that case.

    Add predicates to append two ra_lists, and to convert ra_lists
    to just plain lists.

    Change the argument order of some predicates to be more
    state variable friendly.

    Add some documentation.

library/bt_array.m:
    Delete the moved code, and update the references to the changed predicates.

library/Mercury.options:
    Now that the ra_list predicates have been moved to their own module,
    stop giving bt_array.m a free pass on inconsistent predicate order.

library/MODULES_DOC:
library/library.m:
    Add ra_list.m as a documented module of the Mercury standard library.

library/array.m:
    Delete a predicate that served as a test for an ancient bug fix.

NEWS:
    Announce both the new ra_list module, and the deletion of the predicate
    from array.m.

tests/hard_coded/array_sort.m:
    Don't call the predicate deleted from array.m.

tests/hard_coded/ra_list_test.{m,exp}:
    A new test case to test operations on ra_lists.

tests/hard_coded/Mmakefile:
    Enable the new test case.
2022-06-11 11:11:30 +10:00
Zoltan Somogyi
4865f11503 Update programming style. 2020-10-04 13:20:42 +11:00
Zoltan Somogyi
33eb3028f5 Clean up the tests in half the test directories.
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.
2015-02-14 20:14:03 +11:00
Peter Wang
22d31d95b1 Fix array.sort.
array.sort was broken since 2001 when the implementation was changed
from merge sort to SAM sort.

library/array.m:
	Fix the confusion as to which output argument of samsort_up is
	sorted.

	Add optional runtime checks of the pre- and post-conditions
	of samsort_up and samsort_down when built with a trace flag.

	Add array.sort_fix_2014.

tests/hard_coded/Mmakefile:
tests/hard_coded/array_sort.exp:
tests/hard_coded/array_sort.m:
	Add test program.

NEWS:
	Announce the fix.
2014-10-10 16:11:12 +11:00