[m-rev.] java type class support

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Feb 20 18:38:07 AEDT 2004


On 20-Feb-2004, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> library/private_builtin.m:
> 	Provide Java implementations of the typeclass-related builtins.
> 
> tests/hard_coded/typeclasses/Mmakefile:
> 	Enable some of the tests in this directory for grade java,
> 	since they now pass.
> 
> tests/hard_coded/typeclasses/impure_methods.m:
> 	Provide Java foreign_proc clauses, to match the C# ones.

I forgot to include this one, which should have been part of
the change above.

Estimated hours taken: 0.25
Branches: main

java/runtime/TypeClassConstraint.java:
	Add a new constructor which takes a PseudoTypeInfo[] array, and
	also a variant which takes an Object[] array.  These are needed
	because the compiler sometimes generates calls to them.

Workspace: /home/jupiter/fjh/ws-jupiter/mercury
Index: java/runtime/TypeClassConstraint.java
===================================================================
RCS file: /home/mercury1/repository/mercury/java/runtime/TypeClassConstraint.java,v
retrieving revision 1.1
diff -u -d -r1.1 TypeClassConstraint.java
--- java/runtime/TypeClassConstraint.java	9 Feb 2004 11:54:51 -0000	1.1
+++ java/runtime/TypeClassConstraint.java	20 Feb 2004 01:52:59 -0000
@@ -20,6 +20,26 @@
 	}
 
 	public TypeClassConstraint(TypeClassDeclStruct type_class,
+		PseudoTypeInfo[] ptis)
+	{
+		tc_constr_type_class = type_class;
+		tc_constr_arg_ptis = ptis;
+	}
+
+	public TypeClassConstraint(TypeClassDeclStruct type_class,
+		// XXX Object[] should be mercury.runtime.PseudoTypeInfo[],
+		//     but mlds_to_java.m generates Object[] since
+		//     init_array/1 doesn't give type info
+		Object[] ptis)
+	{
+		tc_constr_type_class = type_class;
+		tc_constr_arg_ptis = new PseudoTypeInfo[ptis.length];
+		for (int i = 0; i < ptis.length; i++) {
+			tc_constr_arg_ptis[i] = (PseudoTypeInfo) ptis[i];
+		}
+	}
+
+	public TypeClassConstraint(TypeClassDeclStruct type_class,
 		PseudoTypeInfo pti1)
 	{
 		tc_constr_type_class = type_class;
-- 
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