[m-rev.] for review: Make cord foldl tail-recursive.

Julien Fischer jfischer at opturion.com
Wed Jan 15 13:42:39 AEDT 2014


On Wed, 15 Jan 2014, Peter Wang wrote:

> Make cord.foldl and cord.foldl_pred tail-recursive.  This may be
> expected by users as cords are often used as a replacement for lists.
>
> Also make the recursive calls in cord.foldr and cord.foldr_pred amenable
> to last call optimisation.  However, they still use stack space
> proportional to the size of the input due to calling list.foldr.
>
> library/cord.m:
>    As above.
>
> tests/hard_coded/test_cord2.m:
> tests/hard_coded/test_cord2.exp:
>    Add tests for fold order.
>
> NEWS:
>    Announce the change.


That looks fine.

Cheers,
Julien.



More information about the reviews mailing list