[mercury-users] Circular lists

Fergus Henderson fjh at cs.mu.oz.au
Thu Nov 27 16:31:25 AEDT 1997


Thomas Charles CONWAY wrote:
> :- type chain(T)
> 	--->	chain(
> 			store(some_store_type),
> 			mutvar(elem(T), some_store_type)
> 		).

That should be

	:- type chain(T, S)
		--->	chain(
				store(S),
				mutvar(elem(T), S)
			).

and similarly elsewhere.

As explained in the documentation for store.m, the idea is that the
`some_store_type' type used in the definition of store__init will
eventually (when Mercury's type system supports existential types)
be replaced by a proper existential type `some [S] S'.  If you
use `some_store_type' explicitly, then your code will break when
that happens.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>   WWW: <http://www.cs.mu.oz.au/~fjh>  
Note: due to some buggy software and a (probably accidental)
denial-of-service attack, any mail sent to me between
	Tue Nov 25 20:00:00 UTC (6am Wed, local time)
and	Wed Nov 26 06:00:00 UTC (4pm, local time)
may have gone into the bit-bucket.  Please re-send it.



More information about the users mailing list