From a3b816ff8ce17ec559043b053e60b631e5dc5eb8 Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Tue, 29 Dec 2020 14:31:16 +0100 Subject: [PATCH] * lisp/emacs-lisp/comp-cstr.el (comp-cstr): Better `comp-value-to-cstr'. --- lisp/emacs-lisp/comp-cstr.el | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lisp/emacs-lisp/comp-cstr.el b/lisp/emacs-lisp/comp-cstr.el index ce702422932..c03056e3afe 100644 --- a/lisp/emacs-lisp/comp-cstr.el +++ b/lisp/emacs-lisp/comp-cstr.el @@ -61,7 +61,11 @@ '((- . +)))))) (:constructor comp-value-to-cstr (value &aux - (valset (list value)) + (integer (integerp value)) + (valset (unless integer + (list value))) + (range (when integer + `((,value . ,value)))) (typeset ()))) (:constructor comp-irange-to-cstr (irange &aux @@ -170,9 +174,8 @@ Return them as multiple value." collect cstr into positives finally return (cl-values positives negatives))) -(defvar comp-cstr-one (make-comp-cstr :typeset () - :range '((1 . 1))) - "Represent the integer immediate one (1).") +(defvar comp-cstr-one (comp-value-to-cstr 1) + "Represent the integer immediate one.") (defun comp-pred-to-cstr (predicate) "Given PREDICATE return the correspondig constraint." -- 2.39.5