[mercury-users] User-defined Extension of builtin__copy?

Kral Stefan skral at mips.complang.tuwien.ac.at
Wed Sep 14 01:34:41 AEST 2005


Hi.

Currently working on GMP bindings for Mercury,
I am missing some way of telling the compiler
how a (unique) copy of some value (of a 
foreign type) can be created.

So, what I would like to write is something like
  :- pragma foreign_type("C", gmpint, "GMP_Int *")
	    where equality is gmpint_equals,
	          comparison is gmpint_compare,
		  copy is gmpint_copy.

I think this problem only arises if the Mercury compiler 
does not know about the internal representation of that 
particular type (ie. only for foreign types).

Is there a way to solve the problem?

Best regards,
Stefan.

-- 
Stefan Kral            http://www.complang.tuwien.ac.at/skral/

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