Commit Graph

122 Commits

Author SHA1 Message Date
Fergus Henderson
2bda4471e2 Fix a bug where the Mercury calls C++ sample was not linking with the
Estimated hours taken: 0.25
Branches: main

Fix a bug where the Mercury calls C++ sample was not linking with the
C++ library.  This worked, because the sample didn't actually make use
of the C++ library, but failed as soon as users tried to extend the
sample to use with their real C++ programs.

samples/c_interface/mercury_calls_cplusplus/cpp_main.cc:
	Use the C++ standard library's stream I/O, rather than printf().

samples/c_interface/mercury_calls_cplusplus/Mmakefile:
	Make sure that we link with the C++ standard library.
	Also, comment out the old hack that worked around a g++ 2.7 bug
	which is fixed in g++ 2.95.
2003-10-09 03:09:53 +00:00
Fergus Henderson
c880e31dbe Fix a bug where the Mercury calls C++ sample was actually using C, not C++.
Estimated hours taken: 0.25
Branches: main

Fix a bug where the Mercury calls C++ sample was actually using C, not C++.

samples/c_interface/mercury_calls_cplusplus/cpp_main.c:
samples/c_interface/mercury_calls_cplusplus/cpp_main.cc:
	Rename cpp_main.c as cpp_main.cc, so that it gets compiled as C++
	code rather than as C code.  Add a dummy class declaration to its
	source, to check that it is really C++ code.
2003-10-08 12:15:44 +00:00
Peter Ross
f30ed91489 Backout some accidently committed changes.
Estimated hours taken: 0.1
Branches: main

runtime/mercury_construct.c:
samples/diff/Mmakefile:
	Backout some accidently committed changes.
2003-03-10 14:25:44 +00:00
Peter Ross
efdaf1f224 Fix a performance bug where dead_pred_elim was taking a significant
Estimated hours taken: 6
Branches: main

Fix a performance bug where dead_pred_elim was taking a significant
amount of time to delete entries from the predicate_table.  With this
change dead_pred_elim goes from 12 minutes to 55 seconds CPU time in
the IL grade when compiling accumulator.m with
--intermodule-optimization turned on.

compiler/hlds_module.m:
	Implement a new predicate, predicate_table_restrict, which
	restricts the predicate_table to include only a subset of the
	predicates.
	Rather than deleting all the non-needed entries, this
	predicate builds the predicate_table from scratch again, hence
	this predicate is only useful when the number of predicates to
	keep is significantly less than the number of predicates to
	delete.
	Change predicate_table_do_insert so that it records in the
	pred_info whether or not a predicate can only be accessed by
	its fully qualified name, this is needed so that the
	predicate_table can be rebuilt correctly.

compiler/dead_proc_elim.m:
	Use predicate_table_restrict to restrict the set of pred_ids
	in the predicate_table rather than module_info_remove_predicate
	as the amount of predicates to keep is in general
	significantly smaller than the number of predicates to keep.

compiler/hlds_pred.m:
	Add a new pred_marker which indicates whether or not a
	predicate can only be accessed by its fully qualified name.

compiler/hlds_out.m:
compiler/intermod.m:
	Handle the new pred_marker.
2003-03-10 14:10:55 +00:00
Fergus Henderson
a18332a294 Various fixes for the .NET back-end.
Estimated hours taken: 3
Branches: main

Various fixes for the .NET back-end.

compiler/Mmakefile:
	For IL grades, use editbin to set the stack size to 100M,
	since the default (1M) is too small.
	Also, don't try to build mlds_to_gcc in IL grades -- gcc.m won't
	compile, because the IL grades don't support the C interface.

library/Mmakefile:
	Add some missing dependencies.

profiler/Mmakefile:
deep_profiler/Mmakefile:
	Conditionalize some dependencies that were bogus for IL grades.

library/.cvsignore:
compiler/.cvsignore:
profiler/.cvsignore:
deep_profiler/.cvsignore:
analysis/.cvsignore:
browser/.cvsignore:
samples/.cvsignore:
	Various minor updates to ignore files produced when building in
	IL grades.
2003-02-15 23:59:41 +00:00
Fergus Henderson
06cd026178 Add .cvsignore.
Estimated hours taken: 0.25
Branches: main

samples/.nocopyright:
	Add .cvsignore.
