master: Put back DSD-READER but only for structure-object

snuglas via Sbcl-commits <[email protected]>
Newsgroups gmane.lisp.steel-bank.cvs
Message-ID <[email protected]>
The branch "master" has been updated in SBCL:
       via  01126243ca6898febc509c0e0836d7b1106515ef (commit)
      from  141be5be0d697ae3e246a1aeea75dc77327e6c2f (commit)

- Log -----------------------------------------------------------------
commit 01126243ca6898febc509c0e0836d7b1106515ef
Author: Douglas Katzman <[email protected]>
Date:   Tue Apr 7 11:26:57 2026 -0400

    Put back DSD-READER but only for structure-object
    
    Needed in https://github.com/qitab/cl-protobufs/blob/master/optimizer.lisp
---
 src/code/defstruct.lisp | 7 +++++++
 src/cold/exports.lisp   | 1 +
 2 files changed, 8 insertions(+)

diff --git a/src/code/defstruct.lisp b/src/code/defstruct.lisp
index a7bfc4c26..05bef90fe 100644
--- a/src/code/defstruct.lisp
+++ b/src/code/defstruct.lisp
@@ -219,6 +219,13 @@
           (values '%instance-ref '%layout-slot-set))
          (t
           (values '%instance-ref '%instance-set))))
+
+(defun dsd-reader (dsd flag) ; for backward-compatibility
+  (sb-int:aver (not flag)) ; reject subtypes of FUNCALLABLE-STRUCTURE
+  (acond ((dsd-raw-slot-data dsd)
+          (values (raw-slot-data-reader-name it) (raw-slot-data-writer-name it)))
+         (t
+          (values '%instance-ref '%instance-set))))
 
 ;;;; Typed (non-class) structures
 
diff --git a/src/cold/exports.lisp b/src/cold/exports.lisp
index 5efd4381a..ef458ec29 100644
--- a/src/cold/exports.lisp
+++ b/src/cold/exports.lisp
@@ -1743,6 +1743,7 @@ is a good idea, but see SB-SYS re. blurring of boundaries.")
            "DOUBLE-FLOAT-LOW-BITS" "DOUBLE-FLOAT-SIGNIFICAND"
            "DSD-ACCESSOR-NAME" "DSD-ALWAYS-BOUNDP" "DSD-DEFAULT" "DSD-INDEX"
            "DSD-NAME" "DSD-RAW-TYPE" "DSD-READ-ONLY" "DSD-PRIMITIVES" "DSD-TYPE"
+           "DSD-READER"
            "DYNAMIC-SPACE-OBJ-P"
            "DYNBIND"
            "FLOAT-WAIT" "DYNAMIC-SPACE-FREE-POINTER" "DYNAMIC-USAGE"

-----------------------------------------------------------------------


hooks/post-receive
-- 
SBCL
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.