Article View: comp.lang.clos
Article #28Reference variables: Is the following safe?
From: Jon L White
Date: Fri, 07 Aug 1992 18:48
Date: Fri, 07 Aug 1992 18:48
16 lines
1057 bytes
1057 bytes
re: (reference-p foo) versus
(defmethod reference-value ((reference reference))
(reference-val reference))
Keep in mind that many Common Lisp implementations can "open-code"
the REFERENCE-P test, posibly into very few instructions; but the
generic-function dispatch step -- especially for an object not of
STANDARD-CLASS -- will likely cost a lot more time.
Of course, there is a trade-off point depending on how many methods
are written for the function REFERENCE-VALUE; typically the dispatch
time will be constant, and an in-line type test will be linear in
the number of cases. I think you only have one case.
-- JonL --
Technical Details
Message-ID:
<9208071848.AA12588@kuwait.lucid>Path:
arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!lucid.com!jonl%kuwaitShow Full Headers
Complete Article Headers
Newsgroups: comp.lang.clos Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!lucid.com!jonl%kuwait From: jonl%kuwait@lucid.com (Jon L White) Subject: Reference variables: Is the following safe? Message-ID: <9208071848.AA12588@kuwait.lucid> Sender: daemon@cis.ohio-state.edu Organization: The Ohio State University Department of Computer and Information Science Date: Fri, 7 Aug 1992 18:48:28 GMT Lines: 16