Files
mercury/benchmarks/progs/ray/table.m
Paul Bone ea06fd8cde Add the benchmarks directory into the main Mercury repository.
This was a seperate repository in CVS and so it missed the conversion.

benchmarks/
    As above.
2013-01-04 12:13:53 +11:00

26 lines
435 B
Mathematica

:- module table.
:- interface.
:- import_module int, list.
:- type table(T).
:- pred table__mktable(list(T), table(T)).
:- mode table__mktable(in, out) is det.
:- pred table__lookup(table(T), int, T).
:- mode table__lookup(in, in, out) is det.
:- implementation.
:- import_module array.
:- type table(T) == array(T).
table__mktable(Ts, Table) :-
Table = array(Ts).
table__lookup(Table, I, V) :- array__lookup(Table, I, V).