Article View: comp.lang.clos
Article #29Optimizer--or my misunderstanding?
From: Joe Konstan
Date: Sun, 09 Aug 1992 01:37
Date: Sun, 09 Aug 1992 01:37
32 lines
1684 bytes
1684 bytes
When trying to compile (with full optimizations, using Lucid 4.0.1) the
following:
(defclass foo ()
((a-slot :type #+lucid system:procedure :initarg :a :accessor a)))
(defmethod doit ((self foo))
(funcall (a self) 3))
The compiler seems unable to optimize the method and gives this message:
;;; FAILED TO OPTIMIZE the form: (funcall (a self) 3)
;;; Possible further declarations:
;;; For arg (a self): system:procedure
;;; compiled-function
Is this a mistake in the lucid compiler, or is this a result of my own
misunderstanding about the :type declaration in a defclass slot definition.
My understanding, from CLtL2, pg. 779, was that any subclass of foo that
redefined the type of slot a-slot would automatically be defining it
as (and system:procedure ...). Does this type restriction not apply to
the accessor method as well?
In either case, I'd welcome any suggestion for the right incantation to
let the compiler know that (a self) is, in this case, a function. I am
not willing to assert, however, that (a x) is a function where x is not
an instance of foo.
Thanks.
Joe Konstan
konstan@cs.berkeley.edu
Technical Details
Message-ID:
<161ssvINNamf@agate.berkeley.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!sun-barr!ames!agate!elmer-fudd.cs.berkeley.edu!konstanShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!sun-barr!ames!agate!elmer-fudd.cs.berkeley.edu!konstan From: konstan@elmer-fudd.cs.berkeley.edu (Joe Konstan) Newsgroups: comp.lang.clos Subject: Optimizer--or my misunderstanding? Date: 9 Aug 1992 01:37:35 GMT Organization: Picasso Research Group, UCB Computer Science Division Lines: 32 Distribution: world Message-ID: <161ssvINNamf@agate.berkeley.edu> NNTP-Posting-Host: elmer-fudd.cs.berkeley.edu