emacs-diffs
[Top][All Lists]
Advanced

[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:



reply via email to

[Prev in Thread] Current Thread [Next in Thread]