A propos moving forward: I'd like to merge the aldor interface done by Ralf
into trunk.  With the patch below against the latest revision of the
aldor-interface branch, I and Franz Lehner were able to build it successfully
on linux with

gcl, ecl and sbcl 32 bit, sbcl 64 bit.

I did not try MS Windows yet, and I did not try clisp, but I won't have time
for that in the near future.

The bulk of the changes in Ralf's Makefiles are due to )fin not working on
ecl...

Note that the SInt patches should be no-ops on gcl, since an integer is 32 bit
there anyway.

The change which is probably the most ugly one is the one to shadow
in-package.  But I would like to have something working now, rather than
waiting for aldor to change.

The testbed was the aldor-combinat project, by the way.

Martin

Index: src/interp/patches.lisp
===================================================================
--- src/interp/patches.lisp     (Revision 345)
+++ src/interp/patches.lisp     (Arbeitskopie)
@@ -171,12 +171,12 @@
   (browseopen)
   (|makeConstructorsAutoLoad|)
   (let ((asharprootlib (strconc (|getEnv| "AXIOM") "/aldor/lib/")))
-    (set-file-getter (strconc asharprootlib "runtime.o"))
-    (set-file-getter (strconc asharprootlib "lang.o"))
-    (set-file-getter (strconc asharprootlib "attrib.o"))
-    (set-file-getter (strconc asharprootlib "axlit.o"))
-    (set-file-getter (strconc asharprootlib "minimach.o"))
-    (set-file-getter (strconc asharprootlib "axextend.o")))
+    (set-file-getter (strconc asharprootlib "runtime"))
+    (set-file-getter (strconc asharprootlib "lang"))
+    (set-file-getter (strconc asharprootlib "attrib"))
+    (set-file-getter (strconc asharprootlib "axlit"))
+    (set-file-getter (strconc asharprootlib "minimach"))
+    (set-file-getter (strconc asharprootlib "axextend")))
 )
 
 (defun whocalled (n) nil) ;; no way to look n frames up the stack
Index: src/interp/foam_l.lisp
===================================================================
--- src/interp/foam_l.lisp      (Revision 345)
+++ src/interp/foam_l.lisp      (Arbeitskopie)
@@ -50,7 +50,7 @@
  compile-as-file cases
 
  |Clos| |Char| |Bool| |Byte| |HInt| |SInt| |BInt| |SFlo| |DFlo| |Ptr| 
- |Word| |Arb| |Env| |Level| |Arr| |Record|
+ |Word| |Arb| |Env| |Level| |Arr| |Record| |Nil|
 
  |ClosInit| |CharInit| |BoolInit| |ByteInit| |HIntInit| |SIntInit| 
  |BIntInit| |SFloInit| |DFloInit| |PtrInit| |WordInit| |ArbInit| |EnvInit|
@@ -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)
@@ -311,8 +311,8 @@
 
 (defmacro |SInt0|         () 0)
 (defmacro |SInt1|         () 1)
