Commit Graph

251 Commits

Author SHA1 Message Date
Peter Wang
362290595f Stop using higher order function insts as modes in the library.
library/array.m:
library/benchmarking.m:
library/bitmap.m:
library/hash_table.m:
library/list.m:
library/one_or_more.m:
library/set_bbbtree.m:
library/set_ctree234.m:
library/test_bitset.m:
library/thread.future.m:
library/version_hash_table.m:
    As above.
2023-07-27 13:55:54 +10:00
Zoltan Somogyi
219a387602 Stop using higher order insts as modes ...
... in a first batch of library modules.
2023-07-26 16:22:04 +02:00
Zoltan Somogyi
5cbcfaa0ed Move X_to_doc functions to pretty_printer.m.
library/array.m:
library/char.m:
library/float.m:
library/int.m:
library/int16.m:
library/int32.m:
library/int64.m:
library/int8.m:
library/list.m:
library/one_or_more.m:
library/string.m:
library/tree234.m:
library/uint.m:
library/uint16.m:
library/uint32.m:
library/uint64.m:
library/uint8.m:
library/version_array.m:
    Mark the X_to_doc function in each of these modules as obsolete,
    and make it a forwarding function to the actual implementation
    in pretty_printer.m. The intention is that when these forwarding
    functions are eventually removed, this will also remove the dependency
    of these modules on pretty_printer.m. This should help at least some
    of these modules escape the giant SCC in the library's dependency graph.
    (It does not make sense that a library module that adds code to increment
    an int thereby becomes dependent on pretty_printer.m through int.m.)

library/pretty_printer.m:
    Move all the X_to_doc functions from the above modules here.

    Fix the one_or_more_to_doc function, which was

    - missing the comma between the two arguments of the one_or_more
      function symbol, and

    - would print "..., ...]" instead of just "...]" at the end of the
      tail list when that list exceeded the limits of the specified pp_params.

    Rename one of the moved types along with its function symbols,
    to reduce ambiguity.

    Put arrays before their indexes in the argument lists of some of
    the moved functions.

    Some of the moved X_to_doc functions for compound types returned
    a doc that had an indent wrapper. These indents differed between the
    various X_to_doc functions without any visible reason, but they are
    also redundant. The callers can trivially add such wrappers if they
    want to, but taking them off, if they want them off, is harder.
    Eliminate the problem by deleting all such indent wrappers.

    Add formatters for the intN, uintN and one_or_more types to the
    default formatter map. Their previous absence was an oversight.

    Add a function, get_formatter_map_entry_types, that returns the ids
    of the types in the formatter_map given to the function. It is intended
    for tests/hard_coded/test_pretty_printer_defaults.m, but is exported
    for anyone to use.

tests/hard_coded/test_pretty_printer_defaults.{m,exp}:
    Use get_formatter_map_entry_types to print the default formatter map
    in a format that is much more easily readable.

NEWS:
    Announce all the user-visible changes above.
2022-12-27 18:27:52 +11:00
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
e9d9726014 Organize array.m, bt_array.m and pprint.m.
library/array.m:
library/bt_array.m:
library/pprint.m:
    In each of these modules,

    - put related predicates next to each other,
    - put the groups of related predicates into a meaningful order, and
    - improve the documentation of some predicates, and
    - improve some variable names in the implementation, including giving
      explicit names to some function results.

library/Mercury.options:
    Enable the warning about inconsistent predicate order for two of those
    modules, but not bt_array.m, pending a decision about making its
    informal "submodule" an actual separate module.
