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.
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.
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.
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.
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
NOTE: this change does not affect the io module -- I've left that for a
separate change.
library/*.m:
As per the recent change to the coding standard, avoid module
qualification in library interfaces where possible.
Reformat declarations and descriptive comments to better utilise
any space freed up by the above.
library/array.m:
library/version_array.m:
Add the above predicates.
NEWS:
Announce the new predicates.
tests/hard_coded/Mmakefile:
tests/hard_coded/array_all_tf.{m,exp}:
Test the new predicates.
tests/hard_coded/version_array_test.{m,exp}:
Extend this test case to cover the new predicates.
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.
Branches: main, 11.07 (documentation fix for array.bsearch/4 only)
Changes to array module.
library/array.m:
Omit the header comment regarding the use of
ML_OMIT_ARRAY_BOUNDS_CHECKS. Beside being specific to the
C backends, requiring users to recompile the library (or
parts thereof) is just awkward. In any case, the array
module now exports "unsafe" versions of the relevant
operations that omit the bounds checking, so the old
approach should be unnecessary.
Mark array.svset/4 and array.unsafe_svset/4 as obsolete.
They will be deleted after the next release.
Fix the documentation of array.bsearch/4. It does _not_
fail if the element being searched for is not present.
mdbcomp/mdbcomp.goal_path.m:
Conform to the above change.
compiler/llds_out_data.m:
Fix some formatting.
Branches: 11.07, main
library/array.m:
Add an unsafe version of field update for arrays,
'unsafe_elem :='/3.
Support foldl and foldr over arrays with 3-5 accumulators.
Privately export the predicate dynamic_cast_to_array/2 from
this module. Previously, there were several definitions of
this scattered throughout the library.
Use unsafe operations (which are more efficient) in several places
where it is safe to do so.
Use state variable notation in more places.
library/int.m:
Add an additional mode to each of int.fold_up2/7 and int.fold_down2/7
with the modes (array_di, array_uo).
library/hash_table.m:
library/pprint.m:
library/version_hash_table.m:
Delete duplicate definitions of dynamic_cast_to_array/2 and use
the definition exported from the array module instead.
NEWS:
Announce the above.
Branches: main, 11.07
Fix some documentation bugs (#205 and #206 in Mantis).
doc/user_guide.texi:
Fix an incorrect option for mtc.
library/array.m:
Replace the description of foldr2 which refers to
a predicate that doesn't exist.