Skip to content

Commit

Permalink
0.8.15.4:
Browse files Browse the repository at this point in the history
	Fix for method redefinition WARNING (Zach Beane sbcl-devel
	2004-09-24)
	... slight tweak to get &optional (stream *standard-output*)
		right.
  • Loading branch information
csrhodes committed Oct 1, 2004
1 parent 791e9d1 commit dbc2c0c
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 9 deletions.
5 changes: 5 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
changes in sbcl-0.8.16 relative to sbcl-0.8.15:
* bug fix: read-write consistency on streams of element-type
(SIGNED-BYTE N) for N > 32. (reported by Bruno Haible for CMUCL)
* bug fix: redefiniton of the only method of a generic function with
no DEFGENERIC no longer emits a full WARNING. In addition,
redefinition of generic functions with no DEFGENERIC to an
incompatible lambda list now signals an error. (thanks to Zach
Beane)
* fixed some bugs revealed by Paul Dietz' test suite:
** POSITION on displaced vectors with non-zero displacement
returns the right answer.
Expand Down
19 changes: 12 additions & 7 deletions src/pcl/boot.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -1644,6 +1644,12 @@ bootstrapping.
(unless (equal ,pos ,valsym)
(setf ,pos ,valsym)))))

(defun create-gf-lambda-list (lambda-list)
;;; Create a gf lambda list from a method lambda list
(loop for x in lambda-list
collect (if (consp x) (list (car x)) x)
if (eq x '&key) do (loop-finish)))

(defun set-arg-info (gf &key new-method (lambda-list nil lambda-list-p)
argument-precedence-order)
(let* ((arg-info (if (eq *boot-state* 'complete)
Expand Down Expand Up @@ -1671,8 +1677,10 @@ bootstrapping.
(error "The lambda-list ~S is incompatible with ~
existing methods of ~S."
lambda-list gf))))
(when lambda-list-p
(esetf (arg-info-lambda-list arg-info) lambda-list))
(esetf (arg-info-lambda-list arg-info)
(if lambda-list-p
lambda-list
(create-gf-lambda-list lambda-list)))
(when (or lambda-list-p argument-precedence-order
(null (arg-info-precedence arg-info)))
(esetf (arg-info-precedence arg-info)
Expand Down Expand Up @@ -1920,11 +1928,8 @@ bootstrapping.
(let* ((method (car (last methods)))
(ll (if (consp method)
(early-method-lambda-list method)
(method-lambda-list method)))
(k (member '&key ll)))
(if k
(ldiff ll (cdr k))
ll))))
(method-lambda-list method))))
(create-gf-lambda-list ll))))
(arg-info-lambda-list arg-info))))

(defmacro real-ensure-gf-internal (gf-class all-keys env)
Expand Down
13 changes: 12 additions & 1 deletion tests/clos.impure.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -450,8 +450,19 @@
(defmethod incompatible-ll-test-2 ((x integer) &key bar) bar)
(assert (= (length
(sb-pcl:generic-function-methods #'incompatible-ll-test-2)) 2))
(assert (equal (incompatible-ll-test-2 t 1 2) '(1 2)))

;;; Per Christophe, this is an illegal method call because of 7.6.5
(assert (raises-error? (incompatible-ll-test-2 t 1 2)))

(assert (eq (incompatible-ll-test-2 1 :bar 'yes) 'yes))

(defmethod incompatible-ll-test-3 ((x integer)) x)
(remove-method #'incompatible-ll-test-3
(find-method #'incompatible-ll-test-3
nil
(list (find-class 'integer))))
(assert (raises-error? (defmethod incompatible-ll-test-3 (x y) (list x y))))


;;; Attempting to instantiate classes with forward references in their
;;; CPL should signal errors (FIXME: of what type?)
Expand Down
2 changes: 1 addition & 1 deletion version.lisp-expr
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
;;; checkins which aren't released. (And occasionally for internal
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
"0.8.15.3"
"0.8.15.4"

0 comments on commit dbc2c0c

Please sign in to comment.