[m-rev.] diff: rename some predicates in polymorphism.m

Julien Fischer juliensf at csse.unimelb.edu.au
Mon Jan 8 16:34:31 AEDT 2007


Estimated hours taken: 0.1
Branches: main

compiler/polymorphism.m:
 	Give more descriptive names to some predicates.

Julien.

Index: compiler/polymorphism.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/polymorphism.m,v
retrieving revision 1.314
diff -u -r1.314 polymorphism.m
--- compiler/polymorphism.m	6 Jan 2007 09:23:47 -0000	1.314
+++ compiler/polymorphism.m	8 Jan 2007 05:21:59 -0000
@@ -3092,7 +3092,7 @@
          ClassIds = ClassIds0
      ),
      map.apply_to_list(ClassIds, Classes, ClassDefns),
-    list.foldl(expand_bodies, ClassDefns, !ModuleInfo).
+    list.foldl(expand_class_method_bodies_2, ClassDefns, !ModuleInfo).

  :- pred class_id_is_from_given_module(module_name::in, class_id::in)
      is semidet.
@@ -3100,17 +3100,18 @@
  class_id_is_from_given_module(ModuleName, ClassId) :-
      ClassId = class_id(qualified(ModuleName, _), _).

-:- pred expand_bodies(hlds_class_defn::in, module_info::in, module_info::out)
-    is det.
+:- pred expand_class_method_bodies_2(hlds_class_defn::in,
+    module_info::in, module_info::out) is det.

-expand_bodies(HLDSClassDefn, !ModuleInfo) :-
-    Interface = HLDSClassDefn ^ class_hlds_interface,
-    list.foldl2(expand_one_body, Interface, 1, _, !ModuleInfo).
+expand_class_method_bodies_2(ClassDefn, !ModuleInfo) :-
+    Interface = ClassDefn ^ class_hlds_interface,
+    list.foldl2(expand_class_method_body, Interface, 1, _, !ModuleInfo).

-:- pred expand_one_body(hlds_class_proc::in, int::in, int::out,
+:- pred expand_class_method_body(hlds_class_proc::in, int::in, int::out,
      module_info::in, module_info::out) is det.

-expand_one_body(hlds_class_proc(PredId, ProcId), !ProcNum, !ModuleInfo) :-
+expand_class_method_body(hlds_class_proc(PredId, ProcId), !ProcNum,
+        !ModuleInfo) :-
      module_info_preds(!.ModuleInfo, PredTable0),
      map.lookup(PredTable0, PredId, PredInfo0),
      pred_info_get_procedures(PredInfo0, ProcTable0),
@@ -3158,7 +3159,8 @@
          HeadVars = HeadVarsPrime,
          Modes = ModesPrime
      ;
-        unexpected(this_file, "expand_one_body: typeclass_info var not found")
+        unexpected(this_file, "expand_class_method_body: " ++
+            "typeclass_info var not found")
      ),

      InstanceConstraint = constraint(ClassName, InstanceArgs),

--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list