Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!cme!cam!ARTEMIS From: miller@FS1.cam.nist.gov (Bruce R. Miller) Newsgroups: comp.lang.clos Subject: Re: Redefining FORMAT Message-ID: <2885658096@ARTEMIS.cam.nist.gov> Date: 11 Jun 91 19:41:36 GMT References: Sender: news@cam.nist.gov Followup-To: comp.lang.clos Organization: NIST - Computing and Applied Mathematics Laboratory Lines: 31 In article , 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))) > ) > > When I load the file containing this definition I get the following error: > > >>Error: FORMAT already names an ordinary function or a macro Of course, the `real' answer is that you should be defining your own subclass of STREAM and defining your own versions of the char/string i/o primitives and then format would automatically do what you want! .. Except there isn't such a thing! .. at least not the last time I heard. A problem is that all lisp's have got to have streams, but they may or may not have CLOS, or it might be optional. Once you've got clos based streams in the basic lisp, you've gotta have clos. I suppose another problem was agreeing on the stream protocol. And since Symbolics lisp, for ex., has had Flavors based streams since time immemorial, that would likely have been a headache to convert. Probably each vendor had a large investment in stream machinery that was significantly different than everyone elses. Any insiders care to clarify? [or is this in the FAQ-to-be?] :>