mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-26 15:21:51 -08:00
Symplify (not t) => nil and (not nil) => t
* lisp/emacs-lisp/comp-cstr.el (comp-cstr-negation): Symplify (not t) => nil and (not nil) => t. * test/lisp/emacs-lisp/comp-cstr-tests.el (comp-cstr-typespec-tests-alist): Add two tests.
This commit is contained in:
parent
538f59806c
commit
672988e961
2 changed files with 26 additions and 5 deletions
|
|
@ -695,10 +695,27 @@ DST is returned."
|
|||
"Negate SRC setting the result in DST.
|
||||
DST is returned."
|
||||
(with-comp-cstr-accessors
|
||||
(setf (typeset dst) (typeset src)
|
||||
(valset dst) (valset src)
|
||||
(range dst) (range src)
|
||||
(neg dst) (not (neg src)))
|
||||
(cond
|
||||
((and (null (valset src))
|
||||
(null (range src))
|
||||
(null (neg src))
|
||||
(equal (typeset src) '(t)))
|
||||
(setf (typeset dst) ()
|
||||
(valset dst) ()
|
||||
(range dst) nil
|
||||
(neg dst) nil))
|
||||
((and (null (valset src))
|
||||
(null (range src))
|
||||
(null (neg src))
|
||||
(null (typeset src)))
|
||||
(setf (typeset dst) '(t)
|
||||
(valset dst) ()
|
||||
(range dst) nil
|
||||
(neg dst) nil))
|
||||
(t (setf (typeset dst) (typeset src)
|
||||
(valset dst) (valset src)
|
||||
(range dst) (range src)
|
||||
(neg dst) (not (neg src)))))
|
||||
dst))
|
||||
|
||||
(defun comp-cstr-value-negation (dst src)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue