[m-rev.] for review: minor reference manual fix

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Feb 12 13:23:36 AEDT 2004


Estimated hours taken: 0.5
Branches: main

doc/reference_manual.texi:
	Fix an XXX: document the effect of `pragma foreign_type' declarations
	on the C data-passing convention.

Workspace: /home/jupiter/fjh/ws-jupiter/mercury
Index: doc/reference_manual.texi
===================================================================
RCS file: /home/mercury1/repository/mercury/doc/reference_manual.texi,v
retrieving revision 1.289
diff -u -d -r1.289 reference_manual.texi
--- doc/reference_manual.texi	5 Feb 2004 08:58:16 -0000	1.289
+++ doc/reference_manual.texi	12 Feb 2004 01:57:59 -0000
@@ -7178,8 +7178,14 @@
 
 Mercury variables of type @code{int}, @code{float}, @code{char}, or
 @code{string} are passed to and from C as C variables whose type is
-given by the corresponding typedef.  Mercury variables of any other
-type are passed as a @samp{MR_Word}, which in the current implementation
+given by the corresponding typedef. 
+
+Mercury variables of a type for which there is a C @samp{pragma foreign_type}
+declaration (@pxref{Using foreign types from Mercury}) will be passed as
+the corresponding C type.
+
+Mercury variables of any other type
+are passed as a @samp{MR_Word}, which in the current implementation
 is a typedef for an unsigned type whose size is the same size as a pointer.
 (Note: it would in fact be better for each Mercury type to map to a distinct
 abstract type in C, since that would be more type-safe, and thus we may
@@ -7207,8 +7213,6 @@
 (The reason for this is that these types represent mutable state,
 and in C modifications to mutable state are done via side effects,
 rather than argument passing.)
-
- at c XXX foreign type should be documented here.
 
 @c For the Managed C++ interface, the types are mapped slightly differently:
 @c Mercury variables which are polymorphically typed

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