2003-02-15 23:50:42 +00:00
Fergus Henderson
088a269a3d Add missing `MR_' prefixes.
Estimated hours taken: 0.25
Branches: main

samples/c_interface/c_calls_mercury/c_main.c:
samples/c_interface/cplusplus_calls_mercury/cpp_main.cc:
samples/c_interface/simpler_c_calls_mercury/main.c:
samples/c_interface/simpler_cplusplus_calls_mercury/main.cc:
	Add missing `MR_' prefixes.
2002-02-06 09:01:38 +00:00
Simon Taylor
66bf99c9d6 Simplify the simpler_c_calls_mercury and
Estimated hours taken: 0.25
Branches: main

Simplify the simpler_c_calls_mercury and
simpler_cplusplus_calls_mercury samples to
avoid explicit construction of the `ml' command line.

samples/c_interface/simpler_c_calls_mercury/c_main.c:
	Renamed as main.c.

samples/c_interface/simpler_cplusplus_calls_mercury/cpp_main.cc:
	Renamed as main.cc.

samples/c_interface/simpler_c_calls_mercury/c_main.m:
samples/c_interface/simpler_cplusplus_calls_mercury/cpp_main.m:
	Empty main modules, used to set the name executable
	produced by mmake.

samples/c_interface/simpler_cplusplus_calls_mercury/Mmakefile:
samples/c_interface/simpler_c_calls_mercury/Mmakefile:
	Handle file renamings.

	Remove explicit rules to build executables.

	Remove unnecessary header file dependencies.
2001-12-21 06:37:46 +00:00
Simon Taylor
cdf3ef12be Simplify the c_calls_mercury and cplusplus_calls_mercury samples.
Estimated hours taken: 0.5
Branches: main

Simplify the c_calls_mercury and cplusplus_calls_mercury samples.

c_calls_mercury/mercury_main.m:
cplusplus_calls_mercury/mercury_main.m:
c_calls_mercury/Mmakefile:
cplusplus_calls_mercury/Mmakefile:
	Import mercury_lib.m from mercury_main.m to avoid
	requiring explicit dependencies on mercury_lib.o.

	Remove unnecessary header file dependencies.
2001-12-21 06:23:01 +00:00
Simon Taylor
da2e0433c6 Use C2INITARGS or MLFLAGS instead of C2INITFLAGS.
Estimated hours taken: 0.25
Branches: main

bytecode/Mmakefile:
compiler/Mmakefile:
extras/aditi/Mmakefile:
extras/curses/sample/Mmakefile:
extras/graphics/samples/calc/Mmakefile:
extras/graphics/samples/maze/Mmakefile:
extras/graphics/samples/pent/Mmakefile:
extras/morphine/non-regression-tests/Mmakefile:
samples/c_interface/simpler_c_calls_mercury/Mmakefile:
samples/c_interface/simpler_cplusplus_calls_mercury/Mmakefile:
tests/benchmarks/Mmakefile:
tests/debugger/Mmakefile:
tests/debugger/declarative/Mmakefile:
tests/hard_coded/Mmakefile:
	Use C2INITARGS or MLFLAGS instead of C2INITFLAGS.
2001-12-19 15:08:30 +00:00
Simon Taylor
4167874245 Use MLOBJS, not MLLIBS, to hold the names of the
Estimated hours taken: 0.1
Branches: main, release

samples/c_interface/cpluscplus_calls_mercury/Mmakefile:
samples/c_interface/mercury_calls_c/Mmakefile:
samples/c_interface/mercury_calls_cplusplus/Mmakefile:
	Use MLOBJS, not MLLIBS, to hold the names of the
	non-Mercury object files.
2001-12-16 05:22:20 +00:00
Simon Taylor
0fd128ff7d Allow user-defined operator precedence tables for parser__read_term
Estimated hours taken: 4

Allow user-defined operator precedence tables for parser__read_term
and term_io__write_term.

library/ops.m:
	Define a typeclass `op_table' with methods for accessing
	operator precedence tables.

	Define a type `ops__mercury_op_table', representing the
	standard Mercury operator table.
	Make `ops__mercury_op_table' an instance of `op_table'.

	Define `ops__table' as equivalent to `ops__mercury_op_table'
	(it's obsolete, but we can't mark types as obsolete).

	Rename `ops__init_op_table' as `ops__init_mercury_op_table',
	mark ops__init_op_table as obsolete


