[mercury-users] type_desc vs. type_info

Michael Day mikeday at yeslogic.com
Mon Oct 30 16:12:08 AEDT 2006


Hi Zoltan,

> See the comment at the top of runtime/mercury_type_desc.h in the Mercury
> implementation.

You mean this:

** Values of type `type_ctor.type_desc' are represented the same way as
** values of type `private_builtin.type_info' (this representation is
** documented in compiler/polymorphism.m). Some parts of the library
** (e.g. the gc initialization code) depend on this.
** The C type corresponding to these Mercury types is `MR_TypeInfo'.

> For now, what you are doing now will work, and is the best that can be done.
> It would break in the future if some change caused the representations of
> type_infos and type_descs to diverge, but we currently have no such plans.

Sounds fine to me.

> We could introduce a version of type_of that returned a type_info instead
> of a type_desc, which would be more future-proof. Would that satisfy your
> requirements?

I'm satisfied with the current situation; is type_info even accessible? 
I don't see any references to it in the library documentation.

Best regards,

Michael

-- 
Print XML with Prince!
http://www.princexml.com
--------------------------------------------------------------------------
mercury-users mailing list
Post messages to:       mercury-users at csse.unimelb.edu.au
Administrative Queries: owner-mercury-users at csse.unimelb.edu.au
Subscriptions:          mercury-users-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the users mailing list