[m-dev.] trivial diff: define `int:is/2' in Mercury

Peter Schachte schachte at cs.mu.OZ.AU
Tue Mar 23 08:38:22 AEDT 1999


On Mon, Mar 22, 1999 at 10:50:08PM +1100, Fergus Henderson wrote:
> Ideally it ought to be defined in prolog.m rather than int.m.
> But unfortunately there isn't any simple way of moving a predicate
> from one module to another module in a backwards-compatible way;
> `pragma obsolete' isn't quite enough in this case.

In this case, I'd think you could just move it.  It's unlikely people
are explicitly module qualifying calls to this predicate.  The only
problem would be for people who don't already use prolog.m, for them,
is/2 would just disappear, and they'd have to read the NEWS file to
understand why.  Is that the problem?

Ok, `pragma obsolete' isn't right; you could add a `pragma moved', but
maybe it would be better to generalize it to something like

	:- pragma use_warning is/2 = 
		"This predicate has moved to the `prolog' module.".

This could also be useful to tell people that a whole module is
obsolete, eg:

	:- pragma use_warning
		"This module is obsolete; use module `foo' instead.".

It also generalizes a bit further, if you're so inclined, to allow
simple announcements and error messages, eg:

	:- pragma use_error is/2 = 
		"This predicate has moved to the `prolog' module.".

and

	:- pragma use_announcement
		"Module `fred' (c) 1999 Fred, inc.".

Come to think of it, that one would get pretty annoying, so maybe the
announcement variation wouldn't be a good idea.


-- 
Peter Schachte                     Intellectual brilliance is no guarantee
mailto:schachte at cs.mu.OZ.AU        against being dead wrong.
http://www.cs.mu.oz.au/~schachte/      -- David Fasold 
PGP: finger schachte at 128.250.37.3  



More information about the developers mailing list