[m-dev.] Problem with new operators

Ralph Becket rafe at cs.mu.OZ.AU
Mon Oct 28 17:36:38 AEDT 2002


I'm having trouble getting the compiler to recognise the term
comparison operators @< etc. that I've just moved from prolog.m to
builtin.m.

When I compile the following with the local version of the compiler
(using `mymmc')

%-----------------------------------------------------------------------------%
% foo.m
% Ralph Becket <rafe at cs.mu.oz.au>
% Tue Oct 22 14:05:57 EST 2002
% vim: ft=mercury ff=unix ts=4 sw=4 et wm=0 tw=0
%
%-----------------------------------------------------------------------------%

:- module foo.

:- interface.

:- func max2(T, T) = T.

:- func max3(T, T, T) = T.

%-----------------------------------------------------------------------------%
%-----------------------------------------------------------------------------%

:- implementation.

%-----------------------------------------------------------------------------%

max2(X, Y) =
    ( if   X @< Y
      then Y
      else X
    ).

%-----------------------------------------------------------------------------%

max3(X, Y, Z) =
    ( if   X @< Y
      then ( if Y @< Z then Z else Y )
      else ( if X @< Z then Z else X )
    ).

%-----------------------------------------------------------------------------%
%-----------------------------------------------------------------------------%

I get errors like

foo.m:025: In clause for function `foo:max2/2':
foo.m:025:   error: undefined predicate `@</2'.

Is there something more extending builtin.m than just adding clauses and
declarations therein?

I've been doing `mmake depend; mmake' etc. for an hour now and still
haven't got it to recognise @<.

Cheers,

Ralph
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list