[mercury-users] unsorted_aggregate argument order

Ian MacLarty maclarty at csse.unimelb.edu.au
Fri Jan 6 11:31:34 AEDT 2012


Hi Jeff,

On Fri, Jan 6, 2012 at 10:37 AM, Jeff Thompson <jeff at thefirst.org> wrote:
> Hello.  The Library Reference for unsorted_aggregate says it is equivalent
> to:
>         % unsorted_aggregate(Generator, Accumulator, Acc0, Acc) <=>
>         %   unsorted_solutions(Generator, Solutions),
>         %   list.foldl(Accumulator, Solutions, Acc0, Acc).
>
> Does the  interface further guarantee in which order the arguments are
> passed to Accumulator?  In other words, on the first call to Accumulator, is
> it guaranteed that Acc0 will be in argument position 1 or 2?  (I can
> determine what it does now, but I'm worried about future compatibility with
> upgrades.)
>

It is guaranteed that Acc0 will be in argument position 2 of the first
call to Accumulator.  You don't know what argument 1 will be however
-- it could be any solution produced by Generator.

Ian.

--------------------------------------------------------------------------
mercury-users mailing list
Post messages to:       mercury-users at csse.unimelb.edu.au
Administrative Queries: owner-mercury-users at csse.unimelb.edu.au
Subscriptions:          mercury-users-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the users mailing list