🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.clos
Article #622

Re: Redefining FORMAT

#622
From: Marty Hall
Date: Tue, 11 Jun 1991 18:26
29 lines
1650 bytes
In <marco.676653088@ipvvis> 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)
Technical Details
Message-ID: <1991Jun11.182622.3303@aplcen.apl.jhu.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!hall
References: <marco.676653088@ipvvis>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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: <marco.676653088@ipvvis>
Reply-To: hall@aplcen (Marty Hall)
Organization: AAI Corp AI Lab, JHU P/T CS Faculty
Lines: 29