master: Add explicit-check to character
stassats via Sbcl-commits <[email protected]> Sat, 02 May 2026 22:25:39 +0000
| Newsgroups | gmane.lisp.steel-bank.cvs |
|---|---|
| Message-ID | <[email protected]> |
The branch "master" has been updated in SBCL:
via cd730df2e1438675477515e5a31f46e480039a4d (commit)
from 39a97c73287f1f55dae37dc2e351badb5da2536f (commit)
- Log -----------------------------------------------------------------
commit cd730df2e1438675477515e5a31f46e480039a4d
Author: Stas Boukarev <[email protected]>
Date: Sun May 3 01:23:14 2026 +0300
Add explicit-check to character
---
src/code/target-char.lisp | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/src/code/target-char.lisp b/src/code/target-char.lisp
index a6d2ce141..fa764d9f9 100644
--- a/src/code/target-char.lisp
+++ b/src/code/target-char.lisp
@@ -259,23 +259,22 @@ there are no character bits or fonts.)"
(defun character (object)
"Coerce OBJECT into a CHARACTER if possible. Legal inputs are characters,
strings and symbols of length 1."
- (flet ((do-error (control args)
+ (declare (explicit-check))
+ (flet ((do-error (control)
(error 'simple-type-error
:datum object
:expected-type 'character-designator
:format-control control
- :format-arguments args)))
+ :format-arguments (list object))))
(typecase object
(character object)
(string (if (= 1 (length (the string object)))
(char object 0)
- (do-error
- "String is not of length one: ~S" (list object))))
+ (do-error "String is not of length one: ~S")))
(symbol (if (= 1 (length (symbol-name object)))
(schar (symbol-name object) 0)
- (do-error
- "Symbol name is not of length one: ~S" (list object))))
- (t (do-error "~S cannot be coerced to a character." (list object))))))
+ (do-error "Symbol name is not of length one: ~S")))
+ (t (do-error "~S cannot be coerced to a character.")))))
;;;; predicates
-----------------------------------------------------------------------
hooks/post-receive
--
SBCL