[m-rev.] for review: add lang spec to pragma import
Fergus Henderson
fjh at cs.mu.OZ.AU
Mon Nov 26 17:33:09 AEDT 2001
On 23-Nov-2001, Peter Ross <peter.ross at miscrit.be> wrote:
> 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?
One way to solve it would be to adopt the same kind of approach as with
`foreign_type', for which the issues are very similar.
That would mean writing the name of the entity to import
by giving its full signature in ILASM syntax.
--
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-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