Ralf, Bill,

Could you test the attached patch.  More precisely, please
apply the patch to the trunk and remove src/interp/sys-pkg.lisp and
src/interp/axext_l.lisp.

After recent changes sys-pkg.lisp is only used for Aldor
support and eliminating it simplifies Makefile logic.
The patch also make depsys smaller -- it no longer
contains 'foam_l' and 'axext_l' (actually this is step
towards completely removing depsys).

In the past similar change broke Aldor compatibility.  I hope
that this time it will work, but do not want to apply it
without testing with Aldor.

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

Index: src/interp/Makefile.in
===================================================================
--- src/interp/Makefile.in      (revision 1270)
+++ src/interp/Makefile.in      (working copy)
@@ -19,7 +19,7 @@
 
 DEPSYS=        $(fricas_build_bindir)/depsys
 
-DEP=  vmlisp macros parsing primitives foam_l axext_l
+DEP=  vmlisp macros parsing primitives
 
 LOADSYS= $(fricas_build_bindir)/lisp$(EXEEXT)
 SAVESYS= $(fricas_build_bindir)/interpsys$(EXEEXT)
@@ -59,7 +59,7 @@
 
 BROBJS= $(patsubst %, ${AUTO}/%.$(LISPOBJEXT), $(BROBJ_files))
 
-ASCOMP_files= hashcode as foam_l axext_l
+ASCOMP_files= hashcode as foam_l
 
 ASCOMP= $(patsubst %, %.$(LISPOBJEXT), $(ASCOMP_files))
 
@@ -73,8 +73,7 @@
 .PRECIOUS:     ${SAVESYS}
 .PRECIOUS:     ${AXIOMSYS}
 
-PROCLAIMS=(progn (load "$(srcdir)/sys-pkg.lisp") \
-                 (load "$(srcdir)/interp-proclaims.lisp"))
+PROCLAIMS=(progn (load "$(srcdir)/interp-proclaims.lisp"))
 
 .SUFFIXES:
 .SUFFIXES: .boot .clisp .lisp .pamphlet
@@ -132,7 +131,6 @@
 
 ${SAVESYS} ${AXIOMSYS}: makeint.lisp \
     ${DEPSYS} ${OBJS}  util.$(LISPOBJEXT) \
-    $(srcdir)/sys-pkg.lisp \
     ${OCOBJS} ${BROBJS} \
     database.date ${INOBJS} ${ASCOMP} ${ASAUTO} \
     ${NAGBROBJS} \
@@ -177,7 +175,7 @@
        ls $@
        @ echo 6 ${SAVESYS} created
 
-${DEPSYS}:     $(patsubst %, $(srcdir)/%.lisp, ${DEP} sys-pkg util)
+${DEPSYS}:     $(patsubst %, $(srcdir)/%.lisp, ${DEP} util)
        @ echo 3 making ${DEPSYS}
        $(mkinstalldirs) $(fricas_build_bindir)
        echo '${PROCLAIMS}' > makedep.lisp
@@ -190,14 +188,10 @@
            echo '(maybe-compile "$(srcdir)/'$$A'.lisp"' \
                 '"'$$A'.$(LISPOBJEXT)")' >> makedep.lisp ; \
        done
-       echo '#-(OR :GCL :CMU)(maybe-compile "$(srcdir)/sys-pkg.lisp"' \
-                    '"sys-pkg.$(LISPOBJEXT)")' >> makedep.lisp
        echo '(quit)' >> makedep.lisp
        echo '(load "makedep.lisp")' | ${LOADSYS}
        echo '(in-package "FRICAS-LISP")' > makedep2.lisp
        echo '(make-program "$(BASE)$@" (quote (' >> makedep2.lisp
-       echo '#+(OR :GCL :CMU)"$(srcdir)/sys-pkg.lisp"' \
-            '#-(OR :GCL :CMU)"sys-pkg.$(LISPOBJEXT)"' >> makedep2.lisp
        echo '#+:GCL"$(srcdir)/interp-proclaims.lisp"' >> makedep2.lisp
        for A in util ${DEP} ; do \
               echo '"'$$A'.$(LISPOBJEXT)"' >> makedep2.lisp ; \
