[m-dev.] for review: cleanup of type_ctor_infos, part 0

Mark Anthony BROWN dougl at cs.mu.OZ.AU
Mon Feb 28 13:26:28 AEDT 2000


Tyson Dowd writes:
>
> I'm going to suggest we adopt a coding style for named fields, where we
> indent the ":: type" part much the same way we have traditionally
> indented the comments for each field:
> 
> 			module_sub_info		:: module_sub_info,
> 			pred_table 		:: predicate_table,
> 			proc_requests		:: proc_requests,
> 			special_pred_map 	:: special_pred_map,
> 			partial_qualifier_info	:: partial_qualifier_info,
> 			type_table 		:: type_table,
> 			inst_table 		:: inst_table,
> 			mode_table 		:: mode_table,
> 			cons_table 		:: cons_table,
> 			class_table 		:: class_table,
> 			instance_table 		:: instance_table,
> 			superclass_table 	:: superclass_table,
> 			assertion_table 	:: assertion_table,
> 			ctor_field_table 	:: ctor_field_table,
> 			cell_count 		:: int
> 					% cell count, passed into code_info
>  					% and used to generate unique label
>  					% numbers for constant terms in the
>  					% generated C code
> 
> I think this is much more readable.
> 

I think so too; it should be documented in the coding standards
(unless there are any better suggestions).

On a related note, the coding standard says, "Comments should precede
the code to which they apply, rather than following it."  This should
apply to the cell count comment, IMHO.  It is not urgent, since the
comment itself refers to "cell count", but in general I prefer comments
to be in a consistent place.

Cheers,
Mark.
-- 
Mark Brown, PhD student            )O+  |  "Another of Fortran's breakthroughs
(m.brown at cs.mu.oz.au)                   |  was the GOTO statement, which was...
Dept. of Computer Science and Software  |  uniquely simple and understandable"
Engineering, University of Melbourne    |              -- IEEE, 1994
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list