summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
a035dd4)
Not entirely successful, largely because the CLisp pretty-printer seems
quite badly broken.
(defun whitespace-char-p (ch)
"Return whether CH is a whitespace character or not."
(case ch
(defun whitespace-char-p (ch)
"Return whether CH is a whitespace character or not."
(case ch
- ((#\space #\tab #\newline #\return #\vt #\formfeed) t)
+ ((#\space #\tab #\newline #\return #\vt
+ #+cmu #\formfeed
+ #+clisp #\page) t)
(t nil)))
(declaim (ftype (function nil ()) slot-unitialized))
(t nil)))
(declaim (ftype (function nil ()) slot-unitialized))
;;; Packages.
(defpackage #:mdw.mop
;;; Packages.
(defpackage #:mdw.mop
- (:use #:common-lisp #:mdw.base #+cmu #:mop)
+ (:use #:common-lisp #:mdw.base #+(or cmu clisp) #:mop)
(:export #:compatible-class
#:copy-instance #:copy-instance-using-class
#:initargs-for-effective-slot #:make-effective-slot
(:export #:compatible-class
#:copy-instance #:copy-instance-using-class
#:initargs-for-effective-slot #:make-effective-slot
(defmethod compute-effective-slot-definition
((class compatible-class) slot-name direct-slots)
"Construct an effective slot definition for the given slot."
(defmethod compute-effective-slot-definition
((class compatible-class) slot-name direct-slots)
"Construct an effective slot definition for the given slot."
+ (declare (ignore slot-name))
;;
;; Ideally we don't want to mess with a slot if it's entirely handled by
;; the implementation. This check seems to work OK.
;;
;; Ideally we don't want to mess with a slot if it's entirely handled by
;; the implementation. This check seems to work OK.
(defun print-object-with-slots (obj stream)
"Prints objects in a pleasant way. Not too clever about circularity."
(defun print-object-with-slots (obj stream)
"Prints objects in a pleasant way. Not too clever about circularity."
- (let ((class (pcl:class-of obj))
+ (let ((class (class-of obj))
(magic (cons 'magic nil)))
(print-unreadable-object (obj stream)
(pprint-logical-block
(magic (cons 'magic nil)))
(print-unreadable-object (obj stream)
(pprint-logical-block
(if (slot-boundp-using-class class obj slot)
(slot-value-using-class class obj slot)
magic)))
(if (slot-boundp-using-class class obj slot)
(slot-value-using-class class obj slot)
magic)))
- (pcl:class-slots class)))
- (format stream "~S" (pcl:class-name class))
+ (class-slots class)))
+ (format stream "~S" (class-name class))
(let ((sep nil))
(loop
(pprint-exit-if-list-exhausted)
(let ((sep nil))
(loop
(pprint-exit-if-list-exhausted)
(:file "mdw-mop" :depends-on ("mdw-base"))
(:file "str" :depends-on ("mdw-base"))
(:file "collect" :depends-on ("mdw-base"))
(:file "mdw-mop" :depends-on ("mdw-base"))
(:file "str" :depends-on ("mdw-base"))
(:file "collect" :depends-on ("mdw-base"))
- (:file "unix" :depends-on ("mdw-base" "collect"))
- (:file "safely" :depends-on ("mdw-base" "unix"))
+ #+cmu (:file "unix" :depends-on ("mdw-base" "collect"))
+ (:file "safely" :depends-on ("mdw-base"))
(:file "infix")
(:file "infix-ext" :depends-on ("mdw-base"
"infix"
(:file "infix")
(:file "infix-ext" :depends-on ("mdw-base"
"infix"
#! /usr/local/bin/runlisp
#! /usr/local/bin/runlisp
-;; (format t "Startup!~%")
-(asdf:operate 'asdf:load-op 'mdw :verbose nil)
+(let ((*compile-verbose* nil)
+ (*load-verbose* nil))
+ (asdf:oos 'asdf:load-op "mdw" :verbose nil))
(use-package '#:optparse)
(defvar opt-bool nil)
(use-package '#:optparse)
(defvar opt-bool nil)
(read opt-object)
(:doc (concatenate 'string
"Read object ("
(read opt-object)
(:doc (concatenate 'string
"Read object ("
- (format-universal-time nil
- (get-universal-time)
- :style :iso8601)
+ (princ-to-string (get-universal-time))
- (#\k "keywword" (:arg "KEYWORD") (keyword opt-keyword)
+ (#\k "keyword" (:arg "KEYWORD") (keyword opt-keyword)
("Set an arbitrary keyword."))
(#\e "enumeration" (:arg "ENUM")
(keyword opt-enum (list :apple :apple-pie :abacus :banana))
("Set an arbitrary keyword."))
(#\e "enumeration" (:arg "ENUM")
(keyword opt-enum (list :apple :apple-pie :abacus :banana))
(defpackage #:mdw.runlisp
(:use #:common-lisp #+cmu #:extensions)
(:export #:*lisp-interpreter* #:*command-line-strings*))
(defpackage #:mdw.runlisp
(:use #:common-lisp #+cmu #:extensions)
(:export #:*lisp-interpreter* #:*command-line-strings*))
+(in-package #:mdw.runlisp)
+
+#+clisp
+(progn
+ (defvar *lisp-interpreter*)
+ (defvar *command-line-strings*)
+ (let ((args (coerce (ext:argv) 'list)))
+ (setf *lisp-interpreter* (car args))
+ (setf *command-line-strings* (nthcdr 7 args))))
+
(defpackage #:mdw.sys-base
(defpackage #:mdw.sys-base
- (:use #:common-lisp #+cmu #:extensions #:mdw.runlisp)
- (:export #:exit #:hard-exit #:*program-name* #:*command-line-strings*))
+ (:use #:common-lisp #+cmu #:extensions #+cmu #:mdw.runlisp)
+ (:export #:exit #:hard-exit #:*program-name* #:*command-line-strings*)
+ (:import-from #:mdw.runlisp #:*lisp-interpreter* #:*command-line-strings*)
+ #+clisp (:import-from #:ext #:exit))
(in-package #:mdw.sys-base)
;;; --- This is currently all a bit CMUCL-specific ---
(in-package #:mdw.sys-base)
;;; --- This is currently all a bit CMUCL-specific ---
(defun exit (&optional (code 0))
"Polite way to end a program. If running in an interactive Lisp, just
return to the top-level REPL."
(defun exit (&optional (code 0))
"Polite way to end a program. If running in an interactive Lisp, just
return to the top-level REPL."
- (if *batch-mode*
- (throw 'lisp::%end-of-the-world code)
+ (if #+cmu *batch-mode*
+ #+cmu (throw 'lisp::%end-of-the-world code)
(progn
(unless (zerop code)
(format t "~&Exiting unsuccessfully with code ~D.~%" code))
(abort))))
(progn
(unless (zerop code)
(format t "~&Exiting unsuccessfully with code ~D.~%" code))
(abort))))
(defun hard-exit (&optional (code 0))
"Stops the program immediately in its tracks. Does nothing else. Use
after fork, for example, to avoid flushing buffers."
(declare (type (unsigned-byte 32) code))
(defun hard-exit (&optional (code 0))
"Stops the program immediately in its tracks. Does nothing else. Use
after fork, for example, to avoid flushing buffers."
(declare (type (unsigned-byte 32) code))
- (unix::void-syscall ("_exit" c-call:int) code))
+ #+cmu (unix::void-syscall ("_exit" c-call:int) code)
+ #+clisp (ext:quit code))
-#+cmu
-(defvar *program-name* (pathname-name (car *command-line-strings*))
+(defvar *program-name*
+ (pathname-name (car *command-line-strings*))
"A plausible guess at the program's name, stripped of strange extensions.")
;;;----- That's all, folks --------------------------------------------------
"A plausible guess at the program's name, stripped of strange extensions.")
;;;----- That's all, folks --------------------------------------------------