Index: src/interp/util.lisp
===================================================================
--- src/interp/util.lisp        (revision 1270)
+++ src/interp/util.lisp        (working copy)
@@ -402,7 +402,7 @@
   (progn
       (setf FRICAS-LISP::*fricas-initial-lisp-objects*
            (append FRICAS-LISP::*fricas-initial-lisp-objects*
-                   '("sys-pkg.o" "util.o")
+                   '("util.o")
                    load-files))
       (dolist (el `(
                     ("comp-files" ,comp-files)
Index: src/interp/foam_l.lisp
===================================================================
--- src/interp/foam_l.lisp      (revision 1270)
+++ src/interp/foam_l.lisp      (working copy)
@@ -46,6 +46,7 @@
 
 (in-package "FOAM")
 
+(eval-when (:execute :compile-toplevel :load-toplevel)
 (export '(
  compile-as-file cases
 
@@ -149,6 +150,7 @@
  axiomxl-file-init-name
  axiomxl-global-name
 ))
+)
 
 
 ;; type defs for Foam types
@@ -876,3 +878,174 @@
        ( (or (atom u) (atom v)) nil)
        ( (|politicallySound| (car u) (car v)) (|magicEq1| (cdr u) (cdr v)))
        (t nil) ))
+
+
+(in-package "FOAM-USER")
+
+
+;; Literals should be null-terminated strings
+
+;; SingleInteger
+
+(defmacro |AXL-LiteralToSingleInteger| (l)
+  `(parse-integer ,l :junk-allowed t))
+
+(defmacro |AXL-LiteralToInteger| (l)
+  `(parse-integer ,l :junk-allowed t))
+
+(defmacro |AXL-LiteralToDoubleFloat| (l)
+  `(read-from-string ,l nil (|DFlo0|)
+                     :preserve-whitespace t))
+
+(defmacro |AXL-LiteralToString| (l)
+  `(subseq ,l 0 (- (length ,l) 1)))
+
+(defmacro |AXL-SingleIntegerToInteger| (si)
+  `(coerce (the |SInt| ,si) |BInt|))
+
+(defmacro |AXL-StringToFloat| (s)
+  `(boot::|string2Float| ,s))
+
+(defmacro |AXL-IntegerIsNonNegative| (i)
+  `(not (< ,i 0)))
+
+(defmacro |AXL-IntegerIsPositive| (i)
+  `(< 0 (the |BInt| ,i)))
+
+(defmacro |AXL-plusInteger| (a b)
+  `(the |BInt| (+ (the |BInt| ,a)
+                  (the |BInt| ,b))))
+
+(defmacro |AXL-minusInteger| (a b)
+  `(the |BInt| (- (the |BInt| ,a)
+                  (the |BInt| ,b))))
+
+(defmacro |AXL-timesInteger| (a b)
+  `(the |BInt| (* (the |BInt| ,a)
+                  (the |BInt| ,b))))
+
+(defmacro |AXL-eqInteger| (a b)
+  `(= (the |BInt| ,a)
+      (the |BInt| ,b)))
+
+(defmacro |AXL-ltInteger| (a b)
+  `(< (the |BInt| ,a)
+      (the |BInt| ,b)))
+
+(defmacro |AXL-leInteger| (a b)
+  `(<= (the |BInt| ,a)
+       (the |BInt| ,b)))
+
+(defmacro |AXL-gtInteger| (a b)
+  `(> (the |BInt| ,a)
+      (the |BInt| ,b)))
+
+(defmacro |AXL-geInteger| (a b)
+  `(>= (the |BInt| ,a)
+       (the |BInt| ,b)))
+
+(defmacro |AXL-plusSingleInteger| (a b)
+  `(the |SInt| (+ (the |SInt| ,a)
+                  (the |SInt| ,b))))
+
+(defmacro |AXL-minusSingleInteger| (a b)
+  `(the |SInt| (- (the |SInt| ,a)
+                  (the |SInt| ,b))))
+
+(defmacro |AXL-timesSingleInteger| (a b)
+  `(the |SInt| (* (the |SInt| ,a)
+                  (the |SInt| ,b))))
+
+(defmacro |AXL-eqSingleInteger| (a b)
+  `(= (the |SInt| ,a)
+      (the |SInt| ,b)))
+
+(defmacro |AXL-ltSingleInteger| (a b)
+  `(< (the |SInt| ,a)
+      (the |SInt| ,b)))
+
+(defmacro |AXL-leSingleInteger| (a b)
+  `(<= (the |SInt| ,a)
+       (the |SInt| ,b)))
+
+(defmacro |AXL-gtSingleInteger| (a b)
+  `(> (the |SInt| ,a)
+      (the |SInt| ,b)))
+
+(defmacro |AXL-geSingleInteger| (a b)
+  `(>= (the |SInt| ,a)
+       (the |SInt| ,b)))
+
+(defmacro |AXL-incSingleInteger| (i)
+  `(the |SInt| (+ (the |SInt| ,i) 1)))
+
+(defmacro |AXL-decSingleInteger| (i)
+  `(- (the |SInt| ,i)
+     (the |SInt| 1)))
+
+(defmacro |AXL-onefnSingleInteger|  () '(the |SInt| 1))
+(defmacro |AXL-zerofnSingleInteger| () '(the |SInt| 0))
+
+(defmacro |AXL-cons| (x y)
+  `(cons ,x ,y))
+
+(defmacro |AXL-nilfn| () nil)
+
+(defmacro |AXL-car| (x) `(car ,x))
+
+(defmacro |AXL-cdr| (x) `(cdr ,x))
+
+(defmacro |AXL-null?| (x) `(null ,x))
+
+(defmacro |AXL-rplaca| (x y) `(rplaca ,x ,y))
+
+(defmacro |AXL-rplacd| (x y) `(rplacd ,x ,y))
+
+(defmacro |AXL-error| (msg) `(error ,msg))
+
+;; arrays
+;; 0 based!
+(defmacro |AXL-arrayRef| (arr i)
+  `(|AElt| ,arr ,i))
+
+(defmacro |AXL-arraySet| (arr i v)
+  `(setf (|AElt| ,arr ,i) ,v))
+
+(defmacro |AXL-arrayToList| (x)
+  `(coerce ,x 'list))
+
+(defmacro |AXL-arraySize| (x)
+  `(length ,x))
+
+(defmacro |AXL-arrayNew| (n)
+  `(make-array ,n))
+
+(defmacro |AXL-arrayCopy| (x)
+  `(copy-seq ,x))
+
+;; Vectors
+
+
+;; Testing
+
+(defun |AXL-spitSInt| (x)
+  (print x))
+
+;; tacky but means we can run programs
+
+(eval-when (:execute :compile-toplevel :load-toplevel)
+    (defun H-integer (l e)
+        (|AXL-LiteralToInteger| l))
+
+    (defun  H-string (l e)
+        (|AXL-LiteralToString| l))
+
+    (defun  H-error (l e)
+        (|AXL-error| l))
+)
+
+(eval-when (:execute :load-toplevel)
+    (DEFCONST |G-axclique_string_305639517| (cons #'H-String nil))
+    (DEFCONST |G-axclique_integer_685864888| (cons #'H-integer nil))
+    (DEFCONST |G-axclique_error_011667951| (cons #'H-error nil))
+)

Reply via email to