Appreciate some help: #2

tcklnbrg at at
Mon May 25 08:54:15 AEST 1998

% Why won't this trivial code compile ( and run).

%  written in Mercury.

:- module test.
:- interface.
:- import_module io, int.

:- pred main(io__state::di, io__state::uo) is semidet.
:- pred greaterThanZero(int::in) is semidet.

:- implementation.
:- import_module std_util, int.

main --> 
	{ greaterThanZero(2) },
	io__write_string("2 is greater than zero\n\n").

greaterThanZero(I):- I > 0.

% I get the error that main needs to be det or semidet,
% but changing it returns that is needs to be the cc_multi
% why would main ever be cc_multi?

%Thanks in advance for all the help---greatly appreciated.

% Ann Tecklenburg

More information about the users mailing list