[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 235c3cb: * lisp/emacs-lisp/cl-macs.el (cl-struct-sl
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] master 235c3cb: * lisp/emacs-lisp/cl-macs.el (cl-struct-slot-value): Handle a nil type. |
Date: |
Thu, 19 Feb 2015 18:15:20 +0000 |
branch: master
commit 235c3cb105c3bac49e44296c8066cf7f1c585472
Author: Stefan Monnier <address@hidden>
Commit: Stefan Monnier <address@hidden>
* lisp/emacs-lisp/cl-macs.el (cl-struct-slot-value): Handle a nil type.
---
lisp/ChangeLog | 2 ++
lisp/emacs-lisp/cl-macs.el | 6 +++---
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 933e5bb..bf6ea90 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,7 @@
2015-02-19 Stefan Monnier <address@hidden>
+ * emacs-lisp/cl-macs.el (cl-struct-slot-value): Handle a nil type.
+
* emacs-lisp/smie.el (smie-prec2->grammar): Fix corner case problem.
2015-02-18 Kelly Dean <address@hidden>
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index caaf768..c5f49b0 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -2978,9 +2978,9 @@ STRUCT and SLOT-NAME are symbols. INST is a structure
instance."
;; We could use `elt', but since the byte compiler will resolve the
;; branch below at compile time, it's more efficient to use the
;; type-specific accessor.
- (if (eq (cl-struct-sequence-type ,struct-type) 'vector)
- (aref ,inst (cl-struct-slot-offset ,struct-type ,slot-name))
- (nth (cl-struct-slot-offset ,struct-type ,slot-name) ,inst))))))
+ (if (eq (cl-struct-sequence-type ,struct-type) 'list)
+ (nth (cl-struct-slot-offset ,struct-type ,slot-name) ,inst)
+ (aref ,inst (cl-struct-slot-offset ,struct-type ,slot-name)))))))
(run-hooks 'cl-macs-load-hook)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 235c3cb: * lisp/emacs-lisp/cl-macs.el (cl-struct-slot-value): Handle a nil type.,
Stefan Monnier <=