[m-dev.] :- external directive

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Dec 11 10:25:26 AEDT 2003


On 11-Dec-2003, Simon Taylor <stayl at cs.mu.OZ.AU> wrote:
> On 10-Dec-2003, James Goddard <goddardjames at yahoo.com> wrote:
> > Can anyone explain to me what the "external" directive
> > does in the following code fragment?
...
> > :- external(unify/2).
> > :- external(compare/3).
> > :- external(compare_representation/3).
> 
> It means that these predicates are defined elsewhere (in this case
> in runtime/mercury_ho_call.c

... for the C backend, and in C# `pragma foreign_code' at builtin.m:545 for
the .NET backend,

	public static bool unify_2_p(object[] ti, object X, object Y) 
	{
		return mercury.builtin.mercury_code.call_rtti_generic_unify_2_p(
				ti, X, Y);
	}

and in Java `pragma foreign_code' at builtin.m:716 for the Java backend.

	public static boolean
	unify_2_p_0 (mercury.runtime.TypeInfo_Struct ti,
		     java.lang.Object x, java.lang.Object y)
	{
		// stub only
		throw new java.lang.Error (""unify/3 not implemented"");
	}

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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