[m-rev.] java back-end fixes for private_builtin.m

Fergus Henderson fjh at cs.mu.OZ.AU
Tue May 27 16:00:06 AEST 2003


Estimated hours taken: 0.5
Branches: main

Some fixes for the Java back-end.

library/private_builtin.m:
	- Add stub definitions of the ref_1 and heap_pointer_0 classes.
	- Delete the (duplicate) Java definitions of builtin_strcmp_3_p_0()
	  and compare_error_0_p_0() in `pragma foreign_code', since these
	  are already defined using `pragma foreign_proc'.

Workspace: /home/ceres/fjh/mercury
Index: library/private_builtin.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/private_builtin.m,v
retrieving revision 1.119
diff -u -d -r1.119 private_builtin.m
--- library/private_builtin.m	14 May 2003 14:38:46 -0000	1.119
+++ library/private_builtin.m	14 May 2003 17:59:02 -0000
@@ -169,6 +169,11 @@
 "
 	Res = System::String::Compare(S1, S2);
 ").
+:- pragma foreign_proc("Java", builtin_strcmp(Res::out, S1::in, S2::in),
+	[will_not_call_mercury, promise_pure, thread_safe],
+"
+        Res = S1.compareTo(S2);
+").
 
 builtin_unify_float(F, F).
 
@@ -1260,14 +1265,14 @@
 	     return new mercury.builtin.comparison_result_0(mercury.builtin.comparison_result_0.f_greater_than);
      }
     
-    public static int builtin_strcmp_3_p_0(java.lang.String string1, java.lang.String string2)
+    public static class ref_1
      {
-        return string1.compareTo(string2);
+     	// XXX stub only
      }
-    
-    public static void compare_error_0_p_0()
+
+    public static class heap_pointer_0
      {
-	throw new java.lang.Error(""internal error in compare/3"");
+     	// XXX stub only
      }
 ").
 

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