[m-rev.] diff: implement array__make_empty_array on il backend.

Fergus Henderson fjh at cs.mu.OZ.AU
Tue Dec 3 15:51:33 AEDT 2002


On 02-Dec-2002, Peter Ross <pro at missioncriticalit.com> wrote:
> Implement array__make_empty_array on the IL backend.
> 
> library/array.m:
> 	Use the null pointer to signify an empty array in
> 	array__make_empty_array.  Check for this null pointer before
> 	manipulating an array object in all the relevant places.

I think this is a bad idea.  IMHO we should represent empty arrays as
arrays of length zero, not as null pointers.  This is important for
interoperability with other languages.  Also, it's more efficient in
the common case of non-empty arrays.

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