diff --git a/changelog b/changelog index 9a5b6c4..b02319c 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,5 @@ +20091027 tpd src/axiom-website/patches.html 20091027.01.tpd.patch +20091027 tpd src/interp/vmlisp.lisp remove vmlisp package, conditionals 20091026 tpd src/axiom-website/patches.html 20091026.01.tpd.patch 20091026 tpd src/axiom-website/developers.html identify Scott Penberthy 20091025 tpd src/axiom-website/patches.html 20091025.01.tpd.patch diff --git a/src/axiom-website/patches.html b/src/axiom-website/patches.html index d48505b..571656b 100644 --- a/src/axiom-website/patches.html +++ b/src/axiom-website/patches.html @@ -2173,5 +2173,7 @@ books/bookvol5 fix streamChop line/lyne breakage
books/bookvol5 merge and remove scan.lisp, parini.lisp
20091026.01.tpd.patch src/axiom-website/developers.html identify Scott Penberthy
+20091027.01.tpd.patch +src/interp/vmlisp.lisp remove vmlisp package, conditionals
diff --git a/src/interp/vmlisp.lisp.pamphlet b/src/interp/vmlisp.lisp.pamphlet index 44b5b94..6eeab54 100644 --- a/src/interp/vmlisp.lisp.pamphlet +++ b/src/interp/vmlisp.lisp.pamphlet @@ -31,8 +31,7 @@ HASHEQ HASHUEQUAL HASHCVEC HASHID HASHTABLEP CVEC UEQUAL ID HPUTPROP HASHTABLE-CLASS)) -#-:common-lisp - (setq *features* (adjoin :common-lisp *features*)) +(setq *features* (adjoin :common-lisp *features*)) ;; DEFVARS @@ -55,7 +54,6 @@ (defmacro absval (x) `(abs ,x)) -#-:CCL (defmacro add1 (x) `(1+ ,x)) @@ -66,18 +64,11 @@ (defmacro applx (&rest args) `(apply ,@args)) -#-(or LispM Lucid :CCL) (defmacro assq (a b) `(assoc ,a ,b :test #'eq)) -#+:CCL -(defmacro assq (a b) `(atsoc ,a ,b)) - -#-:CCL (defmacro bintp (n) `(typep ,n 'bignum)) -#+:CCL -(defun bintp (n) (and (integerp n) (not (fixp n)))) (defmacro |char| (x) (if (and (consp x) (eq (car x) 'quote)) (character (cadr x)) @@ -97,11 +88,9 @@ (defmacro dcq (&rest args) (cons 'setqp args)) -#-Lucid (defmacro define-macro (f v) `(setf (macro-function ,f) (macro-function ,v))) -#-:CCL (defmacro difference (&rest args) `(- ,@args)) @@ -111,7 +100,6 @@ (defmacro ecq (&rest args) (cons 'eqq args)) -#-:CCL (defmacro eqcar (x y) (let ((test (cond @@ -139,11 +127,9 @@ (defmacro fetchchar (x i) `(char ,x ,i)) -#-:CCL ;; fixp in ccl tests for fixnum (defmacro fixp (x) `(integerp ,x)) -#-:CCL (defmacro greaterp (&rest args) `(> ,@args)) @@ -187,7 +173,6 @@ (defmacro lastpair (l) `(last ,l)) -#-:CCL (defmacro lessp (&rest args) `(< ,@args)) @@ -202,11 +187,9 @@ (defmacro maxindex (x) `(the fixnum (1- (the fixnum (length ,x))))) -#-(or LispM Lucid :CCL) (defmacro memq (a b) `(member ,a ,b :test #'eq)) -#-:CCL (defmacro minus (x) `(- ,x)) @@ -220,10 +203,8 @@ (defmacro ne (a b) `(not (equal ,a ,b))) ;;; This may need adjustment in CCL where NEQ means (NOT (EQUAL ..))) -#-:CCL (defmacro neq (a b) `(not (eq ,a ,b))) -#-:CCL (defmacro nreverse0 (x) (if (atom x) `(if (atom ,x) ,x (nreverse ,x)) @@ -247,31 +228,27 @@ (defmacro pairp (x) `(consp ,x)) -#-:CCL (defmacro plus (&rest args) `(+ ,@ args)) -; (defmacro qassq (a b) -; `(assoc ,a ,b :test #'eq)) (defmacro qassq (a b) `(assq ,a ,b)) -#-:CCL (defmacro qcar (x) `(car (the cons ,x))) -#-:CCL + (defmacro qcdr (x) `(cdr (the cons ,x))) -#-:CCL + (defmacro qcaar (x) `(car (the cons (car (the cons ,x))))) -#-:CCL + (defmacro qcadr (x) `(car (the cons (cdr (the cons ,x))))) -#-:CCL + (defmacro qcdar (x) `(cdr (the cons (car (the cons ,x))))) -#-:CCL + (defmacro qcddr (x) `(cdr (the cons (cdr (the cons ,x))))) @@ -334,8 +311,6 @@ (defmacro qlength (a) `(length ,a)) -; (defmacro qmemq (a b) -; `(member ,a ,b :test #'eq)) (defmacro qmemq (a b) `(memq ,a ,b)) (defmacro qrefelt (vec ind) @@ -431,11 +406,6 @@ (defmacro qvsize (x) `(the fixnum (length (the simple-vector ,x)))) -; #-:CCL -; (defmacro refvecp (v) -; `(typep ,v '(vector t))) -; #+:CCL -; (defun refvecp (v) (and (vectorp v) (not (stringp v)))) (defmacro refvecp (v) `(simple-vector-p ,v)) (defmacro resetq (a b) @@ -457,7 +427,6 @@ (setq ,id ,item) (lam\,fileactq ',id (list 'setq ',id (list 'quote ,id))))) -#-:CCL (defmacro setelt (vec ind val) `(setf (elt ,vec ,ind) ,val)) @@ -483,19 +452,11 @@ (defmacro |shoeread-line| (st) `(read-line ,st nil nil)) -#-:CCL (defmacro sintp (n) `(typep ,n 'fixnum)) -#+:CCL -(defmacro sintp (n) - `(fixp ,n)) -#-:CCL (defmacro smintp (n) `(typep ,n 'fixnum)) -#+:CCL -(defmacro smintp (n) - `(fixp ,n)) (defmacro |startsId?| (x) `(or (alpha-char-p ,x) (member ,x '(#\? #\% #\!) :test #'char=))) @@ -506,70 +467,38 @@ (defmacro subrp (x) `(compiled-function-p ,x)) -#-:CCL (defmacro sub1 (x) `(1- ,x)) (defmacro throw-protect (exp1 exp2) `(unwind-protect ,exp1 ,exp2)) -#-:CCL (defmacro times (&rest args) `(* ,@args)) (defmacro vec-setelt (vec ind val) `(setf (svref ,vec ,ind) ,val)) -; #-:CCL -; (defmacro vecp (v) -; `(typep ,v '(vector t))) -; #+:CCL -; (defun vecp (v) (and (vectorp v) (not (stringp v)))) (defmacro vecp (v) `(simple-vector-p ,v)) -#-:CCL (defmacro zero? (x) `(and (typep ,x 'fixnum) (zerop (the fixnum ,x)))) -#+:CCL -(defmacro zero? (x) `(zerop ,x)) ;; defuns -#-(or :CCL (and :Lucid (not :rios))) (defun define-function (f v) (setf (symbol-function f) v)) -#+:CCL -(defun define-function (f v) - (setf (symbol-function f) v) - (setf (get f 's:newname) v)) (define-function 'tempus-fugit #'get-internal-run-time) (defun $TOTAL-ELAPSED-TIME () (list (get-internal-run-time) (get-internal-real-time))) -#-(OR IBCL KCL :CMULISP :CCL) -(defun $TOTAL-GC-TIME () (list 0 0)) - -#+:CCL -(defun $TOTAL-GC-TIME () (list (gctime) (gctime))) - -#+IBCL -(defun $TOTAL-GC-TIME (&aux (gcruntime (system:gbc-time-report))) - (list gcruntime gcruntime)) - -#+KCL (defun $TOTAL-GC-TIME (&aux (gcruntime (system:gbc-time))) (if (minusp gcruntime) (setq gcruntime (system:gbc-time 0))) (list gcruntime gcruntime)) -;;; note: this requires the 11/9/89 gc patch in code/lisp/daly/misc.lisp -#+:cmulisp -(defun $TOTAL-GC-TIME () - (declare (special ext::*gc-runtime* ext::*gc-walltime*)) - (list ext::*gc-runtime* ext::*gc-walltime*)) - ; 7.0 Macros ; 7.2 Creating Macro Expressions @@ -644,8 +573,6 @@ (cond ((atom (car fnlist)) (list (COMPILE1 fnlist))) (t (MAPCAR #'(lambda (x) (COMPILE1 x)) fnlist)))) -#+:CCL (proclaim '(special *vars* *decl*)) ;; declare not handled right - (defun COMPILE1 (fn) (let* (nargs (fname (car fn)) @@ -663,8 +590,7 @@ (setq args (remove-fluids (cadr lamda))) (cond ((and (eq ltype 'lambda) (simple-arglist args)) (setq nargs args)) (t (setq nargs (gensym)) - #+LispM (setq body `((dsetq ,args (copy-list ,nargs)) ,@body)) - #-LispM (setq body `((dsetq ,args ,nargs) ,@body)) + (setq body `((dsetq ,args ,nargs) ,@body)) (cond ((eq ltype 'lambda) (setq nargs `(&rest ,nargs &aux ,@*vars*))) ((eq ltype 'mlambda) (setq nargs `(&whole ,nargs &rest ,(gensym) &aux ,@*vars*))) @@ -716,7 +642,6 @@ ; 9.5 Identifiers -#-:CCL (defun gensymp (x) (and (symbolp x) (null (symbol-package x)))) (defun digitp (x) @@ -729,30 +654,18 @@ (digit-char-p (char (symbol-name x) 0)) (digit-char-p x))) -#-:CCL (defun LN (x) (LOG x)) -#-:CCL + (defun LOG2 (x) (LOG x 2.0)) (defun |log| (x) (LOG x 10.0)) ; 9.13 Streams -#+Lucid -(defun IS-CONSOLE (stream) - (and (streamp stream) - (or (not (consp (pathname-directory stream))) - (equal (qcar (pathname-directory stream)) "dev") - (null (pathname-name stream) )))) - -#+KCL (defun IS-CONSOLE (stream) (and (streamp stream) (output-stream-p stream) (eq (system:fp-output-stream stream) (system:fp-output-stream *terminal-io*)))) -#-(OR Lucid KCL :CCL) -(defun IS-CONSOLE (stream) (EQ stream *terminal-io*)) - ; 10.0 Control Structures ; 10.8.4 Auxiliary Operators @@ -795,10 +708,7 @@ ;; property lists in vmlisp are alists (defun PROPLIST (x) (if (symbolp x) -#-:CCL (plist2alist (symbol-plist x)) -#+:CCL - (plist2alist (plist x)) nil)) (defun plist2alist (x) @@ -806,7 +716,6 @@ nil (cons (cons (first x) (second x)) (plist2alist (cddr x))))) -#-:CCL (defun put (sym ind val) (setf (get sym ind) val)) (define-function 'MAKEPROP #'put) @@ -893,24 +802,17 @@ the calculation by repeated divisions using the radix itself. ;(define-function 'minus #'-) ;(define-function 'absval #'abs) -#-:CCL (defun QUOTIENT (x y) (cond ((or (floatp x) (floatp y)) (lisp:/ x y)) (t (truncate x y)))) -#+:CCL -(defun QUOTIENT (x y) - (cond ((or (floatp x) (floatp y)) (/ x y)) - (t (truncate x y)))) (define-function 'vm/ #'quotient) -#-:CCL (defun REMAINDER (x y) (if (and (integerp x) (integerp y)) (rem x y) (- x (* y (QUOTIENT x y))))) -#-:CCL (defun DIVIDE (x y) (if (and (integerp x) (integerp y)) (multiple-value-list (truncate x y)) @@ -1046,9 +948,7 @@ can be restored. ;; is compiled and the latter is byte-coded! (defun size (l) (cond ((vectorp l) (length l)) -#+:CCL ((stringp l) (length l)) ;; Until ACN fixes his lisp -> C translator. -#-:CCL ((consp l) (list-length l)) -#+:CCL ((consp l) (length l)) + ((consp l) (list-length l)) (t 0))) (define-function 'MOVEVEC #'replace) @@ -1103,14 +1003,6 @@ can be restored. ; 17.3 Searching -;;- (defun strpos (what in start dontcare) -;;- (setq what (string what) in (string in)) -;;- (if dontcare (progn (setq dontcare (character dontcare)) -;;- (search what in :start2 start -;;- :test #'(lambda (x y) (or (eql x dontcare) -;;- (eql x y))))) -;;- (search what in :start2 start))) - (defun strpos (what in start dontcare) (setq what (string what) in (string in)) (if dontcare (progn (setq dontcare (character dontcare)) @@ -1152,23 +1044,6 @@ can be restored. (defun trimstring (x) x) -;;-- (defun rplacstr (cvec1 start1 length1 cvec2 -;;-- &optional (start2 0) (length2 nil) -;;-- &aux end1 end2) -;;-- (setq cvec2 (string cvec2)) -;;-- (if (null start1) (setq start1 0)) -;;-- (if (null start2) (setq start2 0)) -;;-- (if (null length1) (setq length1 (- (length cvec1) start1))) -;;-- (if (null length2) (setq length2 (- (length cvec2) start2))) -;;-- (if (numberp length1) (setq end1 (+ start1 length1))) -;;-- (if (numberp length2) (setq end2 (+ start2 length2))) -;;-- (if (/= length1 length2) -;;-- (concatenate 'string (subseq cvec1 0 start1) -;;-- (subseq cvec2 start2 end2) -;;-- (subseq cvec1 end1)) -;;-- (replace cvec1 cvec2 :start1 start1 :end1 end1 -;;-- :start2 start2 :end2 end2))) - ; The following version has been provided to avoid reliance on the ; Common Lisp concatenate and replace functions. These built-in Lisp ; functions would probably end up doing the character-by-character @@ -1192,8 +1067,7 @@ can be restored. (setq start1 (1+ start1)) (setq start2 (1+ start2))) (let* ((l1 (length cvec1)) -#+:CCL (r (lisp::make-simple-string (- (+ l1 length2) length1))) -#-:CCL (r (lisp::make-string (- (+ l1 length2) length1))) + (r (lisp::make-string (- (+ l1 length2) length1))) (i 0)) (do ((j 0 (1+ j))) ((= j start1)) @@ -1535,9 +1409,7 @@ The princ-to-string function assumes *print-escape* is nil and works properly. <<*>>= -;(define-function 'prin2cvec #'write-to-string) (define-function 'prin2cvec #'princ-to-string) -;(define-function 'stringimage #'write-to-string) (define-function 'stringimage #'princ-to-string) (define-function 'printexp #'princ) (define-function 'prin0 #'prin1) @@ -1574,9 +1446,7 @@ and works properly. (defun EMBEDDED () (mapcar #'car *embedded-functions*)) (defun EMBED (CURRENT-BINDING NEW-DEFINITION) - (PROG -#+:CCL (OP BV BODY OLD-DEF *COMP) -#-:CCL (OP BV BODY OLD-DEF) + (PROG (OP BV BODY OLD-DEF) (COND ( (NOT (IDENTP CURRENT-BINDING)) (SETQ CURRENT-BINDING @@ -1599,17 +1469,13 @@ and works properly. ( 'T `((LAMBDA (,CURRENT-BINDING) ,NEW-DEFINITION) ',OLD-DEF))) ) ) -#+:CCL (IF (CONSP NEW-DEFINITION) (SETQ NEW-DEFINITION (CDR NEW-DEFINITION))) (push (LIST CURRENT-BINDING NEW-DEFINITION OLD-DEF) *embedded-functions*) (RETURN CURRENT-BINDING) ) ) (defun UNEMBED (CURRENT-BINDING) - (PROG -#+:CCL (TMP E-LIST CUR-DEF *COMP) -#-:CCL (TMP E-LIST CUR-DEF) + (PROG (TMP E-LIST CUR-DEF) (SETQ E-LIST *embedded-functions*) (SETQ CUR-DEF (symbol-function CURRENT-BINDING)) -#+:CCL (IF (CONSP CUR-DEF) (SETQ CUR-DEF (CDR CUR-DEF))) (COND ( (NOT (consp E-LIST)) NIL ) @@ -1727,14 +1593,6 @@ and works properly. (LIST "in the expression:" MESSAGE)) ()) -#+Lucid -(defun numberofargs (x) - (setq x (system::arglist x)) - (let ((nx (- (length x) (length (memq '&aux x))))) - (if (memq '&rest x) (setq nx (- (1- nx)))) - (if (memq '&optional x) (setq nx (- (1- (abs nx))))) - nx)) - ; 98.0 Stuff Not In The VMLisp Manual That We Like ; A version of GET that works with lists @@ -1780,39 +1638,11 @@ and works properly. (declare (ignore item)) nil) ;no partial application objects -#+Lucid -(defun gcmsg (x) - (prog1 (not system::*gc-silence*) (setq system::*gc-silence* (not x)))) -#+(OR IBCL KCL) (defun gcmsg (x) (prog1 system:*gbc-message* (setq system:*gbc-message* x))) -#+:cmulisp -(defun gcmsg (x) - (prog1 ext:*gc-verbose* (setq ext:*gc-verbose* x))) -#+:allegro -(defun gcmsg (x)) - -#+Lucid -(defun reclaim () (system:gc)) -#+:cmulisp -(defun reclaim () (ext:gc)) -#+(OR IBCL KCL) -(defun reclaim () (gbc t)) -#+:allegro -(defun reclaim () (excl::gc t)) -#+:CCL -(defun reclaim () (gc)) -#+Lucid -(defun BPINAME (func) - (if (functionp func) - (if (symbolp func) func - (let ((name (svref func 0))) - (if (and (consp name) (eq (car name) 'SYSTEM::NAMED-LAMBDA)) - (cadr name) - name)) ))) +(defun reclaim () (gbc t)) -#+(OR IBCL KCL) (defun BPINAME (func) (if (functionp func) (cond ((symbolp func) func) @@ -1821,58 +1651,17 @@ and works properly. ((compiled-function-p func) (system:compiled-function-name func)) ('t func)))) -#+:cmulisp -(defun BPINAME (func) - (when (functionp func) - (cond - ((symbolp func) func) - ((and (consp func) (eq (car func) 'lambda)) (second (third func))) - ((compiled-function-p func) - (system::%primitive header-ref func system::%function-name-slot)) - ('else func)))) -#+:allegro -(defun bpiname (func) - func) -#+:CCL -(defun bpiname (x) - (if (symbolp x) - (intern (symbol-name (symbol-function x)) "BOOT") - nil)) (defun LISTOFQUOTES (bpi) (declare (ignore bpi)) ()) -#+Lucid -(defun LISTOFFREES (bpi) - (if (compiled-function-p bpi) - (let ((end (- (lucid::procedure-length bpi) 2))) - (do ((i 3 (1+ i)) - (ans nil)) - ((> i end) ans) - (let ((locexp (svref bpi i))) - (if (symbolp locexp) (push locexp ans))))))) - -#-Lucid (defun LISTOFFREES (bpi) (declare (ignore bpi)) ()) - -#+(and :Lucid (not :ibm/370)) -(defun OBEY (S) - (system::run-aix-program (make-absolute-filename "/lib/obey") - :arguments (list "-c" S))) -#+:cmulisp -(defun OBEY (S) - (ext:run-program (make-absolute-filename "/lib/obey") - (list "-c" S) :input t :output t)) -#+(OR IBCL KCL :CCL) (defun OBEY (S) (SYSTEM S)) -#+:allegro -(defun OBEY (S) (excl::run-shell-command s)) - (defun RE-ENABLE-INT (number-of-handler) number-of-handler) (defun equable (x) ;;def needed to prevent recursion in def of eqcar @@ -2064,8 +1853,7 @@ and works properly. ((EQ ID) #'eq) (CVEC #'equal) (EQL #'eql) - #+Lucid ((UEQUAL EQUALP) #'EQUALP) - #-Lucid ((UEQUAL EQUAL) #'equal) + ((UEQUAL EQUAL) #'equal) (otherwise (error "bad arg to make-hashtable"))))) (make-hash-table :test test))) @@ -2080,9 +1868,6 @@ and works properly. #'(lambda (key val) (declare (ignore val)) (push key keys)) table) keys)) -#+Lucid -(define-function 'HASHTABLE-CLASS #'system::hash-table-test) - @ The static declaration causes a problem as of GCL-2.6.8pre. Camm issued a fix. This used to read: @@ -2091,15 +1876,12 @@ Camm issued a fix. This used to read: (clines "static int mem_value(x ,i)object x;int i; { return ((short *)x)[i];}") \end{verbatim} <<*>>= -#+AKCL (clines "int mem_value(x ,i)object x;int i; { return ((short *)x)[i];}") -#+AKCL (defentry memory-value-short(object int) (int "mem_value")) ;(memory-value-short (make-hash-table :test 'equal) 12) is 0,1,or 2 ;depending on whether the test is eq,eql or equal. -#+AKCL (defun HASHTABLE-CLASS (table) (case (memory-value-short table 12) (0 'EQ) @@ -2107,14 +1889,6 @@ Camm issued a fix. This used to read: (2 'EQUAL) (t "error unknown hash table class"))) -#+:CCL -(defun HASHTABLE-CLASS (table) - (case (hashtable-flavour table) - (0 'EQ) - (1 'EQL) - (2 'EQUAL) - (t (format nil "error unknown hash table class ~a" (hashtable-flavour table))))) - (define-function 'HCOUNT #'hash-table-count) ;17.4 Searching and Updating @@ -2271,9 +2045,9 @@ Camm issued a fix. This used to read: (QRPLACD V (SETQ V (CONS I NIL))) ) ) (GO LP1) ) ) -#+:AKCL (defvar *lisp-bin-filetype* "o") +(defvar *lisp-bin-filetype* "o") -#+:AKCL (defvar *lisp-source-filetype* "lsp") +(defvar *lisp-source-filetype* "lsp") ;; definition of our stream structure (defstruct libstream mode dirname (indextable nil) (indexstream nil)) @@ -2294,7 +2068,6 @@ Camm issued a fix. This used to read: (defun directory? (filename) (|directoryp| filename)) ;; (RDEFIOSTREAM ((MODE . IO) (FILE fn ft dir))) IO is I,O,INPUT,OUTPUT -#+:AKCL (defun rdefiostream (options &optional (missing-file-error-flag t)) (let ((mode (cdr (assoc 'mode options))) (file (assoc 'file options)) @@ -2327,36 +2100,7 @@ Camm issued a fix. This used to read: :indexstream stream )) ('t (ERROR "Unknown MODE"))))) -#+:CCL -(defun rdefiostream (options &optional (missing-file-error-flag t)) - (let ((mode (cdr (assoc 'mode options))) - (file (assoc 'file options)) - (stream nil) - (fullname nil) - (indextable nil)) - (cond ((equal (elt (string mode) 0) #\I) - (setq fullname (make-input-filename (cdr file) NIL)) - (setq stream (get-input-index-stream fullname)) - (if (null stream) - (if missing-file-error-flag - (ERROR (format nil "Library ~s doesn't exist" - (make-filename (cdr file) NIL))) - NIL) - (make-libstream :mode 'input :dirname fullname - :indextable (get-index-table-from-stream stream) - :indexstream stream))) - ((equal (elt (string mode) 0) #\O) - (setq fullname (make-full-namestring (cdr file) NIL)) - (create-directory fullname) - (multiple-value-setq (stream indextable) - (get-io-index-stream fullname)) - (make-libstream :mode 'output :dirname fullname - :indextable indextable - :indexstream stream )) - ('t (ERROR "Unknown MODE"))))) - -#+:AKCL (defvar *index-filename* "index.kaf") -#+:CCL (defvar *index-filename* "index.kaf") +(defvar *index-filename* "index.kaf") ;get the index table of the lisplib in dirname (defun getindextable (dirname) @@ -2378,7 +2122,6 @@ Camm issued a fix. This used to read: (read stream)) (t pos)))) -#+:AKCL (defun get-io-index-stream (dirname) (let* ((index-file (concat dirname "/" *index-filename*)) (stream (open index-file :direction :io :if-exists :overwrite @@ -2394,24 +2137,6 @@ Camm issued a fix. This used to read: (setq indextable pos))) (values stream indextable))) -#+:CCL -(defun get-io-index-stream (dirname) - (let ((index-file (concat dirname "/" *index-filename*)) - (indextable ()) - (stream) (pos)) - (cond ((probe-file index-file) - (setq stream (open index-file :direction :io :if-exists :overwrite)) - (setq pos (read stream)) - (file-position stream pos) - (setq indextable (read stream)) - (file-position stream pos)) - (t (setq stream (open index-file :direction :io - :if-does-not-exist :create)) - ;(file-position stream 0) - (princ " " stream))) - (values stream indextable))) - - ;substitute indextable in dirname (defun write-indextable (indextable stream) @@ -2422,14 +2147,6 @@ Camm issued a fix. This used to read: (princ pos stream) (finish-output stream))) -;;#+:ccl -;;(defun putindextable (indextable dirname) -;; (with-open-file -;; (stream (concat dirname "/" *index-filename*) -;; :direction :io :if-does-not-exist :create) -;; (file-position stream :end) -;; (write-indextable indextable stream))) -;;#-:ccl (defun putindextable (indextable dirname) (with-open-file (stream (concat dirname "/" *index-filename*) @@ -2439,7 +2156,6 @@ Camm issued a fix. This used to read: (write-indextable indextable stream))) ;makedir (fname) fname is a directory name. -#+:AKCL (defun makedir (fname) (system (concat "mkdir " fname))) @@ -2528,9 +2244,7 @@ do the compile, and then rename the result back to code.o. (defun rpackfile (filespec) (setq filespec (make-filename filespec)) (if (string= (pathname-type filespec) "nrlib") -#-:GCL (recompile-lib-file-if-necessary - (concat (namestring filespec) "/code.lsp")) -#+:GCL (let* ((base (pathname-name filespec)) + (let* ((base (pathname-name filespec)) (code (concatenate 'string (namestring filespec) "/code.lsp")) (temp (concatenate 'string (namestring filespec) "/" base ".lsp")) (o (make-pathname :type "o"))) @@ -2561,7 +2275,6 @@ do the compile, and then rename the result back to code.o. (rshut nrstream))) filespec) -#+:AKCL (defun recompile-lib-file-if-necessary (lfile) (let* ((bfile (make-pathname :type *lisp-bin-filetype* :defaults lfile)) (bdate (and (probe-file bfile) (file-write-date bfile))) @@ -2570,28 +2283,6 @@ do the compile, and then rename the result back to code.o. (if (and bdate (> bdate ldate)) nil (progn (compile-lib-file lfile) (list bfile)))))) -#+:CCL -(defun recompile-lib-file-if-necessary (lfile) - (let ( (mname (pathname-name (file-namestring (directory-namestring lfile)))) - (mdate (modulep mname)) - (ldate (filedate lfile)) ) - (if (or (not mdate) (datelessp mdate ldate)) - (seq - (if (null output-library) - (boot::|openOutputLibrary| - (setq boot::|$outputLibraryName| - (if (null boot::|$outputLibraryName|) - (make-pathname :directory (get-current-directory) - :name "user.lib") - (if (filep boot::|$outputLibraryName|) - (truename boot::|$outputLibraryName|) - boot::|$outputLibraryName|))))) - (compile-file lfile - :output-file (intern (pathname-name - (directory-namestring lfile)))))))) - - -#+:AKCL (defun spad-fixed-arg (fname ) (and (equal (symbol-package fname) (find-package "BOOT")) (not (get fname 'compiler::spad-var-arg)) @@ -2600,7 +2291,6 @@ do the compile, and then rename the result back to code.o. (setf (get fname 'compiler::fixed-args) t))) nil) -#+:AKCL (defun compile-lib-file (fn &rest opts) (unwind-protect (progn @@ -2611,8 +2301,6 @@ do the compile, and then rename the result back to code.o. :entrycond (spad-fixed-arg (caar system::arglist)))) (apply #'compile-file fn opts)) (untrace compiler::fast-link-proclaimed-type-p compiler::t1defun))) -#+:CCL -(define-function 'compile-lib-file #'compile-file) ;; (RDROPITEMS filearg keys) don't delete, used in files.spad (defun rdropitems (filearg keys &aux (ctable (getindextable filearg))) @@ -2713,12 +2401,10 @@ do the compile, and then rename the result back to code.o. (copy-file name1 name2)))) -#+(OR :AKCL (AND :CCL :UNIX)) (defun copy-lib-directory (name1 name2) (makedir name2) (system (concat "sh -c 'cp " name1 "/* " name2 "'"))) -#+(OR :AKCL (AND :CCL :UNIX)) (defun copy-file (namestring1 namestring2) (system (concat "cp " namestring1 " " namestring2))) @@ -2744,13 +2430,11 @@ do the compile, and then rename the result back to code.o. (in-package 'boot) -#+(or :cmu :akcl :gcl) (defun manexp (u) (multiple-value-bind (f e s) (decode-float u) (cons (* s f) e))) -#+:(or :cmu :akcl :gcl) (defun acot (a) (if (> a 0.0) (if (> a 1.0) @@ -2760,7 +2444,6 @@ do the compile, and then rename the result back to code.o. (- pi (atan (/ -1.0 a))) (+ (/ pi 2.0) (atan (- a)))))) -#+:(or :cmu :akcl :gcl) (defun cot (a) (if (or (> a 1000.0) (< a -1000.0)) (/ (cos a) (sin a)) @@ -2845,7 +2528,6 @@ do the compile, and then rename the result back to code.o. (export '(,p) "BOOT"))) (def-boot-fun |updateSourceFiles| (x) "temp def") -#-:CCL (def-boot-val |$timerTicksPerSecond| INTERNAL-TIME-UNITS-PER-SECOND "for TEMPUS-FUGIT and $TOTAL-ELAPSED-TIME") (def-boot-val $boxString @@ -3255,15 +2937,10 @@ for primitive domains. Also used by putInLocalDomainReferences and optCal.") ;; the car of the first arg is always of the same type as the second ;; use eql unless we are sure fixnums are represented canonically -#-lucid (defmacro qeqcar (x y) (if (integerp y) `(eql (the fixnum (qcar ,x)) (the fixnum ,y)) `(eq (qcar ,x) ,y))) -#+lucid -(defmacro qeqcar (x y) `(eq (qcar ,x) ,y)) - - (defun COMPARE (X Y) "True if X is an atom or X and Y are lists and X and Y are equal up to X." (COND ((ATOM X) T) @@ -3685,7 +3362,6 @@ for primitive domains. Also used by putInLocalDomainReferences and optCal.") (CONS (LIST 'SPADLET (CAR VARS) (CAR INITS)) (DO_LET (CDR VARS) (CDR INITS))))) -#-:CCL (defun NREVERSE0 (X) ; Already built-in to CCL "Returns LST, reversed. The argument is modified. This version is needed so that (COLLECT (IN X Y) ... (RETURN 'JUNK))=>JUNK." @@ -3855,10 +3531,6 @@ LP (COND ((NULL X) ((eql n (qvmaxindex vec)) vec) (t (subseq vec 0 (+ n 1)))))) -;; In CCL ASH assumes a 2's complement machine. We use ASH in Integer and -;; assume we have a sign and magnitude setup. -#+:CCL (defmacro ash (u v) `(lisp::ash1 ,u ,v)) - ; 14 SEQUENCES ; 14.1 Simple Sequence Functions @@ -4176,7 +3848,6 @@ if a modemap is only partially complete. If this is true then the modemap will contain the constant \verb|$EmptyMode|. So the call ends up being CONTAINED \verb|$EmptyMode| Y. <<*>>= -#-:CCL (DEFUN CONTAINED (X Y) (if (symbolp x) (contained\,eq X Y) @@ -4526,14 +4197,7 @@ terminals and empty or at-end files. In Common Lisp, we must assume record size (defmacro |elapsedUserTime| () '(get-internal-run-time)) -#+IBCL -(defmacro |elapsedGcTime| () '(system:gbc-time-report)) -#+AKCL (defmacro |elapsedGcTime| () '(system:gbc-time)) -#+:CCL -(defmacro |elapsedGcTime| () '(lisp:gctime)) -#-(OR :CCL IBCL AKCL) -(defmacro |elapsedGcTime| () '0) (defmacro |do| (&rest args) (CONS 'PROGN args)) @@ -5175,7 +4839,6 @@ terminals and empty or at-end files. In Common Lisp, we must assume record size ;; (if (NULL val) |$numericFailure| (cons 0 (car val))))) ;; the following form embeds around the akcl error handler -#+:akcl (eval-when (load eval) (unembed 'system:universal-error-handler) @@ -5430,7 +5093,6 @@ terminals and empty or at-end files. In Common Lisp, we must assume record size (t *package*)))) (POINT RECNO INPUTSTREAM) (READ INPUTSTREAM))))) - #+Lucid(system::compiler-options :messages t :warnings t) (COND ( (SETQ U (GET oft '/TRAN)) (SETQ DEF (FUNCALL U DEF)) ) ) @@ -5450,8 +5112,6 @@ terminals and empty or at-end files. In Common Lisp, we must assume record size (compile (EVAL DEF)))) ( DEF (FUNCALL OP (LIST DEF)) ) ) - #+Lucid(system::compiler-options :messages nil :warnings nil) - #+Lucid(TERPRI) (COND ( TRACEFLAG (/TRACE-2 /FN NIL) ) ) @@ -6274,51 +5934,8 @@ EXAMINE (SETQ RECNO (NOTE INPUTSTREAM)) (PRINT (LIST "CONTOUR LEVEL" CLEV)) (PRINT (mapcar #'car (car W)))))) -#+:CCL -(defun break (&rest ignore) (lisp-break ignore) (lisp::unwind)) - - -#+:CCL -(defun lisp-break (&rest ignore) - (prog (prompt ifile ofile u v) - (setq ifile (rds *debug-io*)) - (setq ofile (wrs *debug-io*)) - (setq prompt (setpchar "Break loop (:? for help)> ")) -top (setq u (read)) - (cond - ((equal u ':x) (go exit)) - ((equal u ':q) - (progn (lisp::enable-backtrace nil) - (princ "Backtrace now disabled") - (terpri))) - ((equal u ':v) - (progn (lisp::enable-backtrace t) - (princ "Backtrace now enabled") - (terpri))) - ((equal u ':?) - (progn - (princ ":Q disables backtrace") - (terpri) - (princ ":V enables backtrace") - (terpri) - (princ ":X exits from break loop") - (terpri) - (princ "else enter LISP expressions for evaluation") - (terpri))) - ((equal u #\eof) - (go exit)) - (t (progn - (setq v (errorset u nil nil)) - (if (listp v) (progn (princ "=> ") (prinl (car v)) (terpri))))) ) - (go top) -exit (rds ifile) - (wrs ofile) - (setpchar prompt) - (return nil))) - (defun lisp-break-from-axiom (&rest ignore) (boot::|handleLispBreakLoop| boot::|$BreakMode|)) -#+:CCL (setq lisp:*break-loop* 'boot::lisp-break-from-axiom) @ \subsection{interrupt} @@ -6326,54 +5943,8 @@ A "resumable" break loop for use in trace etc. Unfortunately this only works for CCL. We need to define a Common Lisp version. For now the function is defined but does nothing. <<*>>= -#-:CCL (defun interrupt (&rest ignore)) -#+:CCL -(defun interrupt (&rest ignore) - (prog (prompt ifile ofile u v) - (setq ifile (rds *debug-io*)) - (setq ofile (wrs *debug-io*)) - (setq prompt (setpchar "Break loop (:? for help)> ")) -top (setq u (read)) - (cond - ((equal u ':x) (go exit)) - ((equal u ':r) (go resume)) - ((equal u ':q) - (progn (lisp::enable-backtrace nil) - (princ "Backtrace now disabled") - (terpri))) - ((equal u ':v) - (progn (lisp::enable-backtrace t) - (princ "Backtrace now enabled") - (terpri))) - ((equal u ':?) - (progn - (princ ":Q disables backtrace") - (terpri) - (princ ":V enables backtrace") - (terpri) - (princ ":R resumes from break") - (terpri) - (princ ":X exits from break loop") - (terpri) - (princ "else enter LISP expressions for evaluation") - (terpri))) - ((equal u #\eof) - (go exit)) - (t (progn - (setq v (errorset u nil nil)) - (if (listp v) (progn (princ "=> ") (prinl (car v)) (terpri))))) ) - (go top) -resume (rds ifile) - (wrs ofile) - (setpchar prompt) - (return nil) -exit (rds ifile) - (wrs ofile) - (setpchar prompt) - (lisp::unwind))) - ; NAME: Scratchpad Package ; PURPOSE: This is an initialization and system-building file for Scratchpad. @@ -6669,28 +6240,12 @@ exit (rds ifile) (defun |sort| (seq spadfn) (sort (copy-seq seq) (function (lambda (x y) (SPADCALL X Y SPADFN))))) -#-Lucid (defun QUOTIENT2 (X Y) (values (TRUNCATE X Y))) -#+Lucid -(defun QUOTIENT2 (X Y) ; following to force error check in division by zero - (values (if (zerop y) (truncate 1 Y) (TRUNCATE X Y)))) - -#-Lucid (define-function 'REMAINDER2 #'REM) -#+Lucid -(defun REMAINDER2 (X Y) - (if (zerop y) (REM 1 Y) (REM X Y))) - -#-Lucid (defun DIVIDE2 (X Y) (multiple-value-call #'cons (TRUNCATE X Y))) -#+Lucid -(defun DIVIDE2 (X Y) - (if (zerop y) (truncate 1 Y) - (multiple-value-call #'cons (TRUNCATE X Y)))) - (defmacro APPEND2 (x y) `(append ,x ,y)) (defmacro |float| (x &optional (y 0.0d0)) `(float ,x ,y)) @@ -7071,28 +6626,18 @@ special. ;; function to create byte and half-word vectors in new runtime system 8/90 -#-:CCL (defun |makeByteWordVec| (initialvalue) (let ((n (cond ((null initialvalue) 7) ('t (reduce #'max initialvalue))))) (make-array (length initialvalue) :element-type (list 'mod (1+ n)) :initial-contents initialvalue))) -#+:CCL -(defun |makeByteWordVec| (initialvalue) - (list-to-vector initialvalue)) - -#-:CCL (defun |makeByteWordVec2| (maxelement initialvalue) (let ((n (cond ((null initialvalue) 7) ('t maxelement)))) (make-array (length initialvalue) :element-type (list 'mod (1+ n)) :initial-contents initialvalue))) -#+:CCL -(defun |makeByteWordVec2| (maxelement initialvalue) - (list-to-vector initialvalue)) - (defun |knownEqualPred| (dom) (let ((fun (|compiledLookup| '= '((|Boolean|) $ $) dom))) (if fun (get (bpiname (car fun)) '|SPADreplace|) @@ -7100,8 +6645,7 @@ special. (defun |hashable| (dom) (memq (|knownEqualPred| dom) - #-Lucid '(EQ EQL EQUAL) - #+Lucid '(EQ EQL EQUAL EQUALP) + '(EQ EQL EQUAL) )) ;; simpler interpface to RDEFIOSTREAM @@ -7154,14 +6698,11 @@ special. (SETQ /VERSION 0) (SETQ /RELEASE 0) -(defconstant |$cclSystem| -#+:CCL 't -#-:CCL nil -) +(defconstant |$cclSystem| nil) ;; These two variables are referred to in setvars.boot. -#+:kcl (setq input-libraries nil) -#+:kcl (setq output-library nil) +(setq input-libraries nil) +(setq output-library nil) ;; For the browser, used for building local databases when a user compiles ;; their own code. @@ -8278,99 +7819,28 @@ The following functions are provided: \end{verbatim} <<*>>= (defun |OsRunProgram| (program &rest args) - #+(and :Lucid (not :ibm/370)) (lucid-os-run-program program args) - #+:CmuLisp (cmulisp-os-run-program program args) - #+:KCL (kcl-os-run-program program args) - #-(or (and :Lucid (not :ibm/370)) :CmuLisp :KCL) nil ) + (kcl-os-run-program program args) + nil ) (defun |OsRunProgramToStream| (program &rest args) - #+(and :Lcid (not ibm/370)) - (lucid-os-run-program-to-stream program args) - #+:CmuLisp (cmulisp-os-run-program-to-stream program args) - #+:KCL (kcl-os-run-program-to-stream program args) - #-(or (and :Lucid (not :ibm/370)) :CmuLisp :KCL) - (make-string-output-stream "") ) - -;Unix: + (kcl-os-run-program-to-stream program args) + (make-string-output-stream "") ) + (defvar |OsEnvVarCharacter| #\$) (defun |OsEnvGet| (sym) - #+(and :Lucid (not :ibm/370)) (lucid-os-env-get sym) - #+:CmuLisp (cmulisp-os-env-get sym) - #+:KCL (kcl-os-env-get sym) - #-(or (and :Lucid (not :ibm/370)) :CmuLisp :KCL) "" ) + (kcl-os-env-get sym) + "" ) (defun |OsProcessNumber| () - #+(and :Lucid (not :ibm/370)) (lucid-os-process-number) - #+:CmuLisp (cmulisp-os-process-number) - #+:KCL (kcl-os-process-number) - #-(or (and :Lucid (not :ibm/370)) :CmuLisp :KCL) 42 ) - -;;; -;;; Lucid-only implementations -;;; - -#+(and :Lucid (not :ibm/370)) (progn -(defun lucid-os-run-program (program args) - (system:run-aix-program program :arguments args)) - -(defun lucid-os-run-program-to-stream (program args) - (system:run-aix-program program - :wait nil - :output :stream - :arguments args)) - -(defun lucid-os-env-get (sym) - (c-to-lisp-string (getenv (string sym))) ) - -(defun lucid-os-process-number () - (getpid)) - -(system:define-foreign-function :c 'getenv :pointer) -(system:define-foreign-function :c 'sprintf :pointer) -(system:define-foreign-function :c 'strlen :fixnum) -(system:define-foreign-function :c 'getpid :fixnum) - -(defun c-to-lisp-string (ptr) - (let (str len) - (setq len (strlen ptr)) - (setq str (make-array (list len) :element-type 'string-char)) - (sprintf str "%s" ptr) ; Cannot use strcpy because it stops in a \0. - str )) -) - -;;; -;;; Cmulisp-only implementations -;;; + (kcl-os-process-number) + 42 ) -#+:CmuLisp (progn -(defun cmulisp-os-run-program (program args) - (extensions:run-program program args - :input 't ; use current standard input -- default is /dev/null - :output 't ; use current standard output - :error 't )) ; use current standard error - -(defun cmulisp-os-run-program-to-stream (program args) - (second (multiple-value-list - (extensions:run-program program args - :wait nil ; don't wait - :input 't ; use current standard input - :output :stream ; slurp the output of the process - :error 't )) )) ; use current standard error - -(defun cmulisp-os-env-get (sym) - (let ((key (intern (string sym) (find-package "KEYWORD")))) - (cdr (assoc key *environment-list* :test #'eq)) )) - -(defun cmulisp-os-process-number () - (Aix::Unix-getpid) ) -) ;;; ;;; KCL-only implementations ;;; -#+:KCL (progn (defun kcl-os-run-program (program args) (system (format nil "~{~a ~}" (cons program args))) ) @@ -8383,9 +7853,6 @@ The following functions are provided: (defun kcl-os-process-number () 77 ) -;(defentry |getpid| () (int "getpid")) -) - ;;;; ;;;; Time ;;;; @@ -8397,89 +7864,6 @@ The following functions are provided: (format nil "~2,'0d/~2,'0d/~2,'0d ~2,'0d:~2,'0d:~2,'0d" yr mo mody hr min sec) )) -;;;; -;;;; File system interface -;;;; - -;;(defun |FileExists?| (path) -;; (probe-file path) ) -;; -;;(defun |FileRemove| (path) -;; (delete-file path) ) -;; -;;(defun |FileRename| (oldpath newpath) -;; (rename-file oldpath newpath) ) -;; -;;(defun |FileAbsolutePath| (path) -;; (truename path) ) -;; -;;(defun |FileDate| (path) -;; (file-write-date path) ) -;; -;;(defun |TextFileOpenIn| (path) -;; (open path -;; :element-type 'string-char -;; :direction :input )) -;; -;;(defun |TextFileOpenOut| (path) -;; (open path -;; :element-type 'string-char -;; :direction :output -;; :if-exists :supersede -;; :if-does-not-exist :create )) -;; -;;(defun |TextFileOpenIO| (path) -;; (open path -;; :element-type 'string-char -;; :direction :io -;; :if-exists :overwrite ; open at beginning -;; :if-does-not-exist :create )) -;; -;;(defun |TextFileOpenAppend| (path) -;; (open path -;; :element-type 'string-char -;; :direction :output -;; :if-exists :append -;; :if-does-not-exist :create )) -;; -;; -;;(defun |ByteFileOpenIn| (path) -;; (open path -;; :element-type 'unsigned-byte -;; :direction :input )) -;; -;;(defun |ByteFileOpenOut| (path) -;; (open path -;; :element-type 'unsigned-byte -;; :direction :output -;; :if-exists :supersede -;; :if-does-not-exist :create )) -;; -;;(defun |ByteFileOpenIO| (path) -;; (open path -;; :element-type 'unsigned-byte -;; :direction :io -;; :if-exists :overwrite ; open at beginning -;; :if-does-not-exist :create )) -;; -;;(defun |ByteFileOpenAppend| (path) -;; (open path -;; :element-type 'unsigned-byte -;; :direction :output -;; :if-exists :append -;; :if-does-not-exist :create )) -;; -;;(defun |ReadFileLineAt| (path pos) -;; (with-open-file (stream path :direction :input) -;; (file-position stream pos) -;; (read-line stream) )) -;; -;;(defun |UserHomeDirectory| () -;; (pathname-directory (user-homedir-pathname)) ) -;; -;;(defun |DirectoryFiles| (path) -;; (directory path) ) - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; ;;;; Lisp Interface @@ -8541,25 +7925,6 @@ The following functions are provided: ;;; and the thown value is returned. Otherwise, tagvar is set to nil ;;; and the first result of the expression is returned. -#+:Lucid -(defmacro |CatchAsCan| (tagvar expr) - `(let ((catch-result nil) - (expr-result nil) - (normal-exit (gensym))) - - (setq catch-result - (catch 'lucid::top-level - (setq expr-result ,expr) - normal-exit)) - (cond - ((eq catch-result normal-exit) - (setq ,tagvar nil) - expr-result ) - ('t - (setq ,tagvar 'lucid::top-level) - catch-result )) )) - -#-:Lucid (defmacro |CatchAsCan| (tagvar expr) `(progn (setq tagvar nil) @@ -9324,9 +8689,7 @@ The following functions are provided: tab ) key-list )) -;; CCL supplies a slightly more efficient version of logs to base 10, which -;; is useful in the WIDTH function. MCD. -#+:KCL (defun log10 (u) (log u 10)) +(defun log10 (u) (log u 10)) @ \eject