Commit Graph

4 Commits

Author SHA1 Message Date
Zoltan Somogyi
d302810ecf Add some utility predicates, and make some cleanups.
library/list.m:
    Add a predicate version of map_corresponding3.

    Move a predicate next to its only call site.

    Use more meaningful variable names.

library/map.m:
library/tree234.m:
    Add several predicates: foldl4_values, foldl5_values, filter_map_values
    and filter_map_values_only.

library/multi_map.m:
    Embed an implicit assertion in a call.

library/set_ordlist.m:
    Give a predicate a better name.

library/NEWS:
    Announce the new additions.

    Put the list of updated library modules back into alphabetical order.

tests/hard_coded/test_map_filter.{m,exp}:
    Test the one wholly new utility predicate.
2020-02-27 19:23:17 +11:00
Julien Fischer
5896264b9b Efficient insertion of duplicate items into bags.
library/bag.m:
    Add predicates and a function for efficiently inserting multiple copies of
    an item into a bag.

NEWS:
    Announce the above additions.

tests/hard_coded/bag_various.{m,exp}:
    Extend this test to cover the above.
2017-05-07 02:39:53 +10: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
Ondrej Bojar
63a60f056f Add functions bag.count/1, bag.count_unique/1 and predicates bag.member/2
Estimated hours taken: 1
Branch: main

Add functions bag.count/1, bag.count_unique/1 and predicates bag.member/2
and bag.member/3 to the bag module.

NEWS:
    Announce the new predicates and functions.
    Minor indentation unification.

library/bag.m:
    New functions and predicates.

tests/hard_coded/bag_various.m:
tests/hard_coded/bag_various.exp:
    A simple testcase for the new predicates, with expected results.

tests/hard_coded/Mmakefile:
    Enabled the test.
2007-03-12 02:19:31 +00:00