[m-dev.] cvs diff: Bug fix for layoutst

Tyson Richard DOWD trd at students.cs.mu.oz.au
Thu Mar 20 13:58:49 AEDT 1997


> 
> Tyson Richard DOWD, you wrote:
> > 
> > > I have been using the name `type_of' for the following function:
> > > 
> > > 	:- type (type).
> > > 		% `type' is another name for `type_info(T)'.
> > > 		% ... some low-level magic to implement unification (etc.)
> > > 		% of values of type `type' omitted ...
> > > 
> > > 		% type_of(X) = T iff T is the type of X.
> > > 	:- func type_of(T::unused) = ((type)::out) is det.
> > > 	:- pragma c_code(type_of(_X::unused) = (Type::out),
> > > 			will_not_call_mercury, "Type = TypeInfo_for_T;").
> > 
> > Then you've changed your names slightly from when you asked for this to
> > be implemented - you used type_info, not type. Otherwise it is much
> > the same.
> 
> OK, good.  The name type_info/0 is fine.
> 
> > The c_code basically does what you ask, but will also need to check for
> > `univ' and give an error or something, (you can't do anything with a
> > univ without some data),
> 
> Uh, why not?

Ok, I'm a little confused about the place of univ in schemes like this.

For example:

:- type foo ---> foo(univ).

	type_to_univ(4, Univ),
	type_to_univ('a', Univ2),

Does type_of(foo(Univ)) = type_of(foo(Univ2))?
Does type_of(Univ) = type_of(Univ2)?

-- 
       Tyson Dowd           # "Well, let's just say, 'if your VCR is
                            #  still blinking 12:00, you don't
     trd at cs.mu.oz.au        #  want Linux'". 
http://www.cs.mu.oz.au/~trd #  --Bruce Perens, Debian's Fearless Leader



More information about the developers mailing list