Hello,
Any idea why CMUCL outputs these compiler notes? If I change the
allocation of ANON-COUNT to :INSTANCE the compiler notes go away.
Thanks,
pomajxego:/tmp luis$ cat anon.lisp
(defclass foreign-type ()
((name
;; Name of this foreign type, a symbol.
;:initform (error "A type name is required.")
:initarg :name
:accessor name)
(anonymous
;; If T, a unique name is generated.
:initform nil
:initarg :anonymous)
(anon-count
;; Counter for anonymous types. Used to provide
;; anonymous types with unique names.
:initform 0
:allocation :class))
(:documentation "Contains information about a basic foreign type."))
(defmethod initialize-instance :after ((self foreign-type) &key)
(if (slot-value self 'anonymous)
(setf (name self) (intern (format nil "~A~D" (symbol-name '#:%ANON)
(incf
(slot-value self 'anon-count)))))
(if (null (name self))
(error "A type name is required."))))
(defparameter *foo1* (make-instance 'foreign-type :name 'foo1))
(defparameter *foo2* (make-instance 'foreign-type :name 'foo2))
(defparameter *foo3* (make-instance 'foreign-type :anonymous t))
pomajxego:/tmp luis$ lisp
; Loading #P"/Users/luis/init.lisp".
;; Loading #P"/Users/luis/lisp-cvs/asdf.ppcf".
CMU Common Lisp 19b-pre1 (19B), running on pomajxego.local
With core: /Users/luis/Software/lib/cmucl/lib/lisp.core
Dumped on: Thu, 2005-05-26 02:14:58+01:00 on Anna-Toys-Computer.local.
See <http://www.cons.org/cmucl/> for support information.
Loaded subsystems:
Python 1.1, target PowerPC
CLOS based on Gerd's PCL 2004/04/14 03:32:47
* (compile-file "anon.lisp")
; Python version 1.1, VM version PowerPC on 17 AUG 05 04:15:37 am.
; Compiling: /private/tmp/anon.lisp 16 AUG 05 04:54:41 pm
; Byte Compiling Top-Level Form:
; Compiling Load Time Value of (PCL::ENSURE-ACCESSOR 'PCL::READER
'(PCL:SLOT-ACCESSOR :GLOBAL ANONYMOUS
...)
...):
; Compiling DEFMETHOD INITIALIZE-INSTANCE AFTER (FOREIGN-TYPE):
; Compiling Load Time Value of (PCL::ENSURE-CTOR '(PCL::CTOR FOREIGN-TYPE :NAME
...)
'FOREIGN-TYPE
...):
; Byte Compiling Top-Level Form:
; Compiling Load Time Value of (PCL::ENSURE-CTOR '(PCL::CTOR FOREIGN-TYPE :NAME
...)
'FOREIGN-TYPE
...):
; Compiling Load Time Value of (PCL::ENSURE-CTOR '(PCL::CTOR FOREIGN-TYPE
:ANONYMOUS ...)
'FOREIGN-TYPE
...):
; Byte Compiling Top-Level Form:
; anon.ppcf written.
; Compilation finished in 0:00:00.
#P"/private/tmp/anon.ppcf"
NIL
NIL
* (load "anon")
; Loading #P"/private/tmp/anon.ppcf".
; In:
; FUNCTION (KERNEL:INSTANCE-LAMBDA NIL
; (LET #
; #
; # ..
; '(ANON-COUNT . 0)
; Note: Deleting unreachable code.
;
; Compilation unit finished.
; 1 note
; In:
; FUNCTION (KERNEL:INSTANCE-LAMBDA NIL
; (LET #
; #
; # ..
; '(ANON-COUNT . 0)
; Note: Deleting unreachable code.
;
; Compilation unit finished.
; 1 note
; In:
; FUNCTION (KERNEL:INSTANCE-LAMBDA NIL
; (LET #
; #
; # ..
; '(ANON-COUNT . 0)
; Note: Deleting unreachable code.
;
; Compilation unit finished.
; 1 note
T
*
--
Luis Oliveira
luismbo (@) gmail (.) com
Equipa Portuguesa do Translation Project
http://www2.iro.umontreal.ca/~pinard/po/registry.cgi?team=pt