[m-dev.] foreign type syntax

Fergus Henderson fjh at cs.mu.OZ.AU
Mon Oct 29 19:11:35 AEDT 2001


On 29-Oct-2001, Peter Schachte <schachte at cs.mu.OZ.AU> wrote:
> On Thu, Oct 25, 2001 at 10:13:57PM +1000, Fergus Henderson wrote:
> > On 25-Oct-2001, Tyson Dowd <trd at cs.mu.OZ.AU> wrote:
> > I think it would be nicer to just use whatever syntax the foreign language
> > uses.
> 
> A few problems with this:
> 
>      o	As Tyson said, the foreign language may not have the concept of type
> 	declarations.

If the foreign language doesn't have a syntax for types, then what would
be the use of a `pragma foreign_type' declaration for that language?

(BTW, the relevant question is whether the foreign language has a concept
of, and syntax for, "types", not "type declarations".)

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

The type is going to be abstract from the Mercury side.
So I don't see why Mercury would need to make any such distinctions.

>      o The choice of language and platform does not determine the layout of
> 	the structure.

The type is going to be abstract from the Mercury side.
So I don't see why Mercury would care how it is layed out.

>      o It would be good if it were possible to somehow have a d.u. Mercury
> 	type corresponding to an ordinary foreign type.

Perhaps, but that is a separate issue.
The feature that is being proposed here is just for abstract Mercury 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