[m-dev.] For review: add '..'/2 and series/3 to list.m

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Sep 27 18:46:04 AEDT 2000


On 27-Sep-2000, Ralph Becket <rbeck at microsoft.com> wrote:
> How about this...
> 
> list__series(X, OK, Succ) = [X0, X1, ..., Xn]
> where X0 = X and successive elements Xj, Xk
> a computed as Xk = Succ(Xj).  The series
> terminates as soon as an element Xi is
> generated s.t. not OK(Xi); Xi is not included
> in the output.

I think that's much better.  I suggest spelling
out "s.t." as "such that", and personally I would write
"such that OK(Xi) fails" rather than "such that not OK(Xi)".

> > > +	% Lo `..` Hi = [Lo, Lo + 1, ..., Hi]
> > > +	%
> > > +:- func int `..` int = list(int).
> > 
> > Here you should document what happens when Hi < Lo.
> 
> How about...
> 
> Lo `..` Hi = [Lo, Lo + 1, ..., Hi] if Lo =< Hi
>            = [] otherwise

That looks good.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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