[m-dev.] for review: counter.m

Zoltan Somogyi zs at cs.mu.OZ.AU
Fri Mar 10 18:40:30 AEDT 2000


On 09-Mar-2000, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> That looks good.  You should mention this in the NEWS file.

Done.

> > +	% counter_init(N, Counter) returns a counter whose first allocation
> > +	% will be the integer N.
> > +:- pred counter__init(int::in, counter::out) is det.
> 
> It would probably be better to make that a function rather than
> a predicate.  Or alternatively, if you want consistency with the
> rest of the library, you could define both.

The allocate predicate cannot usefully be made into a function, since it
returns two items. As long as that is the case, making counter__init into
a function would not feel right.

I agree that making counter polymorphic wouldn't buy enough to justify the
costs.

Zoltan.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list