Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!hall From: hall@aplcen.apl.jhu.edu (Marty Hall) Newsgroups: comp.lang.clos Subject: Re: Redefining FORMAT Keywords: defmethod format Message-ID: <1991Jun11.182622.3303@aplcen.apl.jhu.edu> Date: 11 Jun 91 18:26:22 GMT References: Reply-To: hall@aplcen (Marty Hall) Organization: AAI Corp AI Lab, JHU P/T CS Faculty Lines: 29 In marco@ipvvis.unipv.it (Marco Ramoni) writes: > >I have defined a class named text-window and I am attempting to write a >specialized version of format. My definition is: > >(defmethod format ((tw text-window) string &rest arguments) > "Specialized format for text-windows." > (print-string-in-window tw (eval `(format nil ,string ,@arguments))) > ) [Produces error under Lucid] > [...] can I "Convert the current definition into default method >directly from my program?" My understanding is that you cannot, unless there is a Lucid-specific way. To quote chapter and verse, CLtL2 says, on page 789, "If the given name [defined by defmethod] names a non-generic function, a macro, or a special form, an error is signalled." Also, as a minor suggestion, try "apply", since "eval" is so expensive: (apply #'format nil string arguments) instead of your "eval" form. - Marty Hall ------------------------------------------------------ hall@aplcen.apl.jhu.edu, hall%aplcen@jhunix.bitnet, ..uunet!aplcen!hall Artificial Intelligence Lab, AAI Corp, PO Box 126, Hunt Valley, MD 21030 (setf (need-p 'disclaimer) NIL)