[mercury-users] undefined predicate error/1

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Mar 22 07:47:57 AEDT 2001


On 20-Mar-2001, kimbly at cybercom.net <kimbly at cybercom.net> wrote:
> I'm a beginner with mercury, and I seem to have hit a problem.
> Here's some source (this is the whole file):
> 
> :- module expr.
> 
> :- pred pop is det.
> pop :- error("Error!").
> 
> And here's what the compiler has to say:
> 
> expr.m:  1: Warning: interface for module `expr' does not export anything.
> expr.m:004: In clause for predicate `expr:pop/0':
> expr.m:004:   error: undefined predicate `error/1'.

The problem here is just that you haven't imported the module which
defines `error/1'.  `error/1' is defined in the module `require',
so you need to add

	:- import_module require.

to your source file.

Cheers,
	Fergus.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list