[m-rev.] for review: add lang spec to pragma import

Peter Ross peter.ross at miscrit.be
Fri Nov 23 22:23:21 AEDT 2001


On Fri, Nov 23, 2001 at 04:27:19AM +1100, Fergus Henderson wrote:
> On 22-Nov-2001, Peter Ross <peter.ross at miscrit.be> wrote:
> > Fergus wrote:
> > > For the IL and Java backends, the argument types should be determined
> > > from the Mercury type declaration.  You shouldn't need to give the types
> > > again in the `pragma import' declaration.
> >
> > :- pred load(object::in, object::out) is det.
> > 
> > has two possible interpretations in C#
> > 
> > void load(ref object);
> > 
> > and
> > 
> > void load(object, out object);
> 
> How is that different to the C interface?
> 
Good point, so that is a limitation with the C interface and I would
like to avoid it on the .NET backend.

The goal is to be able to generate the correct IL for calling the
function.  To do that you need the following information: the assembly
name, the fully qualified function name and the method signature.

Not all of this information can be deduced from the type signature so it
needs to be placed somewhere.  I want to place it in a term at the end
of the pragma import where that term is different for each backend, very
similar to what we currently or will do for pragma foreign_type.

Do you have any suggestions for another way to do this?

Pete
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list