library/parser.m:
library/term_io.m:
	Add variants of `parser__read_term' and `term_io__write_term'
	which take an operator precedence table.

	Don't hard-code the maximum priority and argument priority.
	Use the `op_table' methods to find those.

	Make the priority of operator terms (X `op` Y) 1, not 100.
	The reference manual states that operator terms have
	the highest precedence possible.

	This change slows down a program which does nothing but
	parse terms by a bit under 5%, less for writing.

library/hash_table.m:
	Fix a few places where parentheses are required because
	operator terms now have the lowest possible priority.
	`rem' is an operator -- it doesn't need backquotes.

compiler/mercury_to_mercury.m:
library/io.m:
	Rename `ops__init_op_table' to `ops__init_mercury_op_table'.

	Pass the `op_table' to `ops__max_priority'.

NEWS:
doc/reference_manual.texi:
	Document the changes.

	Add operator terms to the operator table.

	In the "Terms" section of the reference manual, use the same
	terminology to describe operator terms as is used in the
	"Builtin Operators" section.

samples/Mmakefile:
samples/README:
samples/calculator2.m:
	An example program.

tests/hard_coded/term_io_test.exp:
tests/invalid/func_errors.err_exp:
tests/invalid/inst_list_dup.err_exp:
tests/invalid/predmode.err_exp:
tests/invalid/some_err.exp:
	`term_io__write_term' now has the same argument priority
	behaviour as `parser__read_term', so remove some unnecessary
	parentheses from the output.
2001-11-08 15:30:40 +00:00
Simon Taylor
5544aed7ff Change the list constructor from ./2' to [|]/2'. `./2' will
Estimated hours taken: 3
Branches: main

Change the list constructor from `./2' to `[|]/2'. `./2' will
eventually become the module qualification operator.

library/parser.m:
library/io.m:
library/sparse_bitset.m:
library/std_util.m:
library/term_io.m:
compiler/mercury_to_mercury.m:
compiler/prog_io_dcg.m:
compiler/prog_io_goal.m:
compiler/prog_io_pragma.m:
compiler/prog_io_typeclass.m:
compiler/prog_io_util.m:
browser/interactive_query.m:
extras/moose/grammar.m:
extras/moose/moose.m:
extras/morphine/source/generate_call_site_cov.m:
extras/xml/xml.encoding.m:
samples/muz/higher_order.m:
tests/debugger/declarative/app.m:
tests/dppd/transpose_impl.m:
tests/hard_coded/ground_dd.m:
tests/hard_coded/split_c_files.m:
	Change all references to `./2' to use `[|]/2' instead.

compiler/typecheck.m:
	Handle `./2' as a special case in `report_error_undef_cons'.

	Warn about module list not being imported if `[|]/2' is undefined.

compiler/llds_out.m:
util/mdemangle.c:
profiler/demangle.m:
	Add name conversions for `[|]' (f_cons) and `[]' (f_nil).

NEWS:
doc/reference_manual.texi:
w3/tutorial/lists-n-things.m4:
	Document the changes.

tests/debugger/{,declarative}/*.exp*:
	Update test case results. For some tests the output changed
	because they output lists in the non-pretty format. For others,
	the output changed because the alphabetical ordering of the
	constructors of type `list/1' changed, so the numbering of
	the switch branches in the goal paths changed.
2001-09-25 09:37:12 +00:00
Simon Taylor
319df48866 Remove the RM_C mmake variable, which controlled whether the intermediate
Estimated hours taken: 0.5
Branches: main

Remove the RM_C mmake variable, which controlled whether the intermediate
`.c' files were removed (now they never are).

The implementation was buggy (it didn't work with parallel makes), and
made it difficult to avoid always recompiling the `.c' file with smart
recompilation.

Mmake.common.in:
configure.in:
README.AIX:
bindist/bindist.build_vars.in:
bindist/bindist.configure.in:
scripts/Mmake.vars.in:
scripts/Mmake.rules:
compiler/modules.m:
tools/bootcheck:
tools/binary_step:
*/Mmakefile:
	Remove references to RM_C, DEFAULT_RM_C and LIBRARY_RM_C.

