diff options
author | Andrea Corallo <akrl@sdf.org> | 2021-12-01 14:39:33 +0100 |
---|---|---|
committer | Andrea Corallo <akrl@sdf.org> | 2021-12-01 22:21:04 +0100 |
commit | f3284d5acd96a83b1eead20286e1ba0f81741ac3 (patch) | |
tree | b4385fe3f63b8eb5f8f39e31da711c686f975a5d /lisp/emacs-lisp/comp-cstr.el | |
parent | c35c86a353c7dd6d4130913c532aba026a5a6562 (diff) | |
download | emacs-f3284d5acd96a83b1eead20286e1ba0f81741ac3.tar.gz emacs-f3284d5acd96a83b1eead20286e1ba0f81741ac3.tar.bz2 emacs-f3284d5acd96a83b1eead20286e1ba0f81741ac3.zip |
* Redefine `comp-cstr-shallow-copy'
* lisp/emacs-lisp/comp-cstr.el (comp-cstr): Don't synthesize copier
function.
(comp-cstr-shallow-copy): New function.
(comp-cstr-=): Use `copy-sequence'.
Diffstat (limited to 'lisp/emacs-lisp/comp-cstr.el')
-rw-r--r-- | lisp/emacs-lisp/comp-cstr.el | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/comp-cstr.el b/lisp/emacs-lisp/comp-cstr.el index 5518cdb4c90..7f0af2aaee5 100644 --- a/lisp/emacs-lisp/comp-cstr.el +++ b/lisp/emacs-lisp/comp-cstr.el @@ -70,7 +70,7 @@ (irange &aux (range (list irange)) (typeset ()))) - (:copier comp-cstr-shallow-copy)) + (:copier nil)) "Internal representation of a type/value constraint." (typeset '(t) :type list :documentation "List of possible types the mvar can assume. @@ -133,6 +133,14 @@ Integer values are handled in the `range' slot.") :range (copy-tree (range cstr)) :neg (neg cstr)))) +(defsubst comp-cstr-shallow-copy (dst src) + "Copy the content of SRC into DST." + (with-comp-cstr-accessors + (setf (range dst) (range src) + (valset dst) (valset src) + (typeset dst) (typeset src) + (neg dst) (neg src)))) + (defsubst comp-cstr-empty-p (cstr) "Return t if CSTR is equivalent to the nil type specifier or nil otherwise." (with-comp-cstr-accessors @@ -883,7 +891,7 @@ Non memoized version of `comp-cstr-intersection-no-mem'." "Constraint OP1 being = OP2 setting the result into DST." (with-comp-cstr-accessors (cl-flet ((relax-cstr (cstr) - (setf cstr (comp-cstr-shallow-copy cstr)) + (setf cstr (copy-sequence cstr)) ;; If can be any float extend it to all integers. (when (memq 'float (typeset cstr)) (setf (range cstr) '((- . +)))) |