new release
This commit is contained in:
15
runes.lisp
15
runes.lisp
@ -147,12 +147,17 @@
|
|||||||
(defun char-rune (char)
|
(defun char-rune (char)
|
||||||
(code-rune (char-code char)))
|
(code-rune (char-code char)))
|
||||||
|
|
||||||
(defun rune-char (rune &optional (default #\?))
|
(defparameter *invalid-rune* nil ;;#\?
|
||||||
(if (>= rune char-code-limit)
|
"Rune to use as a replacement in RUNE-CHAR and ROD-STRING for runes not
|
||||||
default
|
representable as characters. If NIL, an error is signalled instead.")
|
||||||
(or (code-char rune) default)))
|
|
||||||
|
|
||||||
(defun rod-string (rod &optional (default-char #\?))
|
(defun rune-char (rune &optional (default *invalid-rune*))
|
||||||
|
(or (if (>= rune char-code-limit)
|
||||||
|
default
|
||||||
|
(or (code-char rune) default))
|
||||||
|
(error "rune cannot be represented as a character: ~A" rune)))
|
||||||
|
|
||||||
|
(defun rod-string (rod &optional (default-char *invalid-rune*))
|
||||||
(map 'string (lambda (x) (rune-char x default-char)) rod))
|
(map 'string (lambda (x) (rune-char x default-char)) rod))
|
||||||
|
|
||||||
(defun string-rod (string)
|
(defun string-rod (string)
|
||||||
|
|||||||
Reference in New Issue
Block a user