> 
> Dear all,
> 
> I now have managed to do a proper patch, no regressions.
> 
> If there is no complaint, I'll commit, although I must say that the code in
> open-axiom looks much cleaner.
> 
> Since I do not understand what I'm doing here, help and comments would be
> greatly appreciated.  (The comments in the patch are taken, as everything 
> else,
> too, from open-axiom)
> 
> Oh: one important thing: I had to define isCategoryForm *additionally* in
> src/interp/i-analy.boot, for some reason it wouldn't find the definition in
> category.boot.  This *has* to be fixed...
> 

The following version passes all test.  I have removed hunk corresponding
to isCategoryForm and add isCategoryForm in util.lisp to the list of
functions which trigger loding of the compiler.  There is a little
change in printouts, instead of messages like:

   Category, domain or package constructor FormalFraction is not
      available.

we get:

   There are no library operations named FormalFraction
      Use HyperDoc Browse or issue
                           )what op FormalFraction
      to learn if there is any operation containing " FormalFraction "
      in its name.
....

this is a small regression, but I find it acceptable.


diff -ru trunk.bb/src/interp/i-analy.boot trunk/src/interp/i-analy.boot
--- trunk.bb/src/interp/i-analy.boot    2008-09-25 00:49:46.000000000 +0200
+++ trunk/src/interp/i-analy.boot       2008-09-25 00:51:19.000000000 +0200
@@ -258,6 +258,11 @@
             argModeSetList:= [bottomUp x for x in argl]
 
     ms := bottomUpForm(t,op,opName,argl,argModeSetList)
+    -- If this is a type producing form, then we don't want
+    -- to store the representation object in the environment.
+    -- Rather, we want to record the reified canonical form.
+    if ms is [m] and (m in '((Mode) (Domain) (SubDomain (Domain))) or 
isCategoryForm(m,$e))
+    then putValue(t,objNew(devaluate objValUnwrap getValue t, m))
 
     -- given no target or package calling, force integer constants to
     -- belong to tightest possible subdomain
diff -ru trunk.bb/src/interp/i-eval.boot trunk/src/interp/i-eval.boot
--- trunk.bb/src/interp/i-eval.boot     2008-09-25 00:49:46.000000000 +0200
+++ trunk/src/interp/i-eval.boot        2008-09-25 00:50:20.000000000 +0200
@@ -145,10 +145,22 @@
     op='Record =>
       [op,:[['_:,sel,evaluateType type] for ['_:,sel,type] in argl]]
     op='Enumeration => form
-    evaluateType1 form
+    evaluateFormAsType form
   constructor? form =>
     ATOM form => evaluateType [form]
     throwEvalTypeMsg("S2IE0003",[form,form])
+  evaluateFormAsType form
+
+++ `form' used in a context where a type (domain or category) is
+++ expected.  Attempt to fully evaluate it.  Error if the resulting
+++ value is not a type.  When successful, the result is the reified
+++ canonical form of the type.
+evaluateFormAsType form ==
+  form is [op,:args] and constructor? op => evaluateType1 form
+  t := mkAtree form
+  -- ??? Maybe we should be more careful about generalized types.
+  bottomUp t is [m] and (m in '((Mode) (Domain) (SubDomain (Domain))) or 
isCategoryForm(m,$e)) =>
+    objVal getValue t
   throwEvalTypeMsg("S2IE0004",[form])
 
 evaluateType1 form ==
diff -ru trunk.bb/src/interp/i-spec1.boot trunk/src/interp/i-spec1.boot
--- trunk.bb/src/interp/i-spec1.boot    2008-09-25 00:49:46.000000000 +0200
+++ trunk/src/interp/i-spec1.boot       2008-09-25 00:50:20.000000000 +0200
@@ -1216,7 +1216,8 @@
     get(form,'value,$InteractiveFrame) or _
     (PAIRP($env) and get(form,'value,$env)) or _
     (PAIRP($e) and get(form,'value,$e)))) and
-      objMode(val) in '((Domain) (SubDomain (Domain))) =>
+      ((m := objMode(val)) in '((Domain) (SubDomain (Domain)))
+          or categoryForm? m) =>
         objValUnwrap(val)
   nil
 
diff -ru trunk.bb/src/interp/util.lisp trunk/src/interp/util.lisp
--- trunk.bb/src/interp/util.lisp       2008-09-25 00:49:46.000000000 +0200
+++ trunk/src/interp/util.lisp  2008-09-25 06:36:06.000000000 +0200
@@ -490,6 +490,7 @@
         |compilerDoitWithScreenedLisplib|
         |mkCategory|
         |cons5|
+        |isCategoryForm|
         |sublisV|))
 
 ;;; This is the {\bf browser} subsystem. It will get autoloaded only


-- 
                              Waldek Hebisch
[EMAIL PROTECTED] 

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/fricas-devel?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to