[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[rsl@MAX-FLEISCHER.ILA-SF.Dialnet.Symbolics.COM: Generic functions don't test for keyword validity.]



Date: Thu, 26 Apr 90 10:47 PDT
From: Richard Lamson <rsl@MAX-FLEISCHER.ILA-SF.Dialnet.Symbolics.COM>
Subject: Generic functions don't test for keyword validity.
To: BUG-PCL <Gregor.pa@Xerox.COM>
cc: rsl@MAX-FLEISCHER.ILA-SF.Dialnet.Symbolics.COM



If you call TEST-METHOD (defined below) on an instance of TEST-CLASS
with a keyword other than :K1, it doesn't blow up.  This is clearly
wrong.  Although it's OK to put &ALLOW-OTHER-KEYS into the method
function itself, the generic function is required to check for valid
keywords.  

[I was originally writing to complain that the DEFMETHOD expansion
always contained &ALLOW-OTHER-KEYS, but that appears to be allowed
by CLtL.]

(defclass test-class ()())

(defmethod test-method ((test test-class) &key k1)
  (progn k1))

(defvar test (make-instance 'test-class))

(test-method test :random-keyword t) ;; Doesn't barf!  Clearly wrong.