[m-users.] About append(out, in, in) for lists and strings

Xin Wang dram.wang at gmail.com
Sun Feb 5 11:57:39 AEDT 2017


2017-02-05 5:08 GMT+08:00 Zoltan Somogyi <zoltan.somogyi at runbox.com>:
> The reference manual is using append(out, in, in) as an *example*,
> showing how it *could* be implemented. It does *not* say that this
> implementation is actually used in the Mercury standard library,
> so there is no contradiction. The library's list.remove_suffix predicate
> uses the same code as the example code for append(out, in, in)
> in the manual, so the only difference between the example and
> reality is the name attached to the code. The reason for the difference
> is that append is a frequently used predicate, and it is easier for
> intermodule optimization to handle it if its definition does not use
> different code for different modes.

If "intermodule optimization" is the direct reason behind it, I think
it will be better to state that clearly in comment.

Xin


More information about the users mailing list