From 62964aced3a1480849e0bc9de1b0ca927b2e2475 Mon Sep 17 00:00:00 2001 From: Stas Boukarev Date: Tue, 18 Dec 2012 21:38:24 +0400 Subject: [PATCH] Better error message for SLEEP. Add explicit-check to defknown, sleep already explicitly checks the argument. Slightly improve the produced error message. --- src/code/toplevel.lisp | 3 ++- src/compiler/fndb.lisp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/code/toplevel.lisp b/src/code/toplevel.lisp index a72e064..f5a7aa9 100644 --- a/src/code/toplevel.lisp +++ b/src/code/toplevel.lisp @@ -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))) diff --git a/src/compiler/fndb.lisp b/src/compiler/fndb.lisp index a83a568..ac1482d 100644 --- a/src/compiler/fndb.lisp +++ b/src/compiler/fndb.lisp @@ -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 -- 1.7.10.4