<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 15, 2014 at 3:42 PM, Mark Brown <span dir="ltr"><<a href="mailto:mark@mercurylang.org" target="_blank">mark@mercurylang.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Mon, Sep 15, 2014 at 3:20 PM, Julien Fischer <<a href="mailto:jfischer@opturion.com">jfischer@opturion.com</a>> wrote:<br>
><br>
><br>
> On Fri, 12 Sep 2014, Peter Wang wrote:<br>
><br>
>> On Thu, 11 Sep 2014 17:26:04 +1000, Peter Wang <<a href="mailto:novalazy@gmail.com">novalazy@gmail.com</a>> wrote:<br>
>>><br>
>>><br>
>>> Ideally you could update code immediately but maintain a fallback for<br>
>>> older libraries.  I don't think there is a way to do it currently, so<br>
>>> perhaps it is time for another pragma, e.g.<br>
>>><br>
>>>     :- pragma shim(p/1, other.p/1).<br>
>>><br>
>>>     p(X) :- ...<br>
>><br>
>><br>
>> This could not cope with predicates which just have their arguments<br>
>> reordered (hopefully a rare occurrence).<br>
<br>
</span>If you require that other.p/1 not only exists, but has the same<br>
signature as p/1, then I think it will cope so long as the arguments<br>
don't have the same type.<br>
<br>
(If the signatures don't change, my proposal wouldn't cope either.)<br>
<span class=""><br>
><br>
><br>
> Over the past few years it's been a very common occurrence in Mercury's<br>
> standard library.  (I'll grant that those reorderings were primarily<br>
> legacy issues and that APIs built against a current version of Mercury<br>
> are unlikely to have the same sort of problems.)<br>
<br>
</span>In most of these cases the arguments have different types so the<br>
signature has changed, right?<br></blockquote><div><br></div><div>Pretty much.</div><div><br></div><div>Cheers,</div><div>Julien.</div></div></div></div>