2022-06-08 19:59:15 +10:00
Julien Fischer
e7d28ff90f Update copyright notices in stdlib.
library/*.m:
    As above.
2022-06-07 21:51:03 +10:00
Julien Fischer
bc79412af2 Delete the old random number generator.
It has been deprecated since Mercury 20.01.

library/random.m:
    Delete the old generator.

library/array.m:
    Delete the predicate random_permutation/4.

NEWS:
    Announce the above.

tests/hard_coded/string_hash.m:
    Update this test to use the new RNG framework.

tests/hard_coded/Mmakefile:
tests/hard_coded/random_permutation.{m,exp}:
tests/hard_coded/random_simple.{m,exp}:
    Delete these tests, they were specific to the old RNG.

extras/curs/samples/nibbles.m:
extras/solver_types/library/any_array.m:
    Replace use of the old RNG.
2022-03-15 16:08:48 +11:00
Zoltan Somogyi
8ff61f8a4b Delete quotes from `VarNames' in stdlib comments.
In the Mercury standard library, every exported predicate or function
has (or at least *should* have) a comment that documents it, including
the meanings of its arguments. About 35-40% of these modules put `'s
(left and right quotes) around the names of the variable representing
those arguments. Some tried to do it consistently (though there were spots
with unquoted or half quoted names), while some did it only a few places.
This is inconsistent: we should either do it everywhere, or nowhere.
This diff makes it nowhere, because

- this is what the majority of the standard library modules do;
- this is what virtually all of the modules in the compiler, profiler,
  deep_profiler etc directories do;
- typing all those quotes when adding new predicates in modules that
  follow this convention is a pain in the ass; and because
- on many modern terminals, `' looks non-symmetrical and weird.

Likewise, the comment explaining a predicate often started with

    % `predname(arguments)' returns ...

This diff deletes these quotes as well, since they add nothing useful.

This diff does leave in place quotes around code fragments, both terms
and goals, where this helps delineate the boundaries of that fragment.
2022-03-07 11:49:00 +11:00
Zoltan Somogyi
7c12474f98 Add array.generate_foldl2.
library/array.m:
    As above.

    Turn an aux function into a predicate to allow the use of state vars.

    Use more meaningful variable names.

NEWS:
    Announce the new predicate.
2021-08-20 15:34:13 +10:00
Julien Fischer
d44f4d5953 Add missing can_pass_as_mercury_type attribute.
library/array.m:
     Set the can_pass_as_mercury_type attribute on the C foreign_type
     for array/1.
2021-06-26 19:42:44 +10:00
Zoltan Somogyi
0d7c8a7654 Specify pred or func for all pragmas.
*/*.m:
    As above.

configure.ac:
    Require the installed compiler to support this capability.
