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

Julien Fischer jfischer at opturion.com
Mon Sep 15 15:24:53 AEST 2014


On Thu, 11 Sep 2014, Mark Brown wrote:

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

That is precisely the situation that is now present in the standard
library's char module (after commit 696829e6c1cafe86ece8091e36f54f60bcb63076).

Cheers,
Julien.



More information about the developers mailing list