[m-rev.] New library module: table.m
Ralph Becket
rafe at cs.mu.OZ.AU
Thu Jan 23 15:21:50 AEDT 2003
Fergus Henderson, Wednesday, 22 January 2003:
> On 22-Jan-2003, Ralph Becket <rafe at cs.mu.OZ.AU> wrote:
> > Here's the full diff:
>
> The new module should be mentioned in the NEWS file.
Done.
> > +array2d(Xss @ [Xs | _]) =
> > + ( if
> > + M = length(Xss),
> > + N = length(Xs),
> > + all [Ys] ( member(Ys, Xss) => length(Ys) = N )
> > + then
> > + array2d(M, N, array(condense(Xss)))
> > + else
> > + func_error("array2d.array2d/1: non-rectangular list of lists")
> > + ).
>
> I recommend moving the `M = length(Xss)' and `N = length(Xs)' unifications
> to outside the if-then-else.
Righto.
> > +lists_2(IJ, J, N, A, Xs, Xss) =
> > + ( if 0 =< IJ then
> > + ( if 0 =< J then
>
> I recommend writing that as `if IJ >= 0' and `if J >= 0'.
The last few years I've found it simpler to think in terms of the
numbers as a line with an arrow pointing to the right and then arrange
my inequalities such that smaller quantities always appear on the left.
Ralph
--------------------------------------------------------------------------
mercury-reviews mailing list
post: mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the reviews
mailing list