2021-06-16 15:23:58 +10:00
Peter Wang
0d3fcbaae3 Delete Erlang code from library/mdbcomp/browser directories.
library/*.m:
    Delete Erlang foreign code and foreign types.

    Delete documentation specific to Erlang targets.

library/deconstruct.m:
    Add pragma no_determinism_warning to allow functor_number_cc/3
    to compile for now.

library/Mercury.options:
    Delete workaround only needed when targetting Erlang.

browser/listing.m:
mdbcomp/rtti_access.m:
    Delete Erlang foreign code and foreign types.
2020-10-28 14:10:56 +11:00
Zoltan Somogyi
58ea6ffff2 Delete old obsolete predicates and functions.
library/*.m:
    Specifically, delete any predicates and functions whose `pragma obsolete'
    dates from 2018 or before. Keep the ones that were obsoleted
    only this year or last year.

NEWS:
    Announce the changes.

tests/debugger/io_tab_goto.m:
tests/debugger/tabled_read.m:
tests/declarative_debugger/io_stream_test.m:
tests/declarative_debugger/tabled_read_decl.m:
tests/declarative_debugger/tabled_read_decl_goto.m:
tests/general/array_test.m:
tests/hard_coded/mutable_init_impure.m:
tests/hard_coded/remove_file.m:
tests/tabling/mercury_java_parser_dead_proc_elim_bug.m:
tests/tabling/mercury_java_parser_dead_proc_elim_bug2.m:
tests/valid/mercury_java_parser_follow_code_bug.m:
    Replace references to predicates and functions that this diff deletes
    with their suggested replacements.

    In several test cases, bring the programming style up to date.

tests/hard_coded/shift_test.{m,exp}:
    Most of this test case tested the now-deleted legacy shift operations.
    Replace these with tests of their non-legacy versions, including
    testing for the expected exceptions.

tests/hard_coded/shift_test.{m,exp}:
    Don't pass --no-warn-obsolete when compiling shift_test.m anymore.
2020-08-18 11:57:47 +10:00
Zoltan Somogyi
a6228a9e1a Fix too-long lines. 2020-04-10 03:22:40 +10:00
Julien Fischer
86a767095f Fix a bug in the C# implementation of array.shrink/3.
library/array.m:
   Workaround the fact that C#'s 'is' operator has some fairly surprising
   behaviour with arrays of integer types.

tests/hard_coded/array_primitives.{m,exp}:
tests/hard_coded/array_shrinks.{m,exp}:
   Improve the coverage of these tests.
2019-09-05 17:06:24 +10:00
Julien Fischer
65f683e6f2 Fix arrays with fixed size integer elements for C#.
library/array.m
    Handle all integer types in the methods for creating and resizing arrays in
    the C# grades.
2019-08-29 22:08:26 +10:00
Zoltan Somogyi
a3786d4402 Expand two comments. 2019-08-16 13:07:46 +10:00
Julien Fischer
e876db7873 Adjust bounds checking behaviour of array.fetch_items/4.
Change array.fetch_items/4 to return an empty list for an empty range in the
case where the endpoints of that range are not within the array bounds.

library/array.m:
   As above.

deep_profiler/autopar_types.m:
   Undo Zoltan's recent workaround for the above behaviour.

tests/hard_coded/array_fetch_items.{m,ex}:
   Add tests for this behaviour.
2019-08-16 12:40:36 +10:00
Zoltan Somogyi
95f8f56716 Delete unneeded $module args from calls to expect/unexpected. 2019-07-03 22:37:19 +02:00
Julien Fischer
3a7254bca2 Improve the documentation for array.fetch_items.
Change the behaviour of the above predicate in the following ways:
- throw an index_out_of_bounds/0 exception instead of a software_error/0
  exception if either index is out of bounds.
- perform the out of bounds check before checking if the third argument is
  less than the second.

Add an more comprehensive test of fetch_items/4.

library/array.m:
    Make it clear that the range of indexes passed to fetch_items is
    inclusive.

    Throw an index_out_of_bounds/0 exception instead of a software_error/1
    exception if either of the indexes is out of bounds.

    Perform the array bounds check first, before checking if the third
    argument is less than the second.

    Document what happens if the upper index is less than the lower one.

    Fix a typo in the documentation of fill_range/4.

    Update the definition of to_list/2 to conform with the above change
    to the array bounds checks.

NEWS:
    Announce the above change to the semantics of fetch_items/0.

tests/hard_coded/Mmakefile:
tests/hard_coded/array_fetch_items.{m,exp}:
    Add a more comprehensive
2018-12-24 06:15:23 +00:00
Julien Fischer
8d89c9ff37 Add array.swap/4 and array.unsafe_swap/4.
Report out-of-bounds errors more precisely for array.fill_range/5.

library/array.m:
    As above.

NEWS:
    Announce the addition.

tests/hard_coded/Mmakefile:
tests/hard_coded/array_swap.{m,exp}:
    Add a test for array.swap/4.

tests/hard_coded/array_fill.exp:
    Conform to the second change above.
2018-11-12 06:40:46 +00:00
Julien Fischer
b049a5c3db Fix a problem with array.resize.
array.resize/4 has inconsistent behaviour across backends if its first argument
is negative; make it throw an exception if the first argument is negative.

library/array.m:
    As above.

NEWS:
    Announce the change.

tests/hard_coded/Mmakefile:
tests/hard_coded/array_resize.{m,exp}:
    Add a more extensive test case for array.resize.
2018-11-12 03:52:32 +00:00
Julien Fischer
71a78fa98c Fix problems with array.shrink/3.
The behaviour of array.shrink/3 was not defined if its first argument was
negative.  If this occurred, the C backends would return an empty array, while
the non-C backends would abort.  This diff changes the behaviour of shrink/3 so
that it throws an exception if its first argument is negative.

The implementation of shrink/3 for the Java backend did not handle the case
where the array's element type was represented by the one the following Java
primitive types: byte, short, long and float.  Handle those cases.

library/array.m:
   Make the above fixes.

   Fix a typo in my previous commit.

NEWS:
   Note the change in behaviour if the first argument of shrink/3 is
   negative.

tests/hard_coded/Mmakefile:
tests/hard_coded/array_shrink.{m,exp}:
   Add a test case.
2018-11-11 04:24:55 +00:00
Julien Fischer
4eda536190 Document exception conditions for array.init/3 and array.generate/2.
library/array.m:
    Document that the above will throw an exception if their first
    argument is < 0.
2018-11-09 12:21:51 +11:00
Julien Fischer
2b47521daa Fix an abort in the Java implementation of array.copy/2.
library/array.m:
     Handle all Java primitive types in the implementation of
     array.copy/2.

tests/hard_coded/Mmakefile:
tests/hard_coded/array_copy.{m,exp}:
     Add a test case.
2018-11-09 11:55:45 +11:00
Julien Fischer
ee5f7f621d Add array.fill/3, array.fill_range/5 and array2d.fill/3.
library/array.m:
library/array2d.m:
    Add the new predicates.

    Add a note a likely problem with another predicate.

NEWS:
    Announce them.

tests/hard_coded/Mmakfile:
tests/hard_coded/array_fill.{m,exp}:
    Add a test case.
2018-11-08 10:15:03 +00:00
Zoltan Somogyi
c7f8ebbe2f Avoid warnings from --warn-non-contiguous-{clauses,foreign-procs}.
browser/collect_lib.m:
browser/declarative_execution.m:
browser/dl.m:
browser/io_action.m:
compiler/make.util.m:
compiler/pickle.m:
compiler/process_util.m:
compiler/prog_event.m:
library/array.m:
library/benchmarking.m:
library/bit_buffer.m:
library/builtin.m:
library/char.m:
library/deconstruct.m:
library/dir.m:
library/erlang_rtti_implementation.m:
library/int.m:
library/int16.m:
library/int32.m:
library/int64.m:
library/int8.m:
library/io.m:
library/math.m:
library/mutvar.m:
library/private_builtin.m:
library/profiling_builtin.m:
library/rtti_implementation.m:
library/store.m:
library/string.format.m:
library/string.m:
library/table_builtin.m:
library/term_size_prof_builtin.m:
library/thread.m:
library/time.m:
library/type_desc.m:
library/uint16.m:
library/uint32.m:
library/uint64.m:
library/uint8.m:
ssdb/ssdb.m:
    As above. This mostly involved two things.

    The first was grouping foreign_procs by predicate instead of by language.
    In a few cases, this revealed that some predicates *had* no foreign_proc
    for a language, while related predicates did have one that just aborted
    if called. This diff adds similar aborting foreign_procs to predicate/
    language combinations that were missing them, when this seemed obviously
    the right thing to do.

    The second was moving pragmas about a predicate from the middle of the
    block of clauses of that predicate to the start of that block.
2018-10-19 11:01:33 +11:00
Julien Fischer
d51e2a5bbb Fix the modes of array.map.
library/array.m:
    The current modes for array.map do not match what the implementation
    actually does: specifically, map does not destructively update its
    input array argument.

    Call unsafe_init/3 in a few spots where it is safe to do so.

tests/hard_coded/ho_array_ops.{m,exp}:
    Extend this test to cover array.map.
2018-08-16 16:17:13 +10:00
Julien Fischer
c32c99b269 Minor improvement to equality and comparison for arrays.
library/array.m:
    Use unsafe lookups in the implementation of equality and
    comparison.  In these cases the lookups are safe since
    the necessary bounds checks are done by the caller.

    Avoid unnecessary module qualification.

tests/hard_coded/Mmakefile:
tests/hard_coded/array_unify_compare.{m,exp}:
    Add a systematic test for array equality and comparison.
2018-08-15 09:46:49 +10:00
Julien Fischer
a3efc705a9 Change semantics of array.map_corresponding_foldl/6.
library/array.m:
    Make array.map_corresponding_foldl/6 throw an exception if the input
    arrays differ in size.   This brings its behaviour into line with that of
    the other "corresponding" predicates.  It also avoids the unsafe behaviour
    that can currently result when the second input array has fewer elements
    than the first.

    Add some additional modes to array.map_corresponding_foldl/6.

    Replace calls to error/1 with calls to unexpected/2 throughout this
    module.

NEWS:
    Announce the above change.

tests/hard_coded/ho_array_ops.{m,exp}:
    Extend this test to cover map_corresponding_foldl/6.
2018-08-14 11:08:49 +10:00
Julien Fischer
0dc0834973 Add foldl_corresponding/5 and foldl2_corresponding/7 for arrays.
library/array.m:
    Add the above predicates.

NEWS:
    Announce the additions.

tests/hard_coded/Mmakefile:
tests/hard_coded/ho_array_ops.{m,exp}:
    Add tests of the new predicates.
2018-08-14 11:08:49 +10:00
Zoltan Somogyi
a12692a0de Replace /* */ comments with // in the library.
Keep the old style comments where they do not go to the end of the line,
or where it is important that the comment line not have a // on it.
2018-06-21 18:55:08 +02:00
Julien Fischer
f54fe5f846 Update references to the IL backend.
browser/Mmakefile:
compiler/options.m:
library/array.m:
    As above.
