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

Mark Brown mark at mercurylang.org
Thu Sep 11 19:54:13 AEST 2014


On Thu, Sep 11, 2014 at 12:35 PM, Zoltan Somogyi
<zoltan.somogyi at runbox.com> wrote:
> On Wed, 10 Sep 2014 23:31:47 +1000, Mark Brown <mark at mercurylang.org> wrote:
>> If the more general case is really wanted, 'comment' and
>> 'verbose_comment' attributes could be added. For example:
>>
>> :- pragma obsolete(string.substring/3, [
>>         superseded_by(string.between/3),
>>         comment("The new string operations were introduced to help
>> provide better Unicode support."),
>>         verbose_comment("If Start + Count = End then substring(String,
>> Start, Count) = between(String, Start, End).")
>>     ]).
>
> I like this, but I would prefer one change. As you argue, I think
> there should be a second argument that expresses one of three things:
>
> (a) there is no replacement for the obsolete entity
> (b) there is a direct, semantically identical replacement for the obsolete entity
> (c) there is a direct, but semantically different replacement
>
> (b) and (c) would be accompanied by the name of the replacement.

Note also that the user may wish to list more than one potential
replacement, for (c) at least.

Cheers,
Mark.



More information about the developers mailing list