mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-19 19:33:46 +00:00
This was a seperate repository in CVS and so it missed the conversion.
benchmarks/
As above.
26 lines
435 B
Mathematica
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).
|
|
|