2018-06-15 07:48:56 -04:00
Mark Brown
d465fa53cb Update the COPYING.LIB file and references to it.
Discussion of these changes can be found on the Mercury developers
mailing list archives from June 2018.

COPYING.LIB:
    Add a special linking exception to the LGPL.

*:
    Update references to COPYING.LIB.

    Clean up some minor errors that have accumulated in copyright
    messages.
2018-06-09 17:43:12 +10:00
Peter Wang
41e2470633 Deprecate array least_index/greatest_index functions and add replacements.
library/array.m:
    Add det_least_index, semidet_least_index, det_greatest_index,
    semidet_greatest_index functions.

    Deprecate least_index, greatest_index with the intention of making
    them semidet eventually.

NEWS:
    Announce changes.
2018-04-08 13:57:52 +10:00
Peter Wang
6df99209b9 Improve documentation for array bounds predicates.
library/array.m:
library/bt_array.m:
    Do not assume that the lower bound is zero in the documentation for
    array.max.

    Make explicit the argument order of bounds/3 predicates
    and document behaviour on empty arrays.
2017-12-03 09:57:28 +11:00
Peter Wang
d7d1471881 Clarify behaviour of upper bounds functions for array types.
library/array.m:
library/bt_array.m:
library/version_array.m:
    As above.
