*.x86f
*.fas
*.lib
+*.fasl
(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.
;;; 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
#! /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))
#: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
(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
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
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))