[m-rev.] [dotnet-foreign] diff: use System.Array for mercury arrays

Tyson Dowd trd at cs.mu.OZ.AU
Thu Aug 2 23:04:48 AEST 2001


> To be more specific, it should go in the type_ctor_info.
> Arrays need to be treated as a special case -- for them,
> the System.Type can't go in the type_ctor_info, since it
> differs for different array types.  So the code which gets a
> System.Type from a Mercury type_info would need to check for that case.

Right, in general this would be case for all type constructors, except that
the .NET backend only supports one type constructor.

This is becoming a big enough task that I might leave it for a
while (I have some other things to do for a bit).  Everything is pretty
easy *except* allocating arrays.  I guess I could just implement
allocating object[], and do a quick type check and throw an exception if
the element type is not compatible with object.  This would give us some
usable support for arrays, and wouldn't be too much work.

I will post my changes to the compiler, and then leave off the library
support for a little while.  For the moment if you want to use arrays in
Mercury, somebody else had better allocate them for you (e.g. write some
very simple C# to do it).

I am planning on implementing some RTTI next, so that will be a good time
to work on putting System.Type into type_ctor_infos.

Tyson.
--------------------------------------------------------------------------
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