[mercury-users] Solver types and foreign code

Ralph Becket rafe at cs.mu.OZ.AU
Thu Aug 18 17:42:54 AEST 2005


Peter Hawkins, Thursday, 18 August 2005:
> Hi...
> 
> If I pass a solver type to or from a foreign procedure, is that the same 
> as passing the representation type? For example if I have a solver type 
> with an 'int' representation, can I just return values of that solver 
> type by returning ints without calling 'representation to ... 
> solver_type/0'?

All the solver type declaration does is construct the 'representation to
...' casting functions.  The casting functions are operationally just
identities and will be optimized away.

If your interface predicates are written in a foreign language, there
is no need to also go through the pantomime of representation casts:
you can just assert in the declarations that their outputs have with the
right types and insts.

-- Ralph
--------------------------------------------------------------------------
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