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

Peter Ross peter.ross at miscrit.be
Thu Nov 22 23:47:09 AEDT 2001


Fergus wrote:
> On 22-Nov-2001, Peter Ross <peter.ross at miscrit.be> wrote:
> > I would propose the documentation has to change something along
these
> > lines.
> >
> > @example
> > :- pragma import(@var{Pred}(@var{Mode1}, @var{Mode2}, @dots{}),
> >                  @var{Attributes}, @var{ImportedFunction}).
> > @end example
> >
> > @var{ImportedFunction} is a term which describes how to call the
> > specified function on a particular backend.
> > For instance on the C backend: the term will be
@code{c("c_function_name")},
> > where c_function_name is then name of a C function.
> >
> > On the IL backend: the term will be something like
> > @code{il("assembly", "function", yes(return_type), [arg_one_type])},
> > where return_type and arg_one_type are the mercury type names which
are
> > declared using the foreign_type declaration.
>
> 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);

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