From a9813c89cb85b6e700e5b10400db8ac92ab5e1e8 Mon Sep 17 00:00:00 2001 From: Nikodemus Siivola Date: Sat, 18 Aug 2007 04:07:13 +0000 Subject: [PATCH] 1.0.8.30: better standard-instance accessors * Add SETF functions for STANDARD-INSTANCE-ACCESS and FUNCALLABLE-STANDARD-INSTANCE-ACCESS. * Declare them and the readers inline. Thanks to Attila Lendvai. --- NEWS | 3 +++ src/pcl/slots.lisp | 10 ++++++++++ version.lisp-expr | 2 +- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 4a30176..ee5c4db 100644 --- a/NEWS +++ b/NEWS @@ -7,6 +7,9 @@ changes in sbcl-1.0.9 relative to sbcl-1.0.8: * enhancement: default PRINT-OBJECT methods for classes, slot-definitions, and generic function now print the object identity for anonymous instances. (thanks to Attila Lendvai) + * enhancement: as an extension to MOP, SBCL now supports SETF of + STANDARD-INSTANCE-ACCESS and FUNCALLABLE-STANDARD-INSTANCE-ACCESS. + (thanks to Attila Lendvai) * bug fix: new compiler transforms for MEMBER and ASSOC were affected by printer control variables. (reported by Dan Corkill) * bug fix: system leaked memory when delayed output was performed by diff --git a/src/pcl/slots.lisp b/src/pcl/slots.lisp index da5f09d..0dcb87e 100644 --- a/src/pcl/slots.lisp +++ b/src/pcl/slots.lisp @@ -159,12 +159,22 @@ (slot-value object slot-name) default)) +(declaim (inline standard-instance-access (setf standard-instance-access) + funcallable-standard-instance-access + (setf funcallable-standard-instance-access))) + (defun standard-instance-access (instance location) (clos-slots-ref (std-instance-slots instance) location)) +(defun (setf standard-instance-access) (new-value instance location) + (setf (clos-slots-ref (std-instance-slots instance) location) new-value)) + (defun funcallable-standard-instance-access (instance location) (clos-slots-ref (fsc-instance-slots instance) location)) +(defun (setf funcallable-standard-instance-access) (new-value instance location) + (setf (clos-slots-ref (fsc-instance-slots instance) location) new-value)) + (defmethod slot-value-using-class ((class std-class) (object standard-object) (slotd standard-effective-slot-definition)) diff --git a/version.lisp-expr b/version.lisp-expr index ee5a5c6..3fa34e9 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"1.0.8.29" +"1.0.8.30" -- 1.7.10.4