[m-rev.] trivial diff: make some code easier to read

Julien Fischer juliensf at csse.unimelb.edu.au
Sun Oct 2 18:51:05 AEDT 2011


Branches: main

compiler/quantification.m:
 	Shift a construction unifiction so that it occurs after all its
 	arguments have been produced.  (The compiler doesn't care but
 	it does make this code quite difficult to read.)

Julien.

Index: compiler/quantification.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/quantification.m,v
retrieving revision 1.148
diff -u -r1.148 quantification.m
--- compiler/quantification.m	13 Sep 2011 06:07:14 -0000	1.148
+++ compiler/quantification.m	30 Sep 2011 07:25:52 -0000
@@ -1000,9 +1000,6 @@
          implicitly_quantify_goal_quant_info(Goal1, Goal, NonLocalsToRecompute,
              !Info),

-        !:RHS = rhs_lambda_goal(Purity, Groundness, PredOrFunc, EvalMethod,
-            LambdaNonLocals, LambdaVars, Modes, Det, Goal),
-
          get_nonlocals(!.Info, RHSNonLocals0),
          % Lambda-quantified variables are local.
          set_of_var.delete_list(LambdaVars, RHSNonLocals0, RHSNonLocals),
@@ -1019,6 +1016,9 @@
          LambdaGoalNonLocals = goal_info_get_nonlocals(LambdaGoalInfo),
          list.filter(set_of_var.contains(LambdaGoalNonLocals),
              LambdaNonLocals0, LambdaNonLocals),
+ 
+        !:RHS = rhs_lambda_goal(Purity, Groundness, PredOrFunc, EvalMethod,
+            LambdaNonLocals, LambdaVars, Modes, Det, Goal),

          % For a unification that constructs a lambda expression, the argument
          % variables of the construction are the nonlocal variables of the

--------------------------------------------------------------------------
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