[m-rev.] diff/for review: step 1 of fixing eliminating type_info/1's argument

Zoltan Somogyi zs at cs.mu.OZ.AU
Wed Sep 21 01:41:24 AEST 2005


On 20-Sep-2005, Mark Brown <mark at cs.mu.OZ.AU> wrote:
> You should add a comment near these new definitions 
> explaining that the types
> of type_infos, etc, are duplicated temporarily for bootstrapping purposes.

They won't be there long enough for such comments to be useful. I have
already bootstrapped step 2 of this change. I will commit that as soon
as possible after all our machines have installed step 1.

> This predicate can probably be deleted and replaced with a constant
> function in type_util.m (but it's not that important to do it now).

I'll look into that.

> >  polymorphism__type_is_type_info_or_ctor_type(TypeInfoType) :-
> >  	type_to_ctor_and_args(TypeInfoType,
> > -		qualified(mercury_private_builtin_module, TypeName) - 1,
> > -		[_Type]),
> > -	( TypeName = "type_info" ; TypeName = "type_ctor_info" ).
> > +		qualified(mercury_private_builtin_module, TypeName) - Arity,
> > +		Args),
> > +	( TypeName = "type_info", Args = [_], Arity = 1
> > +	; TypeName = "type_ctor_info", Args = [_], Arity = 1
> > +	; TypeName = "zero_type_info", Args = [], Arity = 0
> > +	; TypeName = "zero_type_ctor_info", Args = [], Arity = 0
> > +	).
> 
> The (redundant) test of Args here can be ommitted to make the code a bit
> shorter and slightly more efficient.

The redundant tests are deleted by step 2.

> >  polymorphism__build_type_info_type(Type, TypeInfoType) :-
> > +	% XXX TypeInfoType = type_ctor_info_type.
> >  	( type_has_variable_arity_ctor(Type, _, _) ->
> >  		% We cannot use a plain type_ctor_info because we need to
> >  		% record the arity.
> 
> Could you expand on that XXX comment, please?

It means "try to replace the body of this predicate with the XXX code".
I'll fix the XXX when I commit step 2 or 3.

Zoltan.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list