[m-dev.] proposal: extension to pragma obsolete

Peter Wang novalazy at gmail.com
Tue Sep 9 18:19:06 AEST 2014


On Tue, 9 Sep 2014 17:56:22 +1000 (EST), Julien Fischer <jfischer at opturion.com> wrote:
> 
> On Tue, 9 Sep 2014, Peter Wang wrote:
> 
> > On Tue, 9 Sep 2014 17:18:16 +1000 (EST), Julien Fischer <jfischer at opturion.com> wrote:
> >>
> >> The main question I have is what should the second argument actually be.  There
> >> are three proposals below: (1) use a string literal, (2) use a list of string
> >> literals or (3) make (some of) the functionality of the error_util library
> >> available so we can mark up the warning messages.
> >>
> >>      (1) :- pragma obsolete(bar.baz/2, "Use predicate `bar.baz_to_int'/2 instead.").
> >>      (2) :- pragma obsolete(bar.baz/2, ["Use predicate",
> >>           "`bar.baz_to_int'/2 instead"]).
> >>      (3) :- pragma obsolete(bar.baz/2, [words("Use predicate"), sym_name_and_arity("bar.baz_to_int", 2),
> >>         words("instead.")]).
> >
> > I think it's unnecessary, as a comment on the predicate declaration is
> > fine.
> 
> Experience would suggest that's the one place people never look ... ;-)

I don't see why not?  If the user doesn't already know the preferred
replacement for an obsolete predicate then the documentation is the
obvious place to look.

Peter



More information about the developers mailing list