[m-dev.] new version of `store.m'

Fergus Henderson fjh at cs.mu.oz.au
Mon Sep 29 18:26:52 AEST 1997


Tyson Richard DOWD, you wrote:
> 
> The definition of some_store_type doesn't generate Unify, Index or
> Compare predicates, nor base_type_{layout/functors}.
> 
> Ditto for mutvar/2, ref/2 and store/1.

Fixed.  See diff below.

> I guess we haven't had any link errors because nobody has written any
> code that uses stores.

Well actually I wrote some last night, and even compiled it,
but I couldn't link it because /home/mercury was out of action.

library/store.m:
	Add definitions for types store/1, ref/2, mutvar/2, and
	some_store_type/0, to avoid link errors.
	Also add a declaration for ML_compare_type_info().

Index: /home/pgrad/fjh/mercury_sparc/library/store.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/library/store.m,v
retrieving revision 1.5
diff -u -u -r1.5 store.m
--- store.m	1997/09/26 15:01:17	1.5
+++ store.m	1997/09/29 08:17:51
@@ -200,9 +200,13 @@
 :- implementation.
 :- import_module std_util.
 
-:- type mutvar(T, S).
+:- type some_store_type ---> some_store_type.
 
-:- type store(S).
+:- type store(S) ---> store(c_pointer).
+
+:- type mutvar(T, S) ---> mutvar(c_pointer).
+
+:- type ref(T, S) ---> ref(c_pointer).
 
 :- pragma c_code(init(_S0::uo), will_not_call_mercury, "").
 
@@ -263,6 +267,9 @@
 	/* ML_arg() is defined in std_util.m */
 	bool ML_arg(Word term_type_info, Word *term, Word argument_index,
 			Word *arg_type_info, Word **argument_ptr);
+
+	/* ML_compare_type_info() is defined in std_util.m */
+	int ML_compare_type_info(Word type_info_1, Word type_info_2);
 ").
 
 :- pragma c_code(arg_ref(Ref::in, ArgNum::in, ArgRef::out, S0::di, S::uo),

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