[m-rev.] diff: foreign export bool for java

Peter Wang novalazy at gmail.com
Tue Aug 11 14:11:19 AEST 2009


Branches: main

library/bool.m:
        Export `bool' enumeration values for Java foreign code.

diff --git a/library/bool.m b/library/bool.m
index a620e98..f997bfb 100644
--- a/library/bool.m
+++ b/library/bool.m
@@ -77,6 +77,12 @@
 % The representation of bool values should correspond with the definitions of
 % MR_TRUE and MR_FALSE in runtime/mercury_std.h.
 
+:- pragma foreign_export_enum("Java", bool/0, [],
+    [
+        no  - "ML_NO",
+        yes - "ML_YES"
+    ]).
+
 :- instance enum(bool) where [
     to_int(Bool) = bool_to_int(Bool),
     from_int(bool_to_int(Bool)) = Bool

--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list