emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] scratch/record 5aa9a80: * src/data.c (Ftype_of): Return ty


From: Stefan Monnier
Subject: [Emacs-diffs] scratch/record 5aa9a80: * src/data.c (Ftype_of): Return type name, if record's type holds class.
Date: Wed, 22 Mar 2017 13:17:24 -0400 (EDT)

branch: scratch/record
commit 5aa9a80b38c85111daaf83195a144d7361a997cd
Author: Stefan Monnier <address@hidden>
Commit: Stefan Monnier <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 559c92f..39eebdb 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]