Next: , Up: Interfacing with C#   [Contents]


15.10.2.1 Using pragma foreign_type for C#

A C# ‘pragma foreign_type’ declaration has the form:

:- pragma foreign_type("C#", MercuryTypeName, "C#-Type").

The C#-Type can be any accessible C# type.

The effect of this declaration is that Mercury values of type MercuryTypeName will be passed to and from C# foreign_procs as having type C#-Type.

Furthermore, any Mercury procedure exported with ‘pragma foreign_export’ will use C#-Type as the type for any parameters whose Mercury type is MercuryTypeName.