From 041f2e9f7c59fd11a182760e31dd3bdb75d3ea79 Mon Sep 17 00:00:00 2001
From: dos-reis <gdr@axiomatics.org>
Date: Sun, 1 Jan 2012 22:32:44 +0000
Subject: 	* interp/define.boot (evalCategoryForm): New. 
 (mkCategoryPackage): Use it. 	(compMakeCategoryObject): Likewise. 	*
 interp/nruncomp.boot (NRTsetVector4a): Likewise.

---
 src/ChangeLog            |  7 +++++++
 src/interp/define.boot   | 12 ++++++++----
 src/interp/nruncomp.boot |  4 ++--
 3 files changed, 17 insertions(+), 6 deletions(-)

(limited to 'src')

diff --git a/src/ChangeLog b/src/ChangeLog
index e69de29b..9a089bd6 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -0,0 +1,7 @@
+2012-01-01  Gabriel Dos Reis  <gdr@cs.tamu.edu>
+
+	* interp/define.boot (evalCategoryForm): New.
+	(mkCategoryPackage): Use it.
+	(compMakeCategoryObject): Likewise.
+	* interp/nruncomp.boot (NRTsetVector4a): Likewise.
+
diff --git a/src/interp/define.boot b/src/interp/define.boot
index d2fa9601..5ef8e842 100644
--- a/src/interp/define.boot
+++ b/src/interp/define.boot
@@ -44,7 +44,8 @@ module define where
   compCapsule: (%Form, %Mode, %Env) -> %Maybe %Triple
   compJoin: (%Form,%Mode,%Env) -> %Maybe %Triple 
   compAdd: (%Form, %Mode, %Env) -> %Maybe %Triple 
-  compCategory: (%Form,%Mode,%Env) -> %Maybe %Triple 
+  compCategory: (%Form,%Mode,%Env) -> %Maybe %Triple
+  evalCategoryForm: (%Form,%Env) -> %Maybe %Shell
 
 
 --%
@@ -909,7 +910,7 @@ macroExpandList(l,e) ==
  
 mkEvalableCategoryForm c ==
   c is [op,:argl] =>
-    op="Join" => ["Join",:[mkEvalableCategoryForm x for x in argl]]
+    op is "Join" => [op,:[mkEvalableCategoryForm x for x in argl]]
     op is "DomainSubstitutionMacro" => mkEvalableCategoryForm second argl
     op is "mkCategory" => c
     builtinCategoryName? op =>
@@ -922,6 +923,9 @@ mkEvalableCategoryForm c ==
     m=$Category => x
   MKQ c
  
+evalCategoryForm(x,e) ==
+  eval mkEvalableCategoryForm x
+
 ++ Return true if we should skip compilation of category package.
 ++ This situation happens either when there is no default, of we are in
 ++ bootstrap mode.
@@ -986,7 +990,7 @@ mkCategoryPackage(form is [op,:argl],cat,def) ==
     x isnt [.,:.] => oplist
     x is ['DEF,y,:.] => [opOf y,:oplist]
     fn(x.args,fn(x.op,oplist))
-  catvec := eval mkEvalableCategoryForm form
+  catvec := evalCategoryForm(form,$e)
   fullCatOpList := categoryExports JoinInner([catvec],$e)
   catOpList :=
     [mkExportFromDescription desc for desc in fullCatOpList
@@ -1160,7 +1164,7 @@ compDefineCategory(df,m,e,fal) ==
 compMakeCategoryObject: (%Form,%Env) -> %Maybe %CatObjRes
 compMakeCategoryObject(c,$e) ==
   not isCategoryForm(c,$e) => nil
-  u:= mkEvalableCategoryForm c => [eval u,$Category,$e]
+  u := evalCategoryForm(c,$e) => [u,$Category,$e]
   nil
 
 predicatesFromAttributes: %List %Form -> %List %Form
diff --git a/src/interp/nruncomp.boot b/src/interp/nruncomp.boot
index adedec63..58a7531f 100644
--- a/src/interp/nruncomp.boot
+++ b/src/interp/nruncomp.boot
@@ -555,8 +555,8 @@ NRTsetVector4a(sig,form,cond) ==
      $uncondList := append(domainList,$uncondList)
      if isCategoryForm(form,$e) then $uncondList := [form,:$uncondList]
      $uncondList
-  evalform := eval mkEvalableCategoryForm form
-  cond = true =>
+  evalform := evalCategoryForm(form,$e)
+  cond is true =>
     $uncondList := [form,:append(categoryPrincipals evalform,$uncondList)]
   $condList := [[cond,[form,:categoryPrincipals evalform]],:$condList]
 
-- 
cgit v1.2.3