Path: csiph.com!weretis.net!feeder9.news.weretis.net!border-3.nntp.ord.giganews.com!nntp.giganews.com!Xl.tags.giganews.com!local-4.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail NNTP-Posting-Date: Wed, 03 Jun 2026 01:49:58 +0000 From: steve g Newsgroups: comp.lang.lisp Subject: Re: slot-value-using-class to remap "virtual" slots & closer-mop References: Date: Tue, 02 Jun 2026 21:50:18 -0400 Message-ID: <87eciocrz9.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:wWPdsrJB58IvHYpUaxgEDjTPMyg= MIME-Version: 1.0 Content-Type: text/plain Lines: 39 X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-qHQ8aRZ+Mi65fQ0N7g2jqg4n9at+JtvNVT4Y7yrD3XP5avqZGP2t/T85lzxhHjrzHd0/pCQ/kJOw3ZE!a7GuA3x2v5bqusnyH14hoGtct1imilsATH778xR1s7WzGDA= X-Complaints-To: abuse@giganews.com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 Xref: csiph.com comp.lang.lisp:60799 Madhu writes: > > Yes, I was able to replace all that slot-value-using-class machinery > with slot-missing. > > (defclass foo () > ((slot-1 :initform 10 :initarg :slot-1))) > > (defmethod slot-missing ((class standard-class) (obj foo) slot operation > &optional new-value) > (let ((slot-name > (etypecase slot > (symbol slot) > (ccl:standard-effective-slot-definition > (ccl:slot-definition-name slot))))) > (case slot-name > (slot-2 > (ecase operation > (setf (setf (slot-value obj 'slot-1) new-value)) > (slot-boundp (slot-boundp obj 'slot-1)) > (slot-makunbound (slot-makunbound obj 'slot-1)) > (slot-value (slot-value obj 'slot-1)))) > (slot-3 > (ecase operation > (setf (setf (slot-value obj 'slot-1) new-value)) > (slot-boundp (slot-boundp obj 'slot-1)) > (slot-makunbound (slot-makunbound obj 'slot-1)) > (slot-value (slot-value obj 'slot-1)))) > (otherwise (call-next-method))))) > > > This redirects or "forwards" slot-value operations on slot-3 and slot-2 > to slot-1. have you tried with-slots macro? https://www.lispworks.com/documentation/HyperSpec/Body/m_w_slts.htm