[m-rev.] for review: more standardization of interface files

Zoltan Somogyi zs at cs.mu.OZ.AU
Wed May 25 12:38:14 AEST 2005


On 25-May-2005, Julien Fischer <juliensf at cs.mu.OZ.AU> wrote:
> I assume 'other' is for the case where the compiler appends new items
> on to the item list without specifying whether they are in the interface
> or implementation; in any case a brief comment about why 'other' is
> necessary would be helpful here.

I made the following changes in response to your comments. If you can insert
the calls to unexpected you asked for, or provide better handling of "other",
please do it.

Zoltan.

--- modules.m.was	2005-05-25 12:33:41.000000000 +1000
+++ modules.m	2005-05-25 12:36:09.000000000 +1000
@@ -7455,6 +7455,11 @@
 interface_or_import_marker(module_defn(_, interface) - _).
 interface_or_import_marker(module_defn(_, implementation) - _).
 
+    % Which section of the module we are in. The "other" alternative
+    % reflects my ignorance (based on the lack of documentation) of
+    % the invariants that govern the items involved in the representation
+    % of nested modules. -zs
+
 :- type cur_pos
     --->    in_interface
     ;       in_implementation
@@ -7540,11 +7545,16 @@
 reorderable_item_and_context(Item - _Context) =
     reorderable_item(Item).
 
-    % The kinds of items for which reorderable_item succeeds can be arbitrarily
-    % reordered with respect to each other and with respect to other chunkable
-    % items in all kinds of interface files (.int, .int2, .int3, and .int0).
-    % This predicate is not relevant to .opt and .trans_opt files, since those
-    % are generated from the HLDS, not from item_lists.
+    % The kinds of items for which reorderable_item returns yes can be
+    % arbitrarily reordered with respect to each other and with respect to
+    % other chunkable items in all kinds of interface files (.int, .int2,
+    % .int3, and .int0). This predicate is not relevant to .opt and
+    % .trans_opt files, since those are generated from the HLDS, not
+    % from item_lists.
+    %
+    % We should make this predicate call "unexpected" for items that should
+    % never occur in interface files. However, I don't have a reliable list
+    % of exactly which items those are.
     %
 :- func reorderable_item(item) = bool.
 
@@ -7623,9 +7633,13 @@
 chunkable_item_and_context(Item - _Context) =
     chunkable_item(Item).
 
-    % Given a list of items for which chunkable_item succeeds, we need to keep
-    % the relative order of the non-reorderable items, but we can move the
-    % reorderable items around arbitrarily.
+    % Given a list of items for which chunkable_item returns yes, we need
+    % to keep the relative order of the non-reorderable items, but we can
+    % move the reorderable items around arbitrarily.
+    %
+    % We should make this predicate call "unexpected" for items that should
+    % never occur in interface files. However, I don't have a reliable list
+    % of exactly which items those are.
     %
 :- func chunkable_item(item) = bool.
--------------------------------------------------------------------------
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