2017-12-01 17:36:20 +11:00
Peter Wang
148891de0d Delete unused foreign exported procedures.
library/array.m:
library/bool.m:
library/exception.m:
library/type_desc.m:
    As above.
2016-10-06 11:45:30 +11:00
Julien Fischer
a369cef8af Allow foreign types to be Java primitive types.
Currently we only allow non-primitive Java types to used with foreign_type
pragmas.  This means that for foreign types that map on to Java primitive types
we have to use their boxed form (e.g. java.lang.Long, java.lang.Float etc) in
the foreign_type pragma.  Doing so results in unnecessary boxing and is a
source of errors (e.g. accidently comparing for reference equality instead of
value equality).

This change causes the MLDS->Java code generator to recognise primitive
foreign_types and generate code that works for them directly.   (In effect
their handling is not really different to how the builtin types are handled.)

doc/reference.texi:
     Change the language so Java foreign types are allowed to be a
     primitive Java types.

compiler/mlds_to_java.m:
     Recognise foreign types that are defined as primitive types in Java and
     generate code that avoids the need for (some) boxing of them.

library/array.m:
     Handle arrays of Java bytes, shorts, longs and floats specially.
     (boolean, char, int and double were already handled thus.)

NEWS:
     Announce the above.

tests/hard_coded/Mmakefile:
tests/hard_coded/test_java_foreign_primitive.{m,exp}:
     Test that foreign types work with primitive types in Java.
2016-04-13 16:37:29 +10:00
Julien Fischer
5054ccbe31 Fix spelling.
deep_profiler/dump.m:
deep_profiler/recursion_patterns.m:
library/array.m:
library/type_desc.m:
    As above.
2016-01-23 14:03:37 +11:00
Julien Fischer
3dd02876a5 Delete the MLDS->IL backend.
compiler/mlds_to_il.m:
compiler/mlds_to_ilasm.m:
compiler/mlds_to_managed.m:
compiler/il_peephole.m:
compiler/ilasm.m:
compiler/ilds.m:
    Delete the modules making up the MLDS->IL code generator.

compiler/globals.m:
compiler/prog_data.m:
    Delete IL as a target and foreign language.

compiler/prog_io_pragma.m:
    Delete the max_stack_size/1 foreign proc attribute.  This was only
    ever required by the IL backend.

compiler/options.m
    Delete options used for the IL backend.

compiler/write_deps_file.m:
    Don't generate mmake targets for .il files etc.