compiler/modules.m:
	The `.o' and `.pic_o' file now depends only on the `.c' file,
	not on everthing the `.c' file depends on. The extra dependencies
	were only needed because the intermediate `.c' file could
	be removed by RM_C. This change is needed to avoid recompiling
	unchanged `.c' files with smart recompilation.
2001-05-18 14:23:59 +00:00
Mark Brown
61727c021e Specify the full pathname when source'ing Mmake.thisdir, since
Estimated hours taken: 0.5

samples/tests/*/runtests:
	Specify the full pathname when source'ing Mmake.thisdir, since
	the current directory is not always searched.
2001-02-09 06:46:42 +00:00
Fergus Henderson
9f03abee9a Add missing `import_module' statements in the interface section.
Estimated hours taken: 2

compiler/globals.m:
compiler/mode_errors.m:
compiler/mode_info.m:
compiler/transform_llds.m:
compiler/vn_order.m:
compiler/vn_verify.m:
samples/diff/globals.m:
	Add missing `import_module' statements in the interface section.
	(The current version of the compiler doesn't detect these errors.
	I have a fix for that bug, but I plan to commit it separately.)
2001-02-08 11:37:53 +00:00
Fergus Henderson
3f41481523 Fix some failing test cases in samples/c_interface.
Estimated hours taken: 2.5

Fix some failing test cases in samples/c_interface.
This fixes SourceForge bug report #131053.

samples/c_interface/cplusplus_calls_mercury/Mmakefile:
samples/c_interface/mercury_calls_cplusplus/Mmakefile:
samples/c_interface/simpler_cplusplus_calls_mercury/Mmakefile:
	Fix several bugs:
	- use $(MGNUC) rather than hard-coding mgnuc
	- pass $(ALL_GRADEFLAGS) $(ALL_MGNUCFLAGS) to mgnuc
	- pass $(ALL_GRADEFLAGS) $(ALL_MLFLAGS) to ml
	- s/*_REGS_H/MR_MACHDEPS_*_REGS_H/, to match
	  the renaming that was done a fair while back
	  in the runtime/machdeps/*.h.

samples/tests/c_interface/c_calls_mercury/Mmakefile:
	Add an explicit dependency to ensure that runtests makes
	the dependencies for the extra Mercury library used in
	this test case.
2001-02-05 09:35:56 +00:00
Ralph Becket
56ebf6ea18 Added a new rot13 implementation to the collection in samples/rot13.
Estimated hours taken: 0.33

Added a new rot13 implementation to the collection in samples/rot13.

samples/rot13/rot13_ralph.m:
	Added.

samples/rot13/Mmakefile:
	Added `rot13_ralph' to the list of build targets.
2001-01-31 09:22:07 +00:00
Fergus Henderson
d4dff852b0 Fix some bugs in samples/c_interface/*/Mmakefile.
Estimated hours taken: 1

Fix some bugs in samples/c_interface/*/Mmakefile.

samples/c_interface/simpler_c_calls_mercury/Mmakefile:
	Use $(mercury_lib.os) rather than hard-coding mercury_lib.o,
	so that it works if we compile mercury_lib to more than one
	object file, as we do for the `--target asm' case.

samples/c_interface/c_calls_mercury/Mmakefile:
	Pass $(ALL_GRADEFLAGS) to $(ML).
	Also use $(ALL_MLFLAGS) rather than $(MLFLAGS).
2001-01-24 13:48:12 +00:00
Fergus Henderson
ffff339217 The old version of this file had a bogus SUBDIRS list
Estimated hours taken: 3

samples/tests/Mmakefile:
	The old version of this file had a bogus SUBDIRS list
	and a lot of code duplication with Mmake.common.samples.
	I rewrote it to use Mmake.common.samples.

samples/tests/Mmake.common.samples:
	Add some documentation.
	Add some missing dependencies for the dep_local target.
	Automatically set the SUBDIRS variable to the correct value,
	rather than always setting it to empty.
	Fix a couple of other bugs (an `ifeq' should have been `ifneq'
	and in the condition of that test `$(SUBDIRS)' should have
	been `"$(SUBDIRS)"').

samples/tests/Mmake.common:
samples/tests/generate_exp:
	Delete the code for making .exp files using NU-Prolog.

samples/tests/c_interface/c_calls_mercury/Mmakefile:
samples/tests/c_interface/cplusplus_calls_mercury/Mmakefile:
	Fix a bug: add some extra dependencies to ensure that
	it copies the right files before invoking mmc to make
	the dependencies.
