[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
changing &key/&rest in generic function lambda lists
- To: CommonLoops.pa@Xerox.COM
- Subject: changing &key/&rest in generic function lambda lists
- From: "Christopher M. Maeda" <maeda@WOMBAT.CS.CMU.EDU>
- Date: Fri, 25 May 90 16:02 EDT
- Redistributed: CommonLoops.pa
- Reply-to: cmaeda@CS.CMU.EDU
I noticed this weird behavior in MayDay R2 PCL on a 3600 running rel 7.2.
I not (yet) on the list so excuse me if this has been brought up before.
;;; -*- Mode: LISP; Syntax: Common-Lisp; Package: (FOO :USE (LISP PCL)); Base: 10 -*-
;;;; The defgeneric/defmethod arglist processor sometimes gets wedged if
;;;; I change the arglist of a generic function.
(defclass random1 () ())
;;; Define a method...
(defgeneric random-function ((foo random1))
)
;;; Do something stupid...
(defmethod random-function ((foo random1) &key bar)
t)
;;; Fix it (ie recompile)
(defgeneric random-function ((foo random1) &rest rest-args)
)
;;; This still breaks...
(defmethod random-function ((foo random1) &key bar)
t)
;;; Yet when we do it right the first time...
(defclass random2 () ())
(defgeneric random2-function ((foo random2) &rest keyword-args)
)
;;; It compiles with no problem...
(defmethod random2-function ((foo random2) &key bar)
t)
;;; Is this an error?
;;; I also noticed that if I do
;;; (setf (symbol-function 'random-function) nil)
;;; and recompile the defgeneric form, things work out ok.