compiler/*.m:
    Conform to the above changes.

compiler/notes/compiler_design.html
compiler/notes/work_in_progress.html
    Conform to the above changes.

library/*.m:
    Delete IL foreign_proc and foreign_export pragmas.

README.DotNet:
    Delete this file.

browser/Mmakefile:
compiler/Mmakefile:
deep_profiler/Mmakefile:
mdbcomp/Mmakefile:
mfilterjavac/Mmakefile:
profiler/Mmakefile:
runtime/Mmakefile:
slice/Mmakefile:
    Conform the above changes.

configure.ac:
    Don't check that IL is a supported foreign language when performing the
    up-to-date check.

    Delete the '--enable-dotnet-grades' option.

scripts/Mmake.vars.in:
    Delete variables used for the IL backend (and in on case by the Aditi
    backend).

scripts/Mercury.config.bootstrap.in:
scripts/Mercury.config.in:
scripts/Mmake.rules:
scripts/canonical_grade.sh-subr:
tools/bootcheck:
    Delete stuff related to the 'il' and 'ilc' grades.

doc/reference_manual.texi:
     Delete the documentation of the 'max_stack_size' option.

doc/user_guide.texi:
     Delete stuff related to the IL backend.

tests/hard_coded/csharp_test.{m,exp}:
tests/invalid/foreign_type_missing.{m,err_exp}:
tests/valid/csharp_hello.m:
	Delete these tests: they are no longer relevant.

tests/hard_coded/equality_pred_which_requires_boxing.m:
tests/hard_coded/foreign_import_module.m:
tests/hard_coded/foreign_import_module_2.m:
tests/hard_coded/foreign_type.m:
tests/hard_coded/foreign_type2.m:
tests/hard_coded/foreign_type3.m:
tests/hard_coded/intermod_foreign_type2.m:
tests/hard_coded/lp.m:
tests/hard_coded/user_compare.m:
tests/invalid/foreign_type_2.m:
tests/invalid/foreign_type_missing.{m,err_exp}:
tests/invalid/foreign_type_visibility.m:
tests/invalid/illtyped_compare.{m,err_exp}:
tests/submodules/external_unification_pred.m
tests/valid/big_foreign_type.m
tests/valid/solver_type_bug.m
tests/valid_seq/foreign_type_spec.m
tests/valid_seq/intermod_impure2.m
    Delete IL foreign_procs where necessary.

tests/hard_coded/Mmakefile
tests/invalid/Mercury.options
tests/invalid/Mmakefile
tests/submodules/Mmakefile
tests/valid/Mercury.options
tests/valid/Mmake.valid.common
tests/valid/Mmakefile
tests/valid_seq/Mmakefile
tests/valid_seq/Mercury.options
    Conform to the above changes.
2015-09-21 11:34:46 +10:00
Zoltan Somogyi
0e368eba13 Convert (C->T;E) to (if C then T else E).
Also remove unnecessary module qualification from clause heads and recursive
calls, and replace some use of ^ elem(I) notation with explicit calls to
lookup and set predicates.
2015-08-31 15:32:47 +10:00
Julien Fischer
74e3d35ae9 Fixes for library documentation.
library/pretty_printer.m:
library/getopt_io.m:
library/getopt.m:
	Fix typos.

library/array.m:
library/list.m:
library/queue.m:
library/version_array.m:
	s/Nth/N'th/ etc.
2015-01-14 13:49:44 +11:00
Zoltan Somogyi
8410473315 Prevent overflow when computing Mid in binary searches.
library/array.m:
library/bt_array.m:
    As above.
2014-12-21 21:12:37 +11:00
Zoltan Somogyi
793aecc405 Fix an issue with potential code reordering. 2014-12-06 19:43:25 +11:00
Zoltan Somogyi
4658b3f019 Remove some unnecessary XXXs. 2014-12-05 22:37:23 +11:00
Zoltan Somogyi
6cf10d14a0 Mark array.bsearch as obsolete. 2014-12-04 16:35:21 +11:00
Zoltan Somogyi
35fe4814ce Fix Mantis bug #367.
library/array.m:
    When doing a binary search using a user-supplied comparison function,
    do not use the builtin term comparison operation to compare elements.

    Use separate loops for binary_search and approx_binary_search, since
    using the loop for approx_binary_search in the implementation of
    binary_search executes some unnecessary extra tests.

    Improve the documentation of both binary_search and approx_binary_search.

tests/general/array_binsearch.{m,exp}:
    Rewrite this test case to make it much tougher, testing the operation
    of binary_search and approx_binary_search with both the builtin and
    user-supplied comparison operations, and in the presence of repeated
    elements, and with automatic verification of the results.
2014-12-03 18:20:36 +11:00
Zoltan Somogyi
7f9791aa26 Standardize divider line lengths in the library.
library/*.m:
    As above.

tool/stdlines:
    A new shell script to do the job.
2014-11-23 22:05:34 +11:00
Zoltan Somogyi
15abab79de Wrap some too-long lines in the library. 2014-11-03 21:03:26 +11:00