[m-dev.] A change for varset and term

David Glen JEFFERY dgj at cs.mu.OZ.AU
Tue Oct 20 15:20:11 AEST 1998


On 20-Oct-1998, Thomas Charles CONWAY <conway at cs.mu.OZ.AU> wrote:
> Instead of
> 
> 	:- type varset.
> 	:- type var.
> 
> 	:- pred new_varset(varset).
> 	:- mode new_varset(out) is det.
> 	...
> 
> we have
> 
> 	:- type varset(T).
> 	:- type var(T).
> 
> 	:- pred new_varset(T, varset(T)).
> 	:- mode new_varset(in, out) is det.
> 	...

> now in the hlds we can use:
> 
> 	:- type type_var_type	--->	type_var.
> 	:- type type_var	==	var(type_var_type).
> 
> 	:- type prog_var_type	--->	prog_var.
> 	:- type prog_var	==	var(prog_var_type).


> The extension is to make the representation of varset include the given `T',
> and for `var(T)'s to include it too:
> 
> 	:- type var(T)	--->	var(int, T).

> 	:- type prog_var_type	--->	prog_var(pred_proc_id).
> 	:- type prog_var	==	var(prog_var_type).
> 

> I'd be happy to make the change if the consensus is that it's worthwhile.
> Comments?

I have 3 comments:

1. Bravo.

2. It sounds like quite a lot of work, but work that will pay for itself in the
(not so) long run. Actually, the first probably wouldn't take all that long.
The second... I haven't really thought about. It'd be nice to have the type
system catch variable renaming bugs, though. Actually, let me re-word that:
It'd be *really* nice to have the type system catch variable renaming bugs.

3. Bravo.


dgj
-- 
David Jeffery (dgj at cs.mu.oz.au) |  Marge: Did you just call everyone "chicken"?
PhD student,                    |  Homer: Noooo.  I swear on this Bible!
Department of Computer Science  |  Marge: That's not a Bible; that's a book of
University of Melbourne         |         carpet samples!
Australia                       |  Homer: Ooooh... Fuzzy.



More information about the developers mailing list