Switch branches/tags
version-14_01_1 version-14_01 version-13_05_2 version-13_05_1 version-13_05 version-12_08-branchpoint version-12_08-GIT version-11_07_2 version-11_07_1 version-11_07 version-11_07-branchpoint version-11_01 version-11_01-branchpoint version-10_04_2 version-10_04_1 version-10_04 version-10_04-branchpoint version-0_13_1 version-0_13-branchpoint version-0_12_2 version-0_12_1 version-0_12-branchpoint version-0_11_0 version-0_11-branchpoint version-0_10 version-0_9_1 version-0_9 version-0_9_x-snapshot version-0_9_x-snapshot-19991220 unstable-version-0_13_1-x86_64-unknown-linux-gnu-libc2_3 unstable-version-0_13_1-i686-pc-linux-libc2_3-gnu-O5-intermod unstable-version-0_13-branch-x86_64-unknown-linux-gnu-libc2_3 unstable-version-0_13-branch-i686-pc-linux-libc2_3-gnu-O5-intermod unstable-version-0_12_2-i686-pc-linux-libc2_2-gnu-O5-intermod unstable-version-0_12_2-i386-pc-solaris2_8 unstable-version-0_12_1-i686-pc-linux-libc2_3-gnu-O4-intermod unstable-version-0_12_1-i686-pc-linux-libc2_3-gnu-O2 unstable-version-0_12_1-i686-pc-linux-libc2_2-gnu-O5-intermod unstable-version-0_12_1-i386-pc-solaris2_8 unstable-version-0_12-branch-i686-pc-linux-libc2_3-gnu-O5 unstable-version-0_12-branch-i686-pc-linux-libc2_3-gnu-O4-intermod unstable-version-0_12-branch-i686-pc-linux-libc2_3-gnu-O4-hlc unstable-version-0_12-branch-i686-pc-linux-libc2_3-gnu-O2 unstable-version-0_12-branch-i686-pc-linux-libc2_2-gnu-O5 unstable-version-0_12-branch-i686-pc-linux-libc2_2-gnu-O5-intermod unstable-version-0_12-branch-i686-pc-linux-libc2_2-gnu-O3 unstable-version-0_12-branch-i386-pc-solaris2_8 unstable-version-0_11_0-sparc-sun-solaris2_7 unstable-version-0_11_0-i686-pc-linux-libc2_3-gnu-O5-intermod unstable-version-0_11_0-i686-pc-linux-libc2_2-gnu-O5 unstable-version-0_11_0-i686-pc-linux-libc2_2-gnu-O5-lcc unstable-version-0_11_0-i686-pc-linux-libc2_2-gnu-O5-hlc unstable-version-0_11_0-i686-pc-linux-libc2_1-gnu-O4 unstable-version-0_11_0-i686-pc-linux-libc2_1-gnu-O4-asm unstable-version-0_11_0-i686-pc-linux-libc2_1-gnu-O3 unstable-version-0_11_0-i386-pc-solaris2_8 unstable-version-0_11-branch-i686-pc-linux-libc2_3-gnu-O5-intermod unstable-version-0_11-branch-i686-pc-linux-libc2_2-gnu-O5-intermod unstable-version-0_11-branch-i686-pc-linux-libc2_2-gnu-O5-hlc unstable-version-0_11-branch-i686-pc-linux-libc2_1-gnu-O5 unstable-version-0_11-branch-i686-pc-linux-libc2_1-gnu-O5-lcc unstable-version-0_11-branch-i686-pc-linux-libc2_1-gnu-O5-intermod unstable-version-0_11-branch-i686-pc-linux-libc2_1-gnu-O5-hlc unstable-version-0_11-branch-alpha-dec-osf5_1 unstable-version-0_10_y-sparc-sun-solaris2_7 unstable-version-0_10_y-i686-pc-linux-libc2_1-gnu-O5 unstable-version-0_10_y-i686-pc-linux-libc2_1-gnu-O5-lcc unstable-version-0_10_y-i686-pc-linux-libc2_1-gnu-O5-intermod unstable-version-0_10_y-i686-pc-linux-libc2_1-gnu-O5-hlc unstable-version-0_10_y-i686-pc-linux-libc2_1-gnu-O4 unstable-version-0_10_y-i686-pc-linux-libc2_1-gnu-O4-hlc unstable-version-0_10_y-i686-pc-linux-libc2_1-gnu-O2 unstable-version-0_10_y-i586-pc-linux-libc2_1-gnu-O0 unstable-version-0_10_y-alpha-dec-osf5_1 unstable-version-0_10_y-alpha-dec-osf3_2 unstable-version-0_10_x-sparc-sun-solaris2_7 unstable-version-0_10_x-i686-pc-linux-libc2_1-gnu-O5 unstable-version-0_10_x-i686-pc-linux-libc2_1-gnu-O5-lcc unstable-version-0_10_x-i686-pc-linux-libc2_1-gnu-O4 unstable-version-0_10_x-i686-pc-linux-libc2_1-gnu-O4-hlc unstable-version-0_10_x-i686-pc-linux-libc2_1-gnu-O3 unstable-version-0_10_x-i686-pc-linux-libc2_1-gnu-O2 unstable-version-0_10_x-i586-pc-linux-libc2_1-gnu-O0 unstable-version-0_10_x-alpha-dec-osf3_2 termination2_trunk stable-version-0_11_0-i686-pc-linux-libc2_3-gnu-O5-intermod stable-version-0_11_0-i686-pc-linux-libc2_2-gnu-O5 stable-version-0_11_0-i686-pc-linux-libc2_2-gnu-O5-lcc stable-version-0_11_0-i686-pc-linux-libc2_2-gnu-O5-hlc stable-version-0_11_0-i686-pc-linux-libc2_1-gnu-O4 stable-version-0_11_0-i686-pc-linux-libc2_1-gnu-O4-asm stable-version-0_11_0-i686-pc-linux-libc2_1-gnu-O3 stable-version-0_11-branch-i686-pc-linux-libc2_3-gnu-O5-intermod stable-version-0_11-branch-i686-pc-linux-libc2_2-gnu-O5-lcc stable-version-0_11-branch-i686-pc-linux-libc2_2-gnu-O5-intermod stable-version-0_11-branch-i686-pc-linux-libc2_1-gnu-O5 stable-version-0_11-branch-i686-pc-linux-libc2_1-gnu-O5-lcc stable-version-0_11-branch-i686-pc-linux-libc2_1-gnu-O5-intermod stable-version-0_11-branch-i686-pc-linux-libc2_1-gnu-O5-hlc stable-version-0_11-branch-alpha-dec-osf5_1
Nothing to show
Find file History
Latest commit e6e295a Apr 22, 2017 @juliensf juliensf Generalise the representation of integers in the term module.
In preparation for supporting uint literals and literals for the fixed size
integer types, generalise the representation of integers in the term module, so
that for every integer literal we record its base, value (as an arbitrary
precision integer), signedness and size (the latter two based on the literal's
suffix or lack thereof).

