summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/comp-cstr.el
diff options
context:
space:
mode:
authorAndrea Corallo <akrl@sdf.org>2020-12-29 11:39:04 +0100
committerAndrea Corallo <akrl@sdf.org>2020-12-29 14:46:23 +0100
commitba41a183dd5123130a0393b84658ec3f2fdd66f4 (patch)
tree969d7100d5f279b069318502bc592b2ef60799a3 /lisp/emacs-lisp/comp-cstr.el
parent2b3c7c751739f48545c3888549ae312ea334951b (diff)
downloademacs-ba41a183dd5123130a0393b84658ec3f2fdd66f4.tar.gz
emacs-ba41a183dd5123130a0393b84658ec3f2fdd66f4.tar.bz2
emacs-ba41a183dd5123130a0393b84658ec3f2fdd66f4.zip
* lisp/emacs-lisp/comp-cstr.el (comp-cstr): Better `comp-type-to-cstr'.
Diffstat (limited to 'lisp/emacs-lisp/comp-cstr.el')
-rw-r--r--lisp/emacs-lisp/comp-cstr.el11
1 files changed, 10 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/comp-cstr.el b/lisp/emacs-lisp/comp-cstr.el
index 57d93912d2f..8a8e22e030d 100644
--- a/lisp/emacs-lisp/comp-cstr.el
+++ b/lisp/emacs-lisp/comp-cstr.el
@@ -49,7 +49,16 @@
"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))