From: Michael Albinus Date: Wed, 29 Aug 2018 08:56:02 +0000 (+0200) Subject: Merge branch 'master' into feature/tramp-thread-safe X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=06a2f822a299867e956e38b9210ec2d86e37cf00;p=emacs.git Merge branch 'master' into feature/tramp-thread-safe --- 06a2f822a299867e956e38b9210ec2d86e37cf00 diff --cc lisp/subr.el index 7313d3b65ad,9e880bc880e..8d04da842f1 --- a/lisp/subr.el +++ b/lisp/subr.el @@@ -366,11 -366,27 +366,32 @@@ was called. (declare (compiler-macro (lambda (_) `(= 0 ,number)))) (= 0 number)) + (defun fixnump (object) + "Return t if OBJECT is a fixnum." + (and (integerp object) + (<= most-negative-fixnum object most-positive-fixnum))) + + (defun bignump (object) + "Return t if OBJECT is a bignum." + (and (integerp object) (not (fixnump object)))) + + (defun lsh (value count) + "Return VALUE with its bits shifted left by COUNT. + If COUNT is negative, shifting is actually to the right. + In this case, if VALUE is a negative fixnum treat it as unsigned, + i.e., subtract 2 * most-negative-fixnum from VALUE before shifting it." + (when (and (< value 0) (< count 0)) + (when (< value most-negative-fixnum) + (signal 'args-out-of-range (list value count))) + (setq value (logand (ash value -1) most-positive-fixnum)) + (setq count (1+ count))) + (ash value count)) + +(defun xor (pred1 pred2) + "Return the logical exclusive or of predicates PRED1 and PRED2." + (and (or pred1 pred2) + (not (and pred1 pred2)))) + ;;;; List functions.