2000-11-19 04:14:08 +00:00
Fergus Henderson
ed4a6938f0 Fix a bug: it was passing `-O0' in MGNUCFLAGS, rather than CFLAGS.
Estimated hours taken: 0.25

samples/diff/Mmakefile:
	Fix a bug: it was passing `-O0' in MGNUCFLAGS, rather than CFLAGS.
	This broke things if you tried to pass an mgnuc option such as
	`--inline-alloc' in EXTRA_MGNUCFLAGS on the command-line.
2000-09-21 07:58:54 +00:00
Tyson Dowd
71a07917dc Update the samples to use MR_ types and MR_ macros for
Estimated hours taken: 0.5

samples/c_interface/c_calls_mercury/c_main.c:
samples/c_interface/cplusplus_calls_mercury/cpp_main.cc:
samples/c_interface/simpler_c_calls_mercury/c_main.c:
samples/c_interface/simpler_cplusplus_calls_mercury/cpp_main.cc:
	Update the samples to use MR_ types and MR_ macros for
	creating lists.
2000-08-08 06:02:55 +00:00
Fergus Henderson
0693c176a2 Delete an obsolete comment about setting `GRADEFLAGS-foo_init'
Estimated hours taken: 0.25

tests/Mmake.common:
samples/tests/Mmake.common:
	Delete an obsolete comment about setting `GRADEFLAGS-foo_init'
	(that isn't needed anymore, since Mmake handles it automatically --
	you only need to set `GRADEFLAGS-foo'.)
2000-02-16 07:30:13 +00:00
Tyson Dowd
d64781a3d7 Add a testing architecture for the samples directory.
Estimated hours taken: 15

Add a testing architecture for the samples directory.
The tests are in the "tests" subdirectory of the samples
directory.  This keeps them close to the samples, but not close
enough to clutter up the samples.
It also means you don't have to worry about the issue of exactly where
the developer has checked out the CVS tests module.

samples/c_interface/simpler_c_calls_mercury/Mmakefile:
	Update this example to generate a .a file
	instead of directly using $(mercury_lib.os)

