Dear all,

here are the changes necessary to make aldor (precisely, src_aldor2.tgz) work
with sbcl-based FriCAS.  I guess that they should also work for OpenAxiom.

Abstract:

*) the right way to get oneself into the underlying lisp from within the
   FriCAS/OpenAxiom interpreter is )fin, I believe

*) possibly gcl *needs* the call 

   @echo "(si::use-fast-links nil)" >> $(MID)/tmp/mkax_$*.lsp

   If so, this needs to conditionalized.

*) ANSI Common Lisp does not understand old CLTL style in-package with options,
   as produced by Aldor. The (lisp) package within which the PanAxiom
   interpreter operates (and, in particular, loads and compiles aldor generated
   files) is "BOOT".  Therefore, we shadow in-package in "BOOT".  Since depsys
   operates in "COMMON-LISP-USER", we need to switch to "BOOT" first.

   The shadowing in src/interp/sys-pkg.lisp needs to be condionalized on ANSI
   CL.

   The right fix, however, would be to modify the Aldor compiler to output ANSI
   Common Lisp code.

*) There are some other ANSI Common Lisp changes in interp/foam_l.lisp.  Most
   annoyingly, Aldor assumes that fixnums can be of size 2^31, which is not the
   case in sbcl.

*) With the optimized version of FriCAS (not in the repository currently), the
   compiled files (*.o) in target/*/aldor/lib do not seem to work.  Just delete
   them and copy the *.lsp files to *.o.  (That works!)

   I have not checked this particular point with the non-optimized version yet.
   All this needs to be investigated.

*) The contrib/makeAldor script I use needs to be made more intelligent (and
   adapted for OpenAxiom, evidently).  Possibly, this would be a no-op if we
   switch to src_aldor3.tgz, which should be done in any case.  In fact, this
   switch is the most important thing, in my opinion.

Martin


# contrib/makeAldor
# the name of the svn repository should be fricas
# the build directory and the svn repository are expected to have a common
# parent directory.
# after adapting ARCH, invoke this script from the build directory with
# ../fricas/contrib/makeAldor
# the content of src_aldor2.tgz is expected in the contrib directory of fricas


ARCH=i686-pc-linux
export AXIOM=$PWD/target/$ARCH 

# export ALDORROOT=/usr/opt/Aldor-1.0.2-amd64/aldor/linux/1.0.2 
 
(cd $AXIOM/bin; ln -s ../../../build/scripts/document .) 
mkdir -p obj/$ARCH 
(cd obj/$ARCH ; ln -s ../../build/$ARCH/bin .) 
(cd obj/$ARCH ; ln -s ../../src/interp/ .) 
 
cd src 
#for axiom.sty 
ln -s ../../fricas/src/scripts/ . 
 
cp -pr ../../fricas/contrib/aldor .
cd aldor 
ln -s ../../build/$ARCH . 
 
for pp in *.pamphlet; do ../../build/scripts/document $pp;done 
 
(cd ../..; mkdir -p int/algebra;cd int/algebra; for f in ../../src/algebra/*; 
do ln -s $f; done)

make



diff -r aldor/Make.axiom.pamphlet aldorneu/Make.axiom.pamphlet
48,49c48
<       @echo ")set bre fast" >> $(FILE)
<       @echo ")lisp (break)" >> $(FILE)
---
>       @echo ")fin" >> $(FILE)
79,81c78,79
<       @echo ")set bre fast" >> $(MID)/tmp/mkax_$*.lsp
<       @echo ")lisp (break)" >> $(MID)/tmp/mkax_$*.lsp
<       @echo "(si::use-fast-links nil)" >> $(MID)/tmp/mkax_$*.lsp
---
>       @echo ")fin" >> $(MID)/tmp/mkax_$*.lsp
> #     @echo "(si::use-fast-links nil)" >> $(MID)/tmp/mkax_$*.lsp
101c99
<       @echo '(progn (load "$(OBJ)/$(SYS)/interp/foam_l.o") (compile-file 
"$(fi                                                             lter 
%.lsp,$^)" :output-file "$@") (${BYE}))' | ${DEPSYS} > $(OBJ)/$(SYS)/aldor/     
                                                        build/$(notdir $@).log ;
---
>       @echo '(progn (in-package "BOOT") (load 
> "$(OBJ)/$(SYS)/interp/foam_l.fas                                              
>                l") (compile-file "$(filter %.lsp,$^)" :output-file "$@") 
> (${BYE}))' | ${DEPSYS}                                                        
>       > $(OBJ)/$(SYS)/aldor/build/$(notdir $@).log ;
diff -r aldor/types.mk.pamphlet aldorneu/types.mk.pamphlet
144,145c144
<       echo ")set bre fast" >> $(MID)/mkinit.lsp
<       echo ")lisp (break)" >> $(MID)/mkinit.lsp
---
>       echo ")fin" >> $(MID)/mkinit.lsp

Index: src/interp/Makefile.in
===================================================================
--- src/interp/Makefile.in      (revision 279)
+++ src/interp/Makefile.in      (working copy)
@@ -21,7 +21,7 @@
 DEP=    vmlisp     ggreater   hash       bootfuns \
         union      nlib       macros     comp \
         spaderror  debug      spad       bits \
-        setq       property
+        setq       property   foam_l     axext_l
 
 LOADSYS= $(axiom_build_bindir)/lisp$(EXEEXT)
 SAVESYS= $(axiom_build_bindir)/interpsys$(EXEEXT)
Index: src/interp/sys-pkg.lisp
===================================================================
--- src/interp/sys-pkg.lisp     (revision 268)
+++ src/interp/sys-pkg.lisp     (working copy)
@@ -44,8 +44,17 @@
 ;;; up here. The interpreter and the algebra are run after switching
 ;;; to the boot package (in-package "BOOT") so any symbol that the
 ;;; interpreter or algebra uses has to (cough, cough) appear here.
-(make-package "BOOT" :use '("VMLISP" "FRICAS-LISP"))
+(defpackage "BOOT" (:use "VMLISP" "FRICAS-LISP") (:shadow "IN-PACKAGE"))
+;; Aldor 1.1.0 produces in-package statements with :use options.  These can be
+;; ignored, so we do not use 
+;; (defpackage package options)
+;; (in-package package)
+(print "################# shadowing in-package #################")
+(in-package "BOOT")
+(defmacro IN-PACKAGE (package &rest options) 
+  `(COMMON-LISP:IN-PACKAGE ,package))
 
+
 ;;; FOAM is the intermediate language for the aldor compiler. FOAM
 ;;; means "first order abstract machine" and functions similar to
 ;;; RTL for the GCC compiler. It is a "machine" that is used as the

Index: src/interp/foam_l.lisp
===================================================================
--- src/interp/foam_l.lisp      (revision 279)
+++ src/interp/foam_l.lisp      (working copy)
@@ -157,7 +157,7 @@
 (deftype |Bool| () '(member t nil))
 (deftype |Byte| () 'unsigned-byte)
 (deftype |HInt| () '(integer #.(- (expt 2 15)) #.(1- (expt 2 15))))
-(deftype |SInt| () 'fixnum)
+(deftype |SInt| () '(integer #.(- (expt 2 31)) #.(1- (expt 2 31))))
 
 #+:AKCL
 (deftype |BInt| () t)
@@ -511,7 +511,7 @@
 (defmacro |FunProg| (x) x)
 
 (defstruct FoamProgInfoStruct
-  (funcall nil :type function)
+  (funcall #'(lambda () (error "FoamProgInfoStruct: funcall not assigned")) 
:type function)
   (hashval 0   :type |SInt|))
 
 (defun |ProgHashCode| (x)
@@ -617,8 +617,15 @@
 ;; macros for defining things
 
 (defmacro declare-prog (name-result params)
-  `(proclaim '(function ,(car name-result) ,params ,@(cdr name-result))))
+  `(proclaim '(ftype (function
+                     ,(mapcar #'cadr params)
+                     ,(or (cadr name-result) 't))
+                    ,(car name-result))))
 
 (defmacro declare-type (name type)
   `(proclaim '(type ,name ,type)))
 


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
open-axiom-devel mailing list
open-axiom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open-axiom-devel

Reply via email to