[m-dev.] foreign type syntax

Fergus Henderson fjh at cs.mu.OZ.AU
Tue Oct 30 20:07:02 AEDT 2001


On 30-Oct-2001, Peter Schachte <schachte at cs.mu.OZ.AU> wrote:
> On Mon, Oct 29, 2001 at 07:11:35PM +1100, Fergus Henderson wrote:
> > On 29-Oct-2001, Peter Schachte <schachte at cs.mu.OZ.AU> wrote:
> > >      o	The foreign language may not make the same distinctions Mercury
> > > 	wants to, such as between a pointer to a thing and a pointer to an
> > > 	array of things.
> 
> Completely abstract, with no generated accessor functions or constructors?

Not generated by the `pragma foreign_type' declaration, no.

But you can write such accessor functions and constructor functions
separately yourself, using `pragma foreign_proc'.

I think the idea for the .NET back-end (and presumably for the Java
back-end too) is to have a tool which processes binary .NET components,
reads in the meta-data for those components, and uses it to generate
a Mercury module containing appropriate interfacing declarations.
The code generated by this tool would include both `pragma foreign_type'
declarations for the foreign types and the `pragma foreign_proc'
declarations for accessor functions for those types.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  | "... it seems to me that 15 years of
The University of Melbourne         | email is plenty for one lifetime."
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- Prof. Donald E. Knuth
--------------------------------------------------------------------------
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