mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-28 16:00:22 +02:00
integerp, wholenump return nil for non-numbers
* module/language/elisp/boot.el (integerp, wholenump): Call `integer?' before `exact?' so that these predicates return nil for non-numbers instead of signalling an error.
This commit is contained in:
parent
bc61280992
commit
fc45b7e8e8
1 changed files with 3 additions and 5 deletions
|
@ -237,16 +237,14 @@
|
|||
(null (funcall (@ (guile) integer?) object)))))
|
||||
|
||||
(defun integerp (object)
|
||||
(and (funcall (@ (guile) exact?) object)
|
||||
(funcall (@ (guile) integer?) object)))
|
||||
(and (funcall (@ (guile) integer?) object)
|
||||
(funcall (@ (guile) exact?) object)))
|
||||
|
||||
(defun numberp (object)
|
||||
(funcall (@ (guile) real?) object))
|
||||
|
||||
(defun wholenump (object)
|
||||
(and (funcall (@ (guile) exact?) object)
|
||||
(funcall (@ (guile) integer?) object)
|
||||
(>= object 0)))
|
||||
(and (integerp object) (>= object 0)))
|
||||
|
||||
(defun zerop (object)
|
||||
(= object 0))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue