Upgrade everything for SBCL.
authorMark Wooding <mdw@distorted.org.uk>
Sun, 30 Mar 2008 23:16:26 +0000 (00:16 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sun, 30 Mar 2008 23:16:37 +0000 (00:16 +0100)
.gitignore
infix.lisp
mdw-mop.lisp
optparse-test
safely.lisp
sys-base.lisp

index b94a63c..2335672 100644 (file)
@@ -1,3 +1,4 @@
 *.x86f
 *.fas
 *.lib
+*.fasl
index 579bce4..64a0a30 100644 (file)
   (pushval `(loop ,@(strip-progn (parse-infix 0)))))
 
 (defopfunc bind operand
-  (labels ((loop ()
+  (labels ((loopy ()
            (let ((ids (parse-ident-list))
                  (valform (progn (delim '=) (parse-infix 0)))
                  (body (if (delim '|,| nil)
-                           (loop)
+                           (loopy)
                            (progn
                              (delim 'in)
                              (strip-progn (parse-infix 0))))))
                        `(let ((,(car ids) ,valform)) ,@body)
                        `(multiple-value-bind ,ids ,valform ,@body))))))
     (get-token)
-    (pushval (car (loop)))))
+    (pushval (car (loopy)))))
 
 ;;;--------------------------------------------------------------------------
 ;;; Parsing function bodies and lambda lists.
index 9488e0e..e813f97 100644 (file)
 ;;; Packages.
 
 (defpackage #:mdw.mop
-  (:use #:common-lisp #:mdw.base #+(or cmu clisp) #:mop #+ecl #:clos)
+  (:use #:common-lisp #:mdw.base
+       #+(or cmu clisp) #:mop
+       #+sbcl #:sb-mop
+       #+ecl #:clos)
   (:export #:copy-instance #:copy-instance-using-class
           #:with-slot-variables
           #:compatible-class
index 4441483..4f3ad5f 100755 (executable)
@@ -1,5 +1,9 @@
 #! /usr/local/bin/runlisp
 
+(cl:defpackage #:optparse-test
+  (:use #:common-lisp))
+(cl:in-package #:optparse-test)
+
 (let ((*compile-verbose* nil)
       (*load-verbose* nil))
   (asdf:oos 'asdf:load-op "mdw" :verbose nil))
index 0a05f8b..b5d7ff8 100644 (file)
           #:safely-writing))
 (in-package #:safely)
 
+#+(or cmu sbcl)
+(eval-when (:compile-toplevel :execute)
+  (import #+cmu '(ext:unix-namestring unix:unix-link)
+         #+sbcl '(sb-int:unix-namestring)))
+
 (defstruct (safely (:predicate safelyp))
   "Stores information about how to commit or undo safe writes."
   (streams nil)
   (safely-unwind (safely-trail safe))
   (safely-reset safe))
 
+#+sbcl
+(defun unix-link (from to)
+  (sb-unix::int-syscall ("link" sb-alien:c-string sb-alien:c-string)
+                       from to))
+
 (defun safe-copy (file tag)
   "Make a copy of the FILE.  Return the new name."
 
-  #+cmu
+  #+(or cmu sbcl)
   ;; Use link(2) where available.
   (generate-fresh-file-name file tag
                            (lambda (name)
-                             (let ((from (ext:unix-namestring file t))
-                                   (to (ext:unix-namestring name nil)))
+                             (let ((from (unix-namestring file t))
+                                   (to (unix-namestring name nil)))
                                (and from to
-                                    (unix:unix-link from to)))))
+                                    (unix-link from to)))))
 
-  #-cmu
+  #-(or cmu sbcl)
   ;; Otherwise just copy the file contents and hope for the best.
   (with-open-file (input file :element-type :default)
     (multiple-value-bind
index ef71916..e973e90 100644 (file)
@@ -25,7 +25,8 @@
 
 (defpackage #:runlisp
   (:use #:common-lisp)
-  (:export #:*lisp-interpreter* #:*command-line-strings* #:run))
+  (:export #:*lisp-interpreter* #:*command-line-strings* #:run)
+  #+cmu (:import-from #:ext #:*command-line-strings*))
 (defvar runlisp:*command-line-strings* '("<interactive>"))
 
 (defpackage #:mdw.sys-base
@@ -40,6 +41,7 @@
    after fork, for example, to avoid flushing buffers."
   (declare (type (unsigned-byte 32) code))
   #+cmu (unix::void-syscall ("_exit" c-call:int) code)
+  #+sbcl (sb-ext:quit :unix-status code :recklessly-p t)
   #+(or clisp ecl) (ext:quit code))
 
 #-clisp
@@ -48,6 +50,7 @@
    return to the top-level REPL."
   (if (boundp '*lisp-interpreter*)
       #+(or cmu ecl) (ext:quit code)
+      #+sbcl (sb-ext:quit :unix-status code)
       (progn
         (unless (zerop code)
           (format t "~&Exiting unsuccessfully with code ~D.~%" code))