[mercury-users] undefined predicate error/1

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Mar 22 10:01:08 AEDT 2001


On 21-Mar-2001, kimbly at cybercom.net <kimbly at cybercom.net> wrote:
> 
> > The problem here is just that you haven't imported the module which
> > defines `error/1'.  `error/1' is defined in the module `require',
> 
> I figured that was it, but for some reason, "require" just didn't
> leap out at me as the module I needed when I looked through the
> list of modules :)

Yes, the name "require" is not ideal.

Originally the idea was to provide something similar to C's "assert",
but to avoid confusion with Prolog's "assert" we instead chose "require".
We put the "require" predicate in its own module, and put "error" in
the same module, since it was related to require.

In practice it turned out that "error" is used much more often than "require",
and so it would have been better to name the module "error".  Or alternatively
we could have put "error" in the "exception" or "std_util" module, or perhaps
just in the "builtin" module.  At this point backwards compatibility concerns
mean that the hassles that would result from moving it are probably not worth
it.  But if/when we design a new, non-backwards-compatible standard library,
we should reconsider this issue.

-- 
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