[m-rev.] Re: [m-dev.] for discussion: pragma foreign_import

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Dec 5 17:57:07 AEDT 2001


On 04-Dec-2001, Peter Ross <peter.ross at miscrit.be> wrote:
> On Tue, Dec 04, 2001 at 12:09:31PM +1100, Fergus Henderson wrote:
> > On 03-Dec-2001, Peter Ross <peter.ross at miscrit.be> wrote:
> > > +The interface to the function for a given Mercury procedure is
> > > +determined as follows.
> > > +Mercury types are converted to foreign types according to the rules in
> > > + at ref{Data passing conventions}.
> > > +Mercury arguments declared with input modes
> > > +are passed by value to the function.
> > > +Mercury arguments declared with output modes
> > > +are passed by reference.
> > 
> > This is really language-specific.  The section on "Data passing
> > conventions" is part of the C interface documentation and only describes
> > what happens for the C interface, not for other languages.
> > And output arguments will definitely not be passed by reference for the
> > Java interface, for example.
> > 
> > Same applies to the remainder of this section,
> > e.g. the comments about io__states not being passed
> > because I/O is done via side effects should not be
> > true for the Haskell or Clean interface.
> > 
> > The semantics need to be divided into language-specific and
> > language-independent parts.
>
> Here is a diff which does just that.
...
> reference_manual.texi:
>     Move sections on how to convert the Mercury parameter passing
>     convention to the backend parameter passing convention to each of
>     the C an IL backend subsections of the `Data passing convention'
>     section.

s/an/and/

> Index: reference_manual.texi
> ===================================================================
> RCS file: /home/mercury1/repository/mercury/doc/reference_manual.texi,v
> retrieving revision 1.229
> diff -u -r1.229 reference_manual.texi
> --- reference_manual.texi	4 Dec 2001 11:11:59 -0000	1.229
> +++ reference_manual.texi	4 Dec 2001 13:43:47 -0000
> @@ -5009,7 +5009,10 @@
>  @node Data passing conventions
>  @section Data passing conventions
>  
> -Each backend will have its own conventions for passing data.
> +For each backend,
> +we explain how to map a Mercury type to a type on the backend.
> +We also map the Mercury parameter passing convention
> +to the backend parameter passing convention.

s/backend/back-end/g

Also the conventions should be language-specific,
not back-end specific.

[... to be continued ...]

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