[m-rev.] For review: Allow custom functor to element mappings in term_to_xml

Julien Fischer juliensf at cs.mu.OZ.AU
Fri Dec 10 14:50:15 AEDT 2004



On Fri, 10 Dec 2004, Ian MacLarty wrote:

> > > +
> > > +	% Values of this type are passed to custom functor-to-element
> > > +	% mapping predicates to tell the predicate which functor to generate
> > > +	% an element name for if the type is a discriminated union.  If the
> > > +	% type is not a discriminated union, then not_a_du is passed to
> > > +	% the predicate when requesting an element for the type.
> > > +	%
> > > +:- type maybe_functor_info
> > > +			% The functor's name and arity.
> > > +	--->	du_functor(
> > > +			functor_name	:: string,
> > > +			functor_arity	:: int
> > > +		)
> > > +			% The type is not a discriminated union.
> > > +	;	not_a_du.
> > > +
> > Perhaps that type should be called maybe_du_functor_info?  In which case
> > I think the second constructor should just be `no'.
> >
>
> To me this would indicate that perhaps the du functor info is not available for
> some reason.  I want it to be clear that not_a_du means the type is not a
> discriminated union.
>
Fair enough.  Although in that case I prefer `none_du' to `not_a_du'.


> > > +:- pred check_types_ok(element_pred::in(element_pred),
> > > +	list(type_desc)::in, map(type_desc, unit)::in,
> > > +	map(string, type_desc)::in, dtd_generation_result::out) is det.
> > > +
> > check_types_ok is not the most meaningful name in the world.  What
> > exactly about types is it checking that is ok?  Could you please
> > either give it a more meaningful name, add a comment or preferably both.
> >
>
> 	% Check that we can reliably generate a DTD for the types in the list.
> 	% At the moment this means each type (and all the types of the arguments
> 	% of functors of the type if it's a discriminated union) must be either
> 	% be a discriminated union, an array, an int, a character, a float or a
> 	% string.
s/it's/it is/

Cheers,
Julien.
--------------------------------------------------------------------------
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