Changes 
http://wiki.axiom-developer.org/370ImproperCodeEmmitedByMkUnionFunListImpactsDefintrfSpad/diff
--
In defintrf.spad, function findRealZero, we have the following code:

   select_!(keeprec?(i.halfinf.endpoint, #1), l)

The call to keeprec? gets lifted into a top level DEFUN in the generated Lisp 
but the Union/Record 
tags are being confused with free variables.  This results in the following 
Lisp code (thanks to 
Gregory Vanuxem for pointing this out):

   (SPADCALL 
      (CONS #'|DFINTTLS;findRealZero!1|
         (VECTOR $ |dir| |endpoint| |i|)) ...)

As the tags |dir| and |endpoint| have been confused with free variables, the 
Lisp code now references unbound symbols.

A fix is to ensure that the code emmited when accessing a Union field properly 
macroexpands type expressions so that tags are explicitly quoted, and this 
recognized by the compiler as literals rather than evalable identifiers.  This 
amounts to the following change in buildom.boot.pamphlet, in the functions 
mkUnionFunList and mkNewUnionFunList:

 --- buildom.boot.pamphlet       2007-07-08 14:29:00.000000000 -0400
+++ buildom.boot.pamphlet.sxw   2007-07-08 14:29:34.000000000 -0400
@@ -318,7 +318,7 @@
                      ['XLAM,["#1"],['PROG1,['QCDR,"#1"],
                        ['check_-union,['QEQCAR,"#1",i],type,"#1"]]]
                    ['XLAM,["#1"],['PROG2,['LET,gg,"#1"],['QCDR,gg],
-                     ['check_-union,['QEQCAR,gg,i],type,gg]]]
+                     ['check_-union,['QEQCAR,gg,i],MACROEXPAND type,gg]]]
   [cList,e]
 
 mkEnumerationFunList(nam,['Enumeration,:SL],e) ==
@@ -361,7 +361,7 @@
                  ref:=gg
                  q:= substitute(gg,"#1",p)
               ['XLAM,["#1"],['PROG2,['LET,gg,"#1"],ref,
-                   ['check_-union,q,t,gg]]]
+                   ['check_-union,q,MACROEXPAND t,gg]]]
             downFun() ==
                p is ['EQCAR,x,.] =>
                  ['XLAM,["#1"],['QCDR,"#1"]]



       
--
forwarded from http://wiki.axiom-developer.org/[EMAIL PROTECTED]

Reply via email to