[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] scratch/record 7dbb1dc 09/10: * src/data.c (Ftype_of): Ret
From: |
Lars Brinkhoff |
Subject: |
[Emacs-diffs] scratch/record 7dbb1dc 09/10: * src/data.c (Ftype_of): Return type name, if record's type holds class. |
Date: |
Fri, 24 Mar 2017 11:51:42 -0400 (EDT) |
branch: scratch/record
commit 7dbb1dc2dcc591e8ac00a39b09457d561bd0b32f
Author: Stefan Monnier <address@hidden>
Commit: Lars Brinkhoff <address@hidden>
* src/data.c (Ftype_of): Return type name, if record's type holds class.
---
src/data.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/data.c b/src/data.c
index 7a56117..9f8decf 100644
--- a/src/data.c
+++ b/src/data.c
@@ -290,7 +290,14 @@ for example, (type-of 1) returns `integer'. */)
case PVEC_MUTEX: return Qmutex;
case PVEC_CONDVAR: return Qcondition_variable;
case PVEC_TERMINAL: return Qterminal;
- case PVEC_RECORD: return AREF (object, 0);
+ case PVEC_RECORD:
+ Lisp_Object t = AREF (object, 0);
+ if (RECORDP (t) && 1 < ASIZE (t) & PSEUDOVECTOR_SIZE_MASK)
+ /* Return the type name field of the class! */
+ return AREF (t, 1);
+ else
+ return t;
+
/* "Impossible" cases. */
case PVEC_XWIDGET:
case PVEC_OTHER:
- [Emacs-diffs] branch scratch/record created (now 4ea0d9d), Lars Brinkhoff, 2017/03/24
- [Emacs-diffs] scratch/record b5475b8 07/10: Remove CHECK_RECORD_TYPE., Lars Brinkhoff, 2017/03/24
- [Emacs-diffs] scratch/record 96a0547 08/10: The sky isn't so blue after all., Lars Brinkhoff, 2017/03/24
- [Emacs-diffs] scratch/record 0013635 06/10: Change read/print syntax to use #s., Lars Brinkhoff, 2017/03/24
- [Emacs-diffs] scratch/record 3cda36e 05/10: Backward compatibility with pre-existing struct instances., Lars Brinkhoff, 2017/03/24
- [Emacs-diffs] scratch/record 584c08c 04/10: Make the URL library use records., Lars Brinkhoff, 2017/03/24
- [Emacs-diffs] scratch/record 8b1b962 03/10: Make EIEIO use records., Lars Brinkhoff, 2017/03/24
- [Emacs-diffs] scratch/record 6d6b9b1 01/10: Add record objects with user-defined types., Lars Brinkhoff, 2017/03/24
- [Emacs-diffs] scratch/record 603f016 02/10: Make cl-defstruct use records., Lars Brinkhoff, 2017/03/24
- [Emacs-diffs] scratch/record 7dbb1dc 09/10: * src/data.c (Ftype_of): Return type name, if record's type holds class.,
Lars Brinkhoff <=
- [Emacs-diffs] scratch/record 4ea0d9d 10/10: Make type-of return the type, even for old-style structs, Lars Brinkhoff, 2017/03/24