Permalink
Browse files

Better error message for SLEEP.

Add explicit-check to defknown, sleep already explicitly checks the
argument.
Slightly improve the produced error message.
  • Loading branch information...
1 parent 9f53ac7 commit 62964aced3a1480849e0bc9de1b0ca927b2e2475 @stassats stassats committed Dec 18, 2012
Showing with 3 additions and 2 deletions.
  1. +2 −1 src/code/toplevel.lisp
  2. +1 −1 src/compiler/fndb.lisp
View
@@ -198,7 +198,8 @@ any non-negative real number."
(when (or (not (realp seconds))
(minusp seconds))
(error 'simple-type-error
- :format-control "invalid argument to SLEEP: ~S"
+ :format-control "Invalid argument to SLEEP: -1, ~
+ should be a non-negative real."
:format-arguments (list seconds)
:datum seconds
:expected-type '(real 0)))
View
@@ -1367,7 +1367,7 @@
(defknown (get-internal-run-time get-internal-real-time)
() internal-time (flushable))
-(defknown sleep ((or (rational 0) (float 0.0))) null)
+(defknown sleep ((real 0)) null (explicit-check))
;;; Even though ANSI defines LISP-IMPLEMENTATION-TYPE and
;;; LISP-IMPLEMENTATION-VERSION to possibly punt and return NIL, we

0 comments on commit 62964ac

Please sign in to comment.