[m-dev.] Type names in type info change

Tyson Richard DOWD trd at students.cs.mu.oz.au
Tue Feb 18 12:53:39 AEDT 1997


> 
> Estimated hours taken: 0.3
> 
> Added code to save type names in the base type info.

s/save/store

> Fixed few small bugs.

You should probably also mention that this is just for debugging.

> 
> library/std_util.m :
>         Fixed small documentation bug in expand.
> 
> runtime/deep_copy.c :
>         Fixed typo in deep_copy.
> 

These two changes are unrelated, so should probably be committed
seperately. Also, give a touch more detail on what the type and doc bugs
were.

>  			TypeArity, LayoutArg),
> -		list__append(PredAddrArgs, [LayoutArg], FinalArgs)
> +		string__format("%s/%i", [s(TypeName), i(TypeArity)], 
> +			FullTypeName),
> +		NameArg = yes(const(string_const(FullTypeName))),
> +		list__append(PredAddrArgs, [LayoutArg, NameArg], FinalArgs)
>  	;

Since the arity is already stored in the first word of the
base_type_info, is it necessary to encode it in the string as well?
If you need the name seperately, you need to split the string... 

Also, for `pred' you're going to need special case code to get the
arity right anyway. (the arity for a `pred' is stored in the type_info,
not the base_type_info).

(I realize that this might conflict with what we discussed some time
ago, but it seems in particular with the `pred' problem, that just
storing the type name in the string is better).

The rest of the change seems fine.

If it's not going to cause too much trouble with code that uses this
string, can we remove the "/Arity" ?

-- 
       Tyson Dowd           # "Most people's C code should be indented
                            #  six feet downward and covered with 
     trd at cs.mu.oz.au        #  dirt."
http://www.cs.mu.oz.au/~trd # - Blair Houghton, on C code indentation



More information about the developers mailing list