Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!decwrl!uunet!tut.cis.ohio-state.edu!ZAPHOD.LANL.GOV!egdorf From: egdorf@ZAPHOD.LANL.GOV (Skip Egdorf) Newsgroups: comp.lang.clos Subject: RE: accessing clos objects Message-ID: <9102142051.AA04920@zaphod.lanl.gov.lanl.gov> Date: 14 Feb 91 20:51:55 GMT References: <9102141835.AA19768@cheops.cis.ohio-state.edu> Sender: welch@tut.cis.ohio-state.edu Distribution: inet Organization: CommonLoops Lines: 51 Oh yes, another thing about the Symbolics Bug/feature with :metaclass ;;; Sun Common Lisp, Development Environment 4.0.1, 6 July 1990 ;;; Sun-4 Version for SunOS 4.0.x and sunOS 4.1 ;;; ;;; Copyright (c) 1985, 1986, 1987, 1988, 1989, 1990 ;;; by Sun Microsystems, Inc., All Rights Reserved ;;; Copyright (c) 1985, 1986, 1987, 1988, 1989, 1990 ;;; by Lucid, Inc., All Rights Reserved ;;; This software product contains confidential and trade secret ;;; information belonging to Sun Microsystems, Inc. It may not be copied ;;; for any reason other than for archival and backup purposes. ;;; ;;; Sun, Sun-4, and Sun Common Lisp are trademarks of Sun Microsystems Inc. ;;; Loading source file "/home/zaphod/egdorf/lisp-init.lisp" > (defclass CLASS-WITH-INSTANCES (standard-class) ((instances :initform nil :accessor class-instances))) # > (defmethod MAKE-INSTANCE :around ((class CLASS-WITH-INSTANCES) &rest ignore) (let ((instance (call-next-method))) (push instance (class-instances class)) instance)) # > (defclass class-with-instances-test () () (:metaclass CLASS-WITH-INSTANCES)) # > (defun foo () (make-instance 'class-with-instances-test)) FOO > (make-instance 'class-with-instances-test) # > (class-instances (find-class 'class-with-instances-test)) (#) > (foo) # > (class-instances (find-class 'class-with-instances-test)) (# #) > Works for me... And running it all from gnu emacs with some local additions to cmulisp mode, I could just cut and paste to this message. I don't miss zmacs at all. Skip Egdorf hwe@lanl.gov