mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-17 18:33:58 +00:00
boehm_gc/.gitignore:
Ignore .obj files
extras/xml/xml.dtd.m:
extras/xml/xml.parse.m:
Change the name of functor ('1') in the multiplicity/0 type
to one. The former name does not (yet) work with the C# grade.
samples/.gitignore:
Ignore library output and sample executables.
samples/c_interface/standalone_c/.gitignore:
Ignore mercury_lib_int output files.
samples/c_interface/standalone_c/Makefile:
chmod 0644.
samples/c_interface/.gitignore:
Ignore object files and executables.
samples/java_interface/.gitignore:
Ignore Java class files and executables.
samples/lazy_list/.gitignore:
samples/muz/.gitignore:
samples/rot13/.gitignore:
Ignore executables.
samples/rot13/rot13_concise.m:
Update call to index_det to use string.det_index.
Added comments to clarify type inference.
samples/solutions/.gitignore:
Ignore executables.
samples/solutions/all_solutions.m:
samples/solutions/n_solutions.m:
samples/solutions/one_solution.m:
samples/solutions/some_solutions.m:
chmod 0644.
samples/solver_types/.gitignore:
Ignore executables.
samples/solver_types/sudoku.m:
Output the solution in a 3x3 grid.
28 lines
857 B
Mathematica
28 lines
857 B
Mathematica
% An example module to illustrate committed choice nondeterminism in Mercury.
|
|
% There is more than one answer which is logically correct,
|
|
% but the program will only compute one of them.
|
|
% In the standard "commutative" semantics, this program should print out
|
|
% _either_
|
|
%
|
|
% Hello, World
|
|
% or
|
|
% Goodbye, World
|
|
%
|
|
% Which one it prints out is unspecified: the implementation can pick either.
|
|
%
|
|
% In the "strict sequential semantics" (enabled by the `--strict-sequential'
|
|
% option to the Mercury compiler), it is guaranteed to print "Hello, World".
|
|
|
|
% This source file is hereby placed in the public domain. -fjh (the author).
|
|
|
|
:- module one_solution.
|
|
:- interface.
|
|
:- import_module io.
|
|
|
|
:- pred main(io::di, io::uo) is cc_multi.
|
|
|
|
:- implementation.
|
|
|
|
main(!IO) :- io.write_string("Hello, world\n", !IO).
|
|
main(!IO) :- io.write_string("Goodbye, world\n", !IO).
|