Skip to content
Snippets Groups Projects
Commit 240e9cd7 authored by ram's avatar ram
Browse files

Merged systems-work source as of this date. The main substantive change

was fixing #S to know about the new DD-CONSTRUCTORS slot.
parent 20dd0e88
No related branches found
No related tags found
No related merge requests found
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
;;; Scott Fahlman or slisp-group@cs.cmu.edu. ;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;; ;;;
(ext:file-comment (ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/sharpm.lisp,v 1.4 1991/02/08 13:35:39 ram Exp $") "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/sharpm.lisp,v 1.5 1991/02/14 18:41:37 ram Exp $")
;;; ;;;
;;; ********************************************************************** ;;; **********************************************************************
;;; ;;;
...@@ -16,15 +16,13 @@ ...@@ -16,15 +16,13 @@
;;; Runs in the standard Spice Lisp environment. ;;; Runs in the standard Spice Lisp environment.
;;; This uses the special std-lisp-readtable, which is internal to READER.LISP ;;; This uses the special std-lisp-readtable, which is internal to READER.LISP
;;; ;;;
;;; **************************************************************** (in-package "LISP")
(in-package 'lisp)
;;; declared in READ.LISP ;;; declared in READ.LISP
(proclaim '(special *read-suppress* std-lisp-readtable *bq-vector-flag*)) (proclaim '(special *read-suppress* std-lisp-readtable *bq-vector-flag*))
(defun sharp-backslash (stream backslash ignore) (defun sharp-backslash (stream backslash ignore)
(declare (ignore ignore)) (declare (ignore ignore))
(unread-char backslash stream) (unread-char backslash stream)
...@@ -177,8 +175,7 @@ ...@@ -177,8 +175,7 @@
retval) retval)
(setq denval (+ (* denval radix) dig)))) (setq denval (+ (* denval radix) dig))))
;;it's bogus ;;it's bogus
(t (error (t (error "Illegal digits ~S for radix ~S" token radix))))))
"Illegal digits ~S for radix ~S" token radix)))))))
(defun sharp-B (stream ignore1 ignore2) (defun sharp-B (stream ignore1 ignore2)
(declare (ignore ignore1 ignore2)) (declare (ignore ignore1 ignore2))
...@@ -203,10 +200,9 @@ ...@@ -203,10 +200,9 @@
dimensions)) dimensions))
(if (> dimensions 0) (if (> dimensions 0)
(let ((dlist (make-list dimensions)) (let ((dlist (make-list dimensions))
(init-list (init-list (if (char= (read-char stream t) #\()
(if (char= (read-char stream t) #\( #|)|#) (read-list stream nil)
(read-list stream nil) (error "Array values must be a list."))))
(error "Array values must be a list."))))
(do ((dl dlist (cdr dl)) (do ((dl dlist (cdr dl))
(il init-list (car il))) (il init-list (car il)))
;; I think the nreverse is causing the problem. ;; I think the nreverse is causing the problem.
...@@ -226,24 +222,25 @@ ...@@ -226,24 +222,25 @@
(when *read-suppress* (when *read-suppress*
(read stream () () t) (read stream () () t)
(return-from sharp-S nil)) (return-from sharp-S nil))
(let ((body (let ((body (if (char= (read-char stream t) #\( )
(if (char= (read-char stream t) #\( ) (read-list stream nil)
(read-list stream nil) (error "Non-list following #S"))))
(error "Non-list following #S"))))
(cond ((listp body) (cond ((listp body)
(unless (symbolp (car body)) (unless (symbolp (car body))
(error "Structure type is not a symbol: ~S" (car body))) (error "Structure type is not a symbol: ~S" (car body)))
(let ((defstruct (info type defined-structure-info (car body)))) (let ((defstruct (info type defined-structure-info (car body))))
(unless defstruct (unless defstruct
(error "~S is not a defined structure type." (car body))) (error "~S is not a defined structure type." (car body)))
(unless (c::dd-constructor defstruct) (unless (c::dd-constructors defstruct)
(error "The ~S structure does not have a default constructor." (car body))) (error "The ~S structure does not have a default constructor."
(car body)))
(do ((arg (cdr body) (cddr arg)) (do ((arg (cdr body) (cddr arg))
(res ())) (res ()))
((endp arg) (apply (c::dd-constructor defstruct) res)) ((endp arg)
(apply (car (c::dd-constructors defstruct)) res))
(push (cadr arg) res) (push (cadr arg) res)
(push (intern (string (car arg)) *keyword-package*) res)))) (push (intern (string (car arg)) *keyword-package*) res))))
(t (error "Non-list following #S: ~S" body)))))) (t (error "Non-list following #S: ~S" body)))))
(defmacro int-subst-array (new old array rank var-list) (defmacro int-subst-array (new old array rank var-list)
(if (> rank (array-rank array)) (if (> rank (array-rank array))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment