From 1dfcc79e83d3db031b45e9f6b9314dc1f0697b1d Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 19 Feb 2013 21:07:07 -0500 Subject: [PATCH] Make cl-floatp-safe just an alias for floatp * lisp/emacs-lisp/cl-lib.el (cl-floatp-safe): Make it an alias for floatp. * lisp/emacs-lisp/cl-macs.el (cl--make-type-test) (cl--compiler-macro-assoc): Use floatp rather than cl-floatp-safe. * doc/misc/cl.texi: Remove commented out sections about cl-floatp-safe. --- doc/misc/cl.texi | 16 ---------------- lisp/ChangeLog | 6 ++++++ lisp/emacs-lisp/cl-lib.el | 6 +----- lisp/emacs-lisp/cl-macs.el | 8 ++++---- 4 files changed, 11 insertions(+), 25 deletions(-) diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi index 11f19c8df0..83df411cb2 100644 --- a/doc/misc/cl.texi +++ b/doc/misc/cl.texi @@ -703,14 +703,6 @@ The type symbol @code{real} is a synonym for @code{number}, and The type symbols @code{character} and @code{string-char} match integers in the range from 0 to 255. -@c No longer relevant, so covered by first item above (float -> floatp). -@ignore -@item -The type symbol @code{float} uses the @code{cl-floatp-safe} predicate -defined by this package rather than @code{floatp}, so it will work -correctly even in Emacs versions without floating-point support. -@end ignore - @item The type list @code{(integer @var{low} @var{high})} represents all integers between @var{low} and @var{high}, inclusive. Either bound @@ -2921,14 +2913,6 @@ This predicate tests whether @var{integer} is even. It is an error if the argument is not an integer. @end defun -@ignore -@defun cl-floatp-safe object -This predicate tests whether @var{object} is a floating-point -number. On systems that support floating-point, this is equivalent -to @code{floatp}. On other systems, this always returns @code{nil}. -@end defun -@end ignore - @node Numerical Functions @section Numerical Functions diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c1e75fcdca..081583258b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2013-02-20 Glenn Morris + + * emacs-lisp/cl-lib.el (cl-floatp-safe): Make it an alias for floatp. + * emacs-lisp/cl-macs.el (cl--make-type-test) + (cl--compiler-macro-assoc): Use floatp rather than cl-floatp-safe. + 2013-02-19 Michael Albinus * net/tramp-cache.el (tramp-get-hash-table): New defun. diff --git a/lisp/emacs-lisp/cl-lib.el b/lisp/emacs-lisp/cl-lib.el index 2de8260c94..f3bf70b019 100644 --- a/lisp/emacs-lisp/cl-lib.el +++ b/lisp/emacs-lisp/cl-lib.el @@ -271,11 +271,7 @@ so that they are registered at compile-time as well as run-time." ;;; Numbers. -(defun cl-floatp-safe (object) - "Return t if OBJECT is a floating point number. -On Emacs versions that lack floating-point support, this function -always returns nil." - (and (numberp object) (not (integerp object)))) +(define-obsolete-function-alias 'cl-floatp-safe 'floatp "24.4") (defsubst cl-plusp (number) "Return t if NUMBER is positive." diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index b63086d7a5..e9cc200baa 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -2520,7 +2520,7 @@ The type name can then be used in `cl-typecase', `cl-check-type', etc." ((memq type '(nil t)) type) ((eq type 'null) `(null ,val)) ((eq type 'atom) `(atom ,val)) - ((eq type 'float) `(cl-floatp-safe ,val)) + ((eq type 'float) `(floatp ,val)) ((eq type 'real) `(numberp ,val)) ((eq type 'fixnum) `(integerp ,val)) ;; FIXME: Should `character' accept things like ?\C-\M-a ? --Stef @@ -2739,7 +2739,7 @@ surrounded by (cl-block NAME ...). (cond ((eq test 'eq) `(assq ,a ,list)) ((eq test 'equal) `(assoc ,a ,list)) ((and (macroexp-const-p a) (or (null keys) (eq test 'eql))) - (if (cl-floatp-safe (cl--const-expr-val a)) + (if (floatp (cl--const-expr-val a)) `(assoc ,a ,list) `(assq ,a ,list))) (t form)))) @@ -2776,7 +2776,7 @@ surrounded by (cl-block NAME ...). (put y 'side-effect-free t)) ;;; Things that are inline. -(cl-proclaim '(inline cl-floatp-safe cl-acons cl-map cl-concatenate cl-notany +(cl-proclaim '(inline cl-acons cl-map cl-concatenate cl-notany cl-notevery cl--set-elt cl-revappend cl-nreconc gethash)) ;;; Things that are side-effect-free. @@ -2787,7 +2787,7 @@ surrounded by (cl-block NAME ...). ;;; Things that are side-effect-and-error-free. (mapc (lambda (x) (put x 'side-effect-free 'error-free)) - '(eql cl-floatp-safe cl-list* cl-subst cl-acons cl-equalp + '(eql cl-list* cl-subst cl-acons cl-equalp cl-random-state-p copy-tree cl-sublis)) -- 2.20.1