[m-dev.] shims

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



On Fri, 12 Sep 2014, Peter Wang wrote:

> On Thu, 11 Sep 2014 17:26:04 +1000, Peter Wang <novalazy at gmail.com> wrote:
>>
>> Ideally you could update code immediately but maintain a fallback for
>> older libraries.  I don't think there is a way to do it currently, so
>> perhaps it is time for another pragma, e.g.
>>
>>     :- pragma shim(p/1, other.p/1).
>>
>>     p(X) :- ...
>
> This could not cope with predicates which just have their arguments
> reordered (hopefully a rare occurrence).

Over the past few years it's been a very common occurrence in Mercury's
standard library.  (I'll grant that those reorderings were primarily
legacy issues and that APIs built against a current version of Mercury
are unlikely to have the same sort of problems.)

Cheers,
Julien.



More information about the developers mailing list