samples/tests/*:
	Test cases for all the samples.
2000-02-14 05:28:45 +00:00
Tyson Dowd
e9ece03315 Fix some problems in the samples.
Estimated hours taken: 1

Fix some problems in the samples.

samples/calculator.m:
	Strip spaces from the input before using it.
	I keep forgetting that spaces aren't allowed in the input
	of this example, and I can only assume that new users get
	confused over this.

samples/c_interface/c_calls_mercury/Mmakefile:
	Use MLOBJS instead of MLLIBS for including .o files.
	Add a missing dependency.
	Remove an unnecessary dependency that MLOBJS takes care of.

samples/c_interface/mercury_calls_fortran/Mmakefile:
	Use MLOBJS instead of MLLIBS for including .o files.
	Use -lg2c instead of the old -lf2c for the fortran library.
	(libf2c no longer exists)
2000-02-03 05:13:11 +00:00
Fergus Henderson
65044c0731 Delete some crud at the end of this file
Estimated hours taken: 0.25

samples/solutions/some_solutions.m:
	Delete some crud at the end of this file
	that I had somehow accidentally included there
	when I committed it.
1999-12-13 16:52:10 +00:00
Fergus Henderson
36c651a26d Add a missing import of module `list'. Previous versions
Estimated hours taken: 0.5

samples/c_interface/cplusplus_calls_mercury/mercury_lib.m:
	Add a missing import of module `list'.  Previous versions
	of the Mercury compiler didn't detect this error.
1999-12-13 12:54:20 +00:00
Tyson Dowd
24e0f8bb78 Remove targets for programs that have moved into their own
Estimated hours taken: 0.1

samples/Mmakefile:
	Remove targets for programs that have moved into their own
	subdirs.
1999-12-05 12:54:40 +00:00
Fergus Henderson
02751f887e Add calls to `io__flush_output', so that the input and output
Estimated hours taken: 0.1

samples/calculator.m:
samples/eliza.m:
samples/interpreter.m:
	Add calls to `io__flush_output', so that the input and output
	are interleaved properly when you run the programs with output
	redirected to a pipe, e.g. "./calculator | tee logfile".
1999-11-04 03:16:52 +00:00
Fergus Henderson
c240ada1c6 Fix a bug in my previous change.
Estimated hours taken: 0.1

samples/calculator.m:
	Fix a bug in my previous change.
	Also change the program so that it prints a "calculator> " prompt.
1999-10-28 09:45:42 +00:00
Fergus Henderson
d0958be78b Improve the coding style: make `evalexpr'
Estimated hours taken: 0.25

samples/calculator.m:
	Improve the coding style: make `evalexpr'
	a function rather than a predicate.
1999-10-26 14:14:18 +00:00
Fergus Henderson
df867b10b7 Implement `do_while/4'.
Estimated hours taken: 2

library/std_util.m:
	Implement `do_while/4'.

samples/README:
samples/all_solutions.m:
samples/committed_choice.m:
samples/solutions/all_solutions.m:
samples/solutions/one_solution.m:
samples/solutions/some_solutions.m:
	Move the all_solutions.m and committed_choice.m samples
	into a new subdirectory `solutions', renaming committed_choice.m
	as `one_solution.m', and add a new file `some_solutions.m'
	illustrating the use of `do_while/4'.
	(Also fix some documentation rot in samples/README.)

NEWS:
	Mention the new predicate std_util__do_while/4.

tests/general/Mmakefile:
tests/general/do_while.m:
tests/general/do_while.exp:
	A test case for the new feature.
1999-10-20 03:14:35 +00:00
Thomas Conway
f953861567 Fix problems due to the changes a while back in how the
Estimated hours taken: 1

muz/*.m:
	Fix problems due to the changes a while back in how the
	higher order expressions are quantified.
1999-10-14 22:54:19 +00:00
Fergus Henderson
98b0afa001 Use clean_local' instead of clean' and `realclean_local' instead
Estimated hours taken: 0.75

Mmakefile:
*/Mmakefile:
*/*/Mmakefile:
*/*/*/Mmakefile:
	Use `clean_local' instead of `clean' and `realclean_local' instead
	of `realclean' where appropriate.  This is necessary now that
	`realclean' does not depend on `clean'.
1999-09-16 04:46:31 +00:00
Simon Taylor
79dcbbef15 User-guided type specialization.
Estimated hours taken: 60

User-guided type specialization.

compiler/prog_data.m:
compiler/prog_io_pragma.m:
compiler/modules.m:
compiler/module_qual.m:
compiler/mercury_to_mercury.m:
	Handle `:- pragma type_spec'.

compiler/prog_io_pragma.m:
	Factor out some common code to parse predicate names with arguments.

compiler/hlds_module.m:
	Added a field to the module_sub_info to hold information about
	user-requested type specializations, filled in by make_hlds.m
	and not used by anything after higher_order.m.

compiler/make_hlds.m:
	For each `:- pragma type_spec' declaration, introduce a new predicate
	which just calls the predicate to be specialized with the
	specified argument types. This forces higher_order.m to produce
	the specialized versions.

compiler/higher_order.m:
	Process the user-requested type specializations first to ensure
	that they get the correct names.
	Allow partial matches against user-specified versions, e.g.
		map__lookup(map(int, list(int)), int, list(int)) matches
		map__lookup(map(int, V), int, V).
	Perform specialization where a typeclass constraint matches a
	known instance, but the construction of the typeclass_info is
	done in the calling module.
	Give slightly more informative progress messages.

compiler/dead_proc_elim.m:
	Remove specializations for dead procedures.

compiler/prog_io_util.m:
	Change the definition of the `maybe1' and `maybe_functor' types
	to avoid the need for copying to convert between `maybe1'
	and `maybe1(generic)'.
	Changed the interface of `make_pred_name_with_context' to allow
	creation of predicate names for type specializations which describe
	the type substitution.

compiler/make_hlds.m:
compiler/prog_io_pragma.m:
	Make the specification of pragma declarations in error
	messages consistent. (There are probably some more to
	be fixed elsewhere for termination and tabling).

compiler/intermod.m:
	Write type specialization pragmas for predicates declared
	in `.opt' files.

compiler/mercury_to_mercury.m:
	Export `mercury_output_item' for use by intermod.m.

compiler/options.m:
	Add an option `--user-guided-type-specialization' enabled
	with `-O2' or higher.

compiler/handle_options.m:
	`--type-specialization' implies `--user-guided-type-specialization'.

compiler/hlds_goal.m:
	Add predicates to construct constants. These are duplicated
	in several other places, I'll fix that as a separate change.

compiler/type_util.m:
	Added functions `int_type/0', `string_type/0', `float_type/0'
	and `char_type/0' which return the builtin types.
	These are duplicated in several other places,
	I'll fix that as a separate change.

library/private_builtin.m:
	Added `instance_constraint_from_typeclass_info/3' to extract
	the typeclass_infos for a constraint on an instance declaration.
	This is useful for specializing class method calls.
	Added `thread_safe' to various `:- pragma c_code's.
	Added `:- pragma inline' declarations for `builtin_compare_*', which
	are important for user-guided type specialization. (`builtin_unify_*'
	are simple enough to go in the `.opt' files automatically).

compiler/polymorphism.m:
	`instance_constraint_from_typeclass_info/3' does not need type_infos.
	Add `instance_constraint_from_typeclass_info/3' to the
	list of `typeclass_info_manipulator's which higher_order.m
	can interpret.

NEWS:
doc/reference_manual.texi:
doc/user_guide.texi
	Document the new pragma and option.

tests/invalid/Mmakefile:
tests/invalid/type_spec.m:
tests/invalid/type_spec.err_exp:
	Test error reporting for invalid type specializations.

tests/hard_coded/Mmakefile:
tests/invalid/type_spec.m:
tests/invalid/type_spec.exp:
	Test type specialization.
1999-04-23 01:03:51 +00:00
Simon Taylor
d348b24af5 Fix an old-style `:- pragma c_code' declaration.
Estimated hours taken: 0.1

samples/c_calls_mercury/c_main_int.m:
	Fix an old-style `:- pragma c_code' declaration.

samples/c_calls_mercury/mercury_lib.m:
	Add a missing import.
1999-03-24 03:20:29 +00:00
Tyson Dowd
90ec6ff89d Add rot13 examples to the samples directory.
Estimated hours taken: 8

Add rot13 examples to the samples directory.

Note: Estimated time is time for contributors, mainly.

samples/README:
samples/c_interface/README:
	Fix the README files, they were a little inaccurate in
	describing some files and directories.
1998-11-19 06:18:23 +00:00
Fergus Henderson
5a8099255a Add Philip Dart's `muz' program,
Estimated hours taken: 0.1

samples/muz/*:
	Add Philip Dart's `muz' program,
	as an example of a program written in Mercury.
1998-11-07 05:42:46 +00:00
Fergus Henderson
dc4678527c Simplify the code a little.
Estimated hours taken: 0.1

samples/cat.m:
	Simplify the code a little.
1998-11-04 17:41:20 +00:00
Simon Taylor
869ba64018 Convert a call to copy to unsafe_promise_unique, since copy
Estimated hours taken: 0.25

samples/diff/globals.m:
	Convert a call to copy to unsafe_promise_unique, since copy
	is buggy at the moment.
1998-09-21 06:46:32 +00:00
Andrew Bromage
b3af56e8fa Modified files
Estimated hours taken: 30

Modified files
--------------

samples/diff/Mmakefile:
	Minor documentation update.

samples/diff/README:
samples/diff/TODO:
	Update stuff that's now done, do a couple of minor wording
	changes.

samples/diff/diff.m:
	Fix case of identical filenames (which implicitly assumed
	no_diff_implies_no_output).  Add new match pass, call the
	new diff algorithm.

samples/diff/diff_out.m:
	Add --cvs-merge-conflict output style.  Slight reorganisation
	of top-level predicate.  Lots of small fixes to use better
	syntax (e.g. functional style for integer maths operations).

samples/diff/difftype.m:
	Added first_mentioned_positions/3, last_mentioned_positions/3,
	add_edit/4.

samples/diff/file.m:
	Use io__read_line_as_string.

samples/diff/filter.m:
	Minor syntax/wording changes.

samples/diff/options.m:
	Update all the newly handled options.

New files
---------

samples/diff/myers.m:
	New diff algorithm.

samples/diff/match.m:
	New pass to match common lines in the files to be diffed.

Removed file
------------

samples/diff/lcss.m:
	Functionality replaced by myers.m.
1998-09-15 04:54:41 +00:00
Andrew Bromage
586c5e16c6 Implement io__read_line_as_string/{3,4}.
Estimated hours taken: 10

library/io.m:
library/io.nu.nl:
	Implement io__read_line_as_string/{3,4}.

	Also sneaked in here are some trivial whitespace fixes in some
	of the pragma c_code which did not comply with our coding
	standards (to do with type casting).

samples/cat.m:
samples/sort.m:
	Use io__read_line_as_string.

tests/general/Mmakefile:
tests/general/read_line_as_string.exp:
tests/general/read_line_as_string.m:
	Test case for io__read_line_as_string.

NEWS:
	Mention the above change.
1998-09-09 06:05:30 +00:00
Fergus Henderson
cd44fb99e9 #include "mercury_imp.h" instead of "imp.h".
Estimated hours taken: 0.25

samples/c_interface/cplusplus_calls_mercury/cpp_main.cc:
	#include "mercury_imp.h" instead of "imp.h".
1998-09-02 06:51:32 +00:00
Fergus Henderson
7d780ffe2a #include "mercury_init.h" instead of "init.h".
Estimated hours taken: 0.25

samples/c_interface/simpler_cplusplus_calls_mercury/cpp_main.cc:
	#include "mercury_init.h" instead of "init.h".
1998-09-02 06:49:19 +00:00
Fergus Henderson
1b307c24ad #include "mercury_init.h" instead of "init.h".
Estimated hours taken: 0.25

samples/c_interface/simpler_c_calls_mercury/c_main.c:
	#include "mercury_init.h" instead of "init.h".
1998-09-02 06:47:19 +00:00
Fergus Henderson
dc919accb8 Add an example of interfacing to Fortran code from Mercury.
samples/c_interface/mercury_calls_fortran/*:
	Add an example of interfacing to Fortran code from Mercury.
1998-05-19 10:13:59 +00:00
Andrew Bromage
bc0a109801 Modified files
Estimated hours taken: 30

Modified files
--------------

samples/diff/README:
	Info about this new version.  Put the existing READMEs in
	reverse order, so that they'll be in the most sensible order
	for someone reading top-down.

samples/diff/Mmakefile:
	Supply more detail about which bit of this program GCC 2.7.2
	under Digital Unix 3.2 doesn't compile properly.

samples/diff/diff.m:
	Slight reorganisation.  Accept options, remove some high
	coupling betweem diff__do_diff and lcss.m.

samples/diff/file.m:
	Add support for attaching a filename to a file.

samples/diff/lcss.m:
	Add more documentation, one slight performance improvement.
	lcss__to_diff now works on the reversed LCSS, to avoid going
	to the trouble of reversing it.

New files
---------

samples/diff/TODO:
	Meaning should be obvious.

samples/diff/diff_out.m:
	Replacement for diffs.m (which was never a very good name).
	Now contains code to display a diff in lots more output
	styles than previously supported.

samples/diff/difftype.m:
	Replacement for lcsstype.m.  Contains the type of a diff (but
	not of an lcss, which is now local to lcss.m, hence the
	renaming).

samples/diff/filter.m:
	Contains code to filter a diff before being displayed.  This
	is only required if the user specified that they didn't want
	to see part of the diff (e.g. with --ignore-blank-lines).

samples/diff/globals.m:
samples/diff/options.m:
	Support for option handling.

Removed files
-------------

samples/diff/diffs.m:
	Functionality moved to diff_out.m.

samples/diff/lcsstype.m:
	Functionality moved to difftype.m.
1998-01-13 00:52:08 +00:00
Fergus Henderson
086d75a334 New file. An example of the use of tr_store.m.
Estimated hours taken: 0.1

extras/trailed_update/samples/interpreter.m:
	New file.  An example of the use of tr_store.m.

samples/interpreter.m:
	Add pointer to extras/trailed_update/samples/interpreter.m.

extras/trailed_update/Mmakefile:
extras/trailed_update/samples/interpreter.inp:
extras/trailed_update/samples/interpreter.exp:
extras/trailed_update/samples/vqueens.exp:
	New files.  Some testing infrastructure.
1997-09-29 15:25:58 +00:00
Andrew Bromage
e72e23910e No longer GPL, now public domain.
samples/e.m:
samples/eliza.m:
	No longer GPL, now public domain.
1997-09-12 02:17:13 +00:00
Thomas Conway
8d79000cf8 Place various bits of sample code in the public domain.
Estimated hours taken: 0.1

Place various bits of sample code in the public domain.

extras/complex_numbers/samples/fft.m:
extras/graphics/samples/calc/calc.m:
extras/graphics/samples/maze/maze.m:
samples/ultra_sub.m:
	place the source in the public domain.
1997-09-11 22:08:56 +00:00