Have `comp-cstr-intersection-no-mem' intersect pos neg value sets

* lisp/emacs-lisp/comp-cstr.el (comp-cstr-intersection-no-mem):
	intersect pos and neg value sets
	* test/lisp/emacs-lisp/comp-cstr-tests.el
	(comp-cstr-typespec-tests-alist): Add two tests and fix some
	test number.
This commit is contained in:
Andrea Corallo 2021-04-27 22:43:12 +02:00
parent 2ab8d1ee3b
commit 4e1e0b9dec
2 changed files with 15 additions and 9 deletions

View file

@ -790,7 +790,9 @@ Non memoized version of `comp-cstr-intersection-no-mem'."
(setf (range pos)
(comp-range-intersection (range pos)
(comp-range-negation (range neg))))
(comp-range-negation (range neg)))
(valset pos)
(cl-set-difference (valset pos) (valset neg)))
;; Return a non negated form.
(setf (typeset dst) (typeset pos)

View file

@ -198,22 +198,26 @@
((and (or symbol string) (or number marker)) . nil)
;; 78
((and t t) . t)
;; 80
;; 79
((and (or marker number) (integer 0 0)) . (integer 0 0))
;; 81
;; 80
((and t (not t)) . nil)
;; 82
;; 81
((or (integer 1 1) (not (integer 1 1))) . t)
;; 83
;; 82
((not t) . nil)
;; 84
;; 83
((not nil) . t)
;; 85
;; 84
((or (not string) t) . t)
;; 86
;; 85
((or (not vector) sequence) . sequence)
;; 86
((or (not symbol) null) . t)
;; 87
((or (not symbol) null) . t))
((and (or null integer) (not (or null integer))) . nil)
;; 88
((and (or (member a b c)) (not (or (member a b)))) . (member c)))
"Alist type specifier -> expected type specifier."))
(defmacro comp-cstr-synthesize-tests ()