1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-23 22:20:24 -08:00

* lisp/emacs-lisp/comp-cstr.el (comp-cstr): Better `comp-value-to-cstr'.

This commit is contained in:
Andrea Corallo 2020-12-29 14:31:16 +01:00
parent c4efb49a27
commit a3b816ff8c

View file

@ -61,7 +61,11 @@
'((- . +)))))) '((- . +))))))
(:constructor comp-value-to-cstr (:constructor comp-value-to-cstr
(value &aux (value &aux
(valset (list value)) (integer (integerp value))
(valset (unless integer
(list value)))
(range (when integer
`((,value . ,value))))
(typeset ()))) (typeset ())))
(:constructor comp-irange-to-cstr (:constructor comp-irange-to-cstr
(irange &aux (irange &aux
@ -170,9 +174,8 @@ Return them as multiple value."
collect cstr into positives collect cstr into positives
finally return (cl-values positives negatives))) finally return (cl-values positives negatives)))
(defvar comp-cstr-one (make-comp-cstr :typeset () (defvar comp-cstr-one (comp-value-to-cstr 1)
:range '((1 . 1))) "Represent the integer immediate one.")
"Represent the integer immediate one (1).")
(defun comp-pred-to-cstr (predicate) (defun comp-pred-to-cstr (predicate)
"Given PREDICATE return the correspondig constraint." "Given PREDICATE return the correspondig constraint."