-(defmacro |SIntMin|       () `(the |SInt| most-negative-fixnum))
-(defmacro |SIntMax|       () `(the |SInt| most-positive-fixnum))
+(defmacro |SIntMin|       () `(the |SInt| #.(- (expt 2 31))))
+(defmacro |SIntMax|       () `(the |SInt| #.(1- (expt 2 31))))
 (defmacro |SIntIsZero|   (x) `(zerop (the |SInt| ,x)))
 (defmacro |SIntIsNeg|    (x) `(minusp (the |SInt| ,x)))
 (defmacro |SIntIsPos|    (x) `(plusp (the |SInt| ,x)))
@@ -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)
@@ -616,8 +616,23 @@
 
 ;; macros for defining things
 
+;; name-result is a list, the car is the name of the function to be declared,
+;; the cdr is the list of return values
+;; params is a list of pairs, the car of each is the name of the argument, the
+;; cdr is its type.
+
+;; in the ANSI Common Lisp ftype function declaration, the names of the
+;; arguments do not appear, actually.  In GCL, they did.  
+
+;; Example:
+;; (declare-prog
+;;  (|C25-csspecies-generBaseFn| |Clos| |Clos| |Clos| |Clos|)
+;;  ((|e1| |Env|)))
 (defmacro declare-prog (name-result params)
-  `(proclaim '(function ,(car name-result) ,params ,@(cdr name-result))))
+  `(proclaim '(ftype (function
+                     ,(mapcar #'cadr params)
+                     (values ,@(cdr name-result)))
+                    ,(car name-result))))
 
 (defmacro declare-type (name type)
   `(proclaim '(type ,name ,type)))
Index: src/aldor/Makefile.in
===================================================================
--- src/aldor/Makefile.in       (Revision 345)
+++ src/aldor/Makefile.in       (Arbeitskopie)
@@ -117,10 +117,9 @@
        test -f $@
 
 mkinit.lsp:
-       echo ')fin' > $@
-       echo '(load "$(GENAX)")' >> $@
-       echo '(generate-init "initlist.lst")' >> $@
-       echo '(quit)' >> $@
+       echo ')lisp (load "$(GENAX)")' > $@
+       echo ')lisp (generate-init "initlist.lst")' >> $@
+       echo ')lisp (quit)' >> $@
 
 
 ###################################################################
@@ -133,10 +132,9 @@
 
 domain_lsp_files = $(patsubst %,tmp/dep_%.lsp,$(domains))
 $(domain_lsp_files): tmp/dep_%.lsp: tmp/.dir gendeps/.dir
-       echo ')fin' > $@
-       echo '(load "$(GENAX)")' >> $@
-       echo '(generate-deps (quote ($*)))' >> $@
-       echo '(quit)' >> $@
+       echo ')lisp (load "$(GENAX)")' > $@
+       echo ')lisp (generate-deps (quote ($*)))' >> $@
+       echo ')lisp (quit)' >> $@
 
 domaindepfiles: $(domain_dep_files)
        touch $@
@@ -195,12 +193,8 @@
 
 # Write all attributes to tmp/attrib.all
 tmp/attrib.lsp: tmp/.dir
-       echo ")fin" > $@
-       echo '(with-open-file (str (pathname "tmp/attrib.all")' >> $@
-       echo ' :direction :output) (dolist (a ' >> $@
-       echo "(mapcar #'car (mapcan #'(lambda (x) (getdatabase x 'ATTRIBUTES)) 
(|allConstructors|))))" >> $@
-       echo '(format str "~a~%" a)))' >> $@
-       echo "(quit)" >> $@
+       echo ")lisp (with-open-file (str (pathname \"tmp/attrib.all\") 
:direction :output) (dolist (a (mapcar #'car (mapcan #'(lambda (x) (getdatabase 
x 'ATTRIBUTES)) (|allConstructors|)))) (format str \"~a~%\" a)))" > $@
+       echo ")lisp (quit)" >> $@
 
 aldor_lang       = lang
 aldor_basics     = minimach boolean0 attrib
@@ -218,10 +212,9 @@
 
 aldor_lsp_files = $(patsubst %,tmp/dep_%.lsp,$(aldor_srcs))
 $(aldor_lsp_files): tmp/dep_%.lsp: ap/%.ap tmp/.dir
-       echo ")fin" > $@
-       echo '(load "$(GENAX)")' >> $@
-       echo '(generate-deps-from-ap-files (quote (|$*|)))' >> $@
-       echo '(quit)' >> $@
+       echo ')lisp (load "$(GENAX)")' > $@
+       echo ')lisp (generate-deps-from-ap-files (quote (|$*|)))' >> $@
+       echo ')lisp (quit)' >> $@
 
 aldor_ap_files = $(patsubst %,ap/%.ap,$(aldor_srcs))
 $(aldor_ap_files): ap/%.ap: %.as ap/.dir tmp/.dir 
@@ -294,10 +287,8 @@
        test -f $@
 
 tmp/mko_%.lsp:
-       echo ')fin' > $@
-       echo '(compile-file "$(abs_builddir)/lsp/$*.lsp" ' >> $@
-       echo '  :output-file "$(abs_builddir)/lib/$*.$(FASLEXT)")' >> $@
-       echo '(quit)' >> $@
+       echo ')lisp (compile-file "$(abs_builddir)/lsp/$*.lsp" :output-file 
"$(abs_builddir)/lib/$*.$(FASLEXT)")' > $@
+       echo ')lisp (quit)' >> $@
 
 runtimefiles: $(runtime_files)
 
Index: src/aldor/Makefile2.in
===================================================================
--- src/aldor/Makefile2.in      (Revision 345)
+++ src/aldor/Makefile2.in      (Arbeitskopie)
@@ -19,12 +19,11 @@
        test -f $@
 
 ap/%.lsp:
-       echo ')fin' > $@
-       echo '(load "$(GENAX)")' >> $@
-       echo '(trace |makeAxExportForm|)' >> $@
-       echo '(trace |modemapToAx|)' >> $@
-       echo '(trace getdatabase)' >> $@
-       echo '(generate-ax-file "$*" (quote ($(filter-out init_%, 
$(MEMBERS_$*)))) (quote ($(patsubst %,|%|,$(filter init_%, $(MEMBERS_$*))))))' 
>> $@
+       echo ')lisp (load "$(GENAX)")' > $@
+       echo ')lisp (trace |makeAxExportForm|)' >> $@
+       echo ')lisp (trace |modemapToAx|)' >> $@
+       echo ')lisp (trace getdatabase)' >> $@
+       echo ')lisp (generate-ax-file "$*" (quote ($(filter-out init_%, 
$(MEMBERS_$*)))) (quote ($(patsubst %,|%|,$(filter init_%, $(MEMBERS_$*))))))' 
>> $@
 
 
 
Index: src/lisp/fricas-package.lisp
===================================================================
--- src/lisp/fricas-package.lisp        (Revision 345)
+++ src/lisp/fricas-package.lisp        (Arbeitskopie)
@@ -1,14 +1,25 @@
 ;;; We put this in separate file to avoid problems with compilation.
 (eval-when (:execute :compile-toplevel :load-toplevel)
-(if (not (find-package "FRICAS-LISP"))
-   (make-package "FRICAS-LISP" 
-     :use (list (or (find-package "COMMON-LISP")
-                    "LISP"))))) 
+  (if (not (find-package "FRICAS-LISP"))
+      (make-package "FRICAS-LISP" 
+                   :use (list (or (find-package "COMMON-LISP")
+                                  "LISP"))))) 
 #+:sbcl
 (eval-when (:execute :compile-toplevel :load-toplevel)
-    (setf SB-IMPL::*DEFAULT-EXTERNAL-FORMAT* :LATIN-1))
+  (setf SB-IMPL::*DEFAULT-EXTERNAL-FORMAT* :LATIN-1))
 
 (in-package "FRICAS-LISP")
+;;; 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)
+#-gcl
+(shadow "IN-PACKAGE" "FRICAS-LISP")
+#-gcl
+(defmacro IN-PACKAGE (package &rest options) 
+  `(COMMON-LISP:IN-PACKAGE ,package))
+
 (do-symbols (x "FRICAS-LISP") (export (list x)))
 
 (export '(quit chdir |getEnv| |load_quietly| get-current-directory



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