[m-dev.] Mercury tags in C (was: tests in tests/debugger/declarative failed)

Warwick Harvey wharvey at cs.monash.edu.au
Wed Feb 16 12:21:37 AEDT 2000


Fergus wrote:
> On 15-Feb-2000, Mark Anthony BROWN <dougl at cs.mu.OZ.AU> wrote:
> > That problem is caused by some macros in trace/mercury_trace_declarative.h
> > which access Mercury data, using fixed numbers for the tag
> > and offset.  The fixed numbers are not correct for those grades.
> > What is the best way to calculate the correct tag and offset
> > in any grade?
> 
> [summarizing a discussion we had on this:]
> 
> - Actually the tag numbers are currently the same in all grades;
>   they differ depending on the number of tag bits available,
>   which depends on the architecture (32- or 64-bit).

Just for the record, this is not true for the HAL version of Mercury.  In 
`.rt' (reserve tag) grades, a tag is reserved for representing unbound 
variables, which as a consequence also means enumeration types are 
represented using the same format as discriminated union types and there are 
no `no tag' types.

So far the only types I've discovered which use hard-coded tags in C are 
`list/1' and `comparison_result' (found just yesterday :-).  It looks like 
there are some more in `trace/mercury_trace_declarative.h', which should be 
straightforward to fix now that I know about them.  Can anybody think of any 
others off the top of their head?

Thanks,
Warwick

--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list