]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/emacs-lisp/comp-cstr.el (comp-cstr): Better `comp-type-to-cstr'.
authorAndrea Corallo <akrl@sdf.org>
Tue, 29 Dec 2020 10:39:04 +0000 (11:39 +0100)
committerAndrea Corallo <akrl@sdf.org>
Tue, 29 Dec 2020 13:46:23 +0000 (14:46 +0100)
lisp/emacs-lisp/comp-cstr.el

index 57d93912d2f05e58b20960385ec864f8eae2dcf7..8a8e22e030d49afeb51bf20138120c05d6006b8d 100644 (file)
   "Likewise like `cl--all-builtin-types' but with t as common supertype.")
 
 (cl-defstruct (comp-cstr (:constructor comp-type-to-cstr
-                                       (type &aux (typeset (list type))))
+                                       (type &aux
+                                            (null (eq type 'null))
+                                             (integer (eq type 'integer))
+                                            (typeset (if (or null integer)
+                                                         nil
+                                                       (list type)))
+                                            (valset (when null
+                                                      '(nil)))
+                                             (range (when integer
+                                                      '((- . +))))))
                          (:constructor comp-value-to-cstr
                                        (value &aux
                                               (valset (list value))