Have the lexer attach information about the integer base to machine sized ints;
we already did this for the 'big_integer' alternative but not the normal one.
In conjunction with the first change, this fixes a problem where the compiler
was accepting non-decimal integers in like arity specifications.  (The
resulting error messages could be improved, but that's a separate change.)

Support uints in more places; mark other places which require further work with

     Generalise the representation of integer terms so that we can store
     the base, signedness and size of a integer along with its value.
     In the new design the value is always stored as an arbitrary precision
     integer so we no longer require the big_integer/2 alternative; delete it.

     Add some utility predicates that make it easier to work with integer terms.

     Conform to the above changes,

     Add missing handling for uints in some spots; add XXX UINT comments
     in others -- these will be addressed later.

     Record the base of word sized integer literals.

    Conform to the above changes.

    Update these expected outputs.
Failed to load latest commit information.
appengine Tell vim not to expand tabs in Makefiles. Jan 8, 2015
c_interface Remove .cvsignore files Apr 4, 2017
concurrency Update concurrency samples. Oct 2, 2016
diff Remove .cvsignore files Apr 4, 2017
java_interface Minor fixes for the Java interface examples. Feb 9, 2016
lazy_list Fix samples/rot13_concise + libxml compilation error Mar 11, 2014
muz Fix compilation errors in samples, extras and benchmarks. Jan 13, 2016
rot13 Tell vim not to expand tabs in Makefiles. Jan 8, 2015
solutions Fix samples/rot13_concise + libxml compilation error Mar 11, 2014
solver_types Fix formatting in solve_types sample. Dec 16, 2015
tests Tell vim not to expand tabs in Makefiles. Jan 8, 2015
.gitignore Remove .cvsignore files Apr 4, 2017
.nocopyright Add examples of Mercury/Java integration. Jul 7, 2010
Mmakefile Fix formatting of sample programs. Dec 14, 2015
README Move lazy list eample code from extras/ to samples/ Aug 29, 2011
beer.m Fix formatting of sample programs. Dec 14, 2015
calculator.m Branches: master, 13.05. Jul 26, 2013
calculator2.m Generalise the representation of integers in the term module. Apr 22, 2017
cat.m Fix formatting of sample programs. Dec 14, 2015
e.m Fix omissions in the char module. Aug 30, 2015
eliza.m Fix formatting of sample programs. Dec 14, 2015
expand_terms.m Fix formatting of sample programs. Dec 14, 2015
hello.m Fix some violations of good style in the sample programs. Aug 12, 2005
interpreter.m Update the programming style of this program. Feb 10, 2016
sort.m Fix formatting of sample programs. Dec 14, 2015
ultra_sub.m Fix formatting of sample programs. Dec 14, 2015


This directory contains some example Mercury programs.

hello.m			"Hello World" in Mercury.

cat.m                   An implementation of a simple version of the
			standard UNIX filter `cat', which just copies
			its input files or the standard input stream to
			the standard output stream.

sort.m                  An implementation of a simple version of the
			standard UNIX filter `sort', which reads lines
			from its input files or the standard input
			stream, sorts them, and then writes the result
			to the standard output stream.

calculator.m            A simple four-function arithmetic calculator,
			with a parser written using the Definite Clause
			Grammar notation.

calculator2.m		A simple four-function arithmetic calculator,
			which uses the parser module in the standard
			library with a user-defined operator precedence

interpreter.m		An simple interpreter for definite logic programs.
			A demonstration of meta-programming in Mercury.

expand_terms.m		Another example meta-program, showing how to
			emulate Prolog's `expand_term' mechanism.

e.m			A small program which calculates the base of
			natural logarithms to however many digits you
			choose.  It illustrates one way to achieve
			lazy evaluation in Mercury.

Mmakefile		The file used by `mmake', the Mercury Make program,
			to build the programs in this directory.

The `solutions' sub-directory contains some examples of the use of
nondeterminism, showing how a Mercury program can compute 
	- one solution,
	- all solutions, or
	- some solutions (determined by a user-specified criteria)
for a query which has more than one logically correct answer.

The `concurrency' sub-directory contains examples of how to use Mercury's
concurrency interface, i.e. using threads in Mercury programs.

There are also some sub-directories which contain examples of multi-module
Mercury programs:

appengine               A simple Google App Engine servlet.

diff                    This directory contains an implementation of a
			simple version of the standard UNIX utility
			`diff', which prints the differences between
			two files.

c_interface		This directory contains some examples of mixed
			Mercury/C/C++/Fortran programs using the C interface.

java_interface		This directory contains some examples of mixed
			Mercury/Java programs using the foreign language

rot13			This directory contains a few implementations of
			rot-13 encoding.

muz			This directory contains a syntax checker / type checker
			for the specification language Z.

solver_types		This directory contains an example solver type
			implementation and some sample applications.

lazy_list		This directory contains an example of the lazy module
			can be used to implement lazy data structures, in this
			case a lazy list.