[m-rev.] `succeeded' vs `SUCCESS_INDICATOR'
Fergus Henderson
fjh at cs.mu.OZ.AU
Tue Nov 11 16:32:15 AEDT 2003
Currently the compiler's behaviour for semidet foreign_procs in
the .NET back-end does not match what is specified in the language
reference manual. The reference manual says it should use a variable
named `succeeded', but the compiler instead uses a variable named
`SUCCESS_INDICATOR'.
The rationale for uppercase was that the C version was a macro, but
that doesn't apply to the .NET versions. So "succeeded" is arguably
better. But I'm feeling lazy, and the following change is a little easier...
Estimated hours taken: 1
Branches: main
doc/reference_manual.texi:
Modify the documentation to match the behaviour of the compiler:
semidet foreign_procs implemented in MC++, C#, and IL return
their truth or falsity in a variable named "SUCCESS_INDICATOR",
not "succeeded".
Workspace: /home/ceres/fjh/mercury
Index: doc/reference_manual.texi
===================================================================
RCS file: /home/mercury1/repository/mercury/doc/reference_manual.texi,v
retrieving revision 1.280
diff -u -d -r1.280 reference_manual.texi
--- doc/reference_manual.texi 23 Oct 2003 02:02:22 -0000 1.280
+++ doc/reference_manual.texi 11 Nov 2003 05:27:19 -0000
@@ -6019,7 +6019,7 @@
C# code in a @code{pragma foreign_proc} declaration
for any procedure whose determinism indicates that it could fail
-must assign a value of type bool to the variable @samp{succeeded}.
+must assign a value of type bool to the variable @samp{SUCCESS_INDICATOR}.
For example:
@example
@@ -6029,18 +6029,18 @@
:- pragma foreign_proc("C#",
string__contains_char(Str::in, Ch::in),
[will_not_call_mercury, promise_pure],
- "succeeded = (Str.IndexOf(Ch) != -1);").
+ "SUCCESS_INDICATOR = (Str.IndexOf(Ch) != -1);").
@end example
@noindent
C# code for procedures whose determinism indicates that they cannot fail
-should not access @code{succeeded}.
+should not access @code{SUCCESS_INDICATOR}.
Arguments whose mode is input will have their values set by the
Mercury implementation on entry to the C# code. If the procedure
succeeds, the C# code must set the values of all output arguments
before returning. If the procedure fails, the C# code need only
-set @code{succeeded} to false.
+set @code{SUCCESS_INDICATOR} to false.
@node Using pragma foreign_decl for C#
@subsubsection Using pragma foreign_decl for C#
@@ -6194,7 +6194,7 @@
@c
@c The IL code in a @code{pragma foreign_proc} declaration
@c for any procedure whose determinism indicates that it could fail
- at c must assign a truth value to the local variable @samp{succeeded}.
+ at c must assign a truth value to the local variable @samp{SUCCESS_INDICATOR}.
@c For example:
@c
@c @example
@@ -6203,7 +6203,7 @@
@c ldloc X
@c ldloc Y
@c ceq
- at c stloc succeeded
+ at c stloc SUCCESS_INDICATOR
@c ").
@c @end example
@@ -6269,7 +6269,7 @@
MC++ code in a @code{pragma foreign_proc} declaration
for any procedure whose determinism indicates that it could fail
-must assign a value of type bool to the variable @samp{succeeded}.
+must assign a value of type bool to the variable @samp{SUCCESS_INDICATOR}.
For example:
@example
@@ -6278,18 +6278,18 @@
:- pragma foreign_proc("MC++", string__contains_char(Str::in, Ch::in),
[will_not_call_mercury, promise_pure],
- "succeeded = (Str->IndexOf(Ch) != -1);").
+ "SUCCESS_INDICATOR = (Str->IndexOf(Ch) != -1);").
@end example
@noindent
MC++ code for procedures whose determinism indicates that they cannot fail
-should not access @code{succeeded}.
+should not access @code{SUCCESS_INDICATOR}.
Arguments whose mode is input will have their values set by the
Mercury implementation on entry to the MC++ code. If the procedure
succeeds, the MC++ code must set the values of all output arguments
before returning. If the procedure fails, the MC++ code need only
-set @code{succeeded} to false.
+set @code{SUCCESS_INDICATOR} to false.
@node Using pragma foreign_decl for MC++
@subsubsection Using pragma foreign_decl for MC++
--
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