[m-dev.] Re: for review: --stack-trace-higher-order

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Nov 4 03:53:13 AEDT 1998


On 03-Nov-1998, Zoltan Somogyi <zs at cs.mu.OZ.AU> wrote:
> 
> > > -output_c_module_init_list(ModuleName, Modules) -->
> > > +output_c_module_init_list(ModuleName, Modules, StackLayoutLabels) -->
> > > -		% Output initialization functions, bunched into groups
> > > -		% of 40.
> > > +	{ divide_modules_on_init_status(Modules, StackLayoutLabels,
> > > +		AlwaysInitModules, MaybeInitModules) },
> > > +	{ list__chunk(AlwaysInitModules, 40, AlwaysInitModuleBunches) },
> > > +	{ list__chunk(MaybeInitModules, 40, MaybeInitModuleBunches) },
> > > +	globals__io_lookup_bool_option(split_c_files, SplitFiles),
> > 
> > > +	output_init_bunch_defs(AlwaysInitModuleBunches, ModuleName,
> > > +		"always", 0, SplitFiles),
> > 
> > The comment there was deleted, but I think it should stay.
> > If it's not completely appropriate after your changes, then please
> > replace it with a comment that is appropriate, rather than just
> > deleting it.
> 
> There is not point in comments of the form "a += 1; /* add one to a */".
> Given the calls to list__chunk, the old comment would now be of this form.

Without the comment, you have to look at the declaration of
list__chunk to see what the magic number `40' is for.
Also "Output initialization functions, bunched into groups"
is IMHO significantly clearer than calls to
`list__chunk' followed by a call to `output_init_bunch_defs'.

Therefore I think the comment is at a higher level than the
code -- I don't think it is a "/* add one to x */" type of comment.

> The "why" comment is already there, at the start of the predicate
> divide_modules_on_init_status.

That comment doesn't explain the same things that the comments you
removed did.

If the predicates `output_init_bunch_defs' or `output_init_bunch_calls'
had any documentation, then I would be less inclined to worry,
but they don't.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.



More information about the developers mailing list