[m-rev.] Version types for review
Julien Fischer
juliensf at cs.mu.OZ.AU
Fri Sep 3 16:59:11 AEST 2004
On Fri, 3 Sep 2004, Ralph Becket wrote:
> > > % version_array(Xs) returns an array constructed from the items in the list
> > > % Xs.
> > > %
> > > :- func version_array(list(T)) = version_array(T).
> > >
> > I think for consistency with the rest of the standard library
> > you should probably call this from_list or at least provide
> > a synonym called from_list.
>
> That's a bad convention, IMHO, and one that is not consistently applied.
> Note that we have array.array(list(T)) = array(T) in array.m, so this is
> consistent with what we have after all :-)
>
We also have array.from_list/2 in the array module. As well
as bag.from_list, cord.from_list and a few others. As to the
convention not being consistently applied it probably should be.
> > > % list(A) = Xs where Xs is the list of items in A
> > > % (i.e. A = version_array(Xs)).
> > > %
> > > :- func list(version_array(T)) = list(T).
> > >
> > It would be more consistent with the standard library if this function
> > were called to_list.
>
> I really don't like the idea of prefixing "type casts" with `to_'.
>
You can still keep this one but I think you should provide a `to_'
as a synonym.
Julien.
--------------------------------------------------------------------------
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