array.m: remove type_to_term and term_to_type

Fergus Henderson fjh at cs.mu.oz.au
Sat Jul 26 19:59:54 AEST 1997


library/array.m:
	Remove definitions for type_to_term and term_to_type for arrays.
	That is now done in term.m.

Index: array.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/library/array.m,v
retrieving revision 1.32
diff -u -r1.32 array.m
--- array.m	1997/07/25 05:14:11	1.32
+++ array.m	1997/07/26 09:58:21
@@ -200,16 +200,6 @@
 :- pred array_compare(comparison_result, array(T), array(T)).
 :- mode array_compare(out, in, in) is det.
 
-	% type_to_term/2 for arrays
-
-:- pred array_to_term(array(T), term).
-:- mode array_to_term(in, out) is det.
-
-	% term_to_type/2 for arrays
-
-:- pred array_from_term(term, array(T)).
-:- mode array_from_term(in, out) is semidet.
-
 %-----------------------------------------------------------------------------%
 
 :- implementation.
@@ -240,8 +230,6 @@
 Define_extern_entry(mercury____Unify___array__array_1_0);
 Define_extern_entry(mercury____Index___array__array_1_0);
 Define_extern_entry(mercury____Compare___array__array_1_0);
-Define_extern_entry(mercury____TermToType___array__array_1_0);
-Define_extern_entry(mercury____TypeToTerm___array__array_1_0);
 
 #ifdef  USE_TYPE_LAYOUT
 
@@ -262,15 +250,11 @@
 
 Declare_entry(mercury__array__array_equal_2_0);
 Declare_entry(mercury__array__array_compare_3_0);
-Declare_entry(mercury__array__array_to_term_2_0);
-Declare_entry(mercury__array__array_from_term_2_0);
 
 BEGIN_MODULE(array_module)
 	init_entry(mercury____Unify___array__array_1_0);
 	init_entry(mercury____Index___array__array_1_0);
 	init_entry(mercury____Compare___array__array_1_0);
-	init_entry(mercury____TermToType___array__array_1_0);
-	init_entry(mercury____TypeToTerm___array__array_1_0);
 BEGIN_CODE
 
 Define_entry(mercury____Unify___array__array_1_0);
@@ -287,16 +271,6 @@
 	tailcall(ENTRY(mercury__array__array_compare_3_0),
 		ENTRY(mercury____Compare___array__array_1_0));
 
-Define_entry(mercury____TermToType___array__array_1_0);
-	/* this is implemented in Mercury, not hand-coded low-level C */
-	tailcall(ENTRY(mercury__array__array_from_term_2_0),
-		ENTRY(mercury____TermToType___array__array_1_0));
-
-Define_entry(mercury____TypeToTerm___array__array_1_0);
-	/* this is implemented in Mercury, not hand-coded low-level C */
-	tailcall(ENTRY(mercury__array__array_to_term_2_0),
-		ENTRY(mercury____TypeToTerm___array__array_1_0));
-
 END_MODULE
 
 /* Ensure that the initialization code for the above module gets run. */
@@ -364,23 +338,6 @@
 			Result = ElemResult
 		)
 	).
-
-
-	% type_to_term for arrays
-
-array_to_term(Array, Term) :-
-	array__to_list(Array, List),
-	type_to_term(List, ListTerm),
-	term__context_init(Context),
-	Term = term__functor(term__atom("array"), [ListTerm], Context).
-
-
-	% term_to_type for arrays
-
-array_from_term(Term, Array) :-
-	Term = term__functor(term__atom("array"), [ListTerm], _),
-	term_to_type(ListTerm, List),
-	array__from_list(List, Array).
 
 %-----------------------------------------------------------------------------%
 

-- 
Fergus Henderson <fjh at cs.mu.oz.au>   |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>   |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3         |     -- the last words of T. S. Garp.



More information about the developers mailing list