[mercury-users] discriminated unions in c_code
Tyson Dowd
trd at cs.mu.OZ.AU
Thu Nov 30 12:40:54 AEDT 2000
On 30-Nov-2000, Michael Day <mikeday at corplink.com.au> wrote:
>
> Is it documented anywhere how to use the various tag macros in the Mercury
> runtime and how to inspect and create discriminated unions in c_code
> predicates? If not, any tips? In particular, how to easily return a
> maybe_error type?
There isn't very good support for this.
You should consider writing this code in Mercury if possible.
You could also export functions/predicates that do this, and call them
from C (make their inputs simple types such as strings or ints).
Otherwise you have to start to concern yourself with how the compiler
will choose representations for the type.
--
Tyson Dowd #
# Surreal humour isn't everyone's cup of fur.
trd at cs.mu.oz.au #
http://www.cs.mu.oz.au/~trd #
--------------------------------------------------------------------------
mercury-users mailing list
post: mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the users
mailing list