[cxml-cvs] CVS update: cxml/runes/runes.lisp

David Lichteblau dlichteblau at common-lisp.net
Sat Jun 25 13:56:57 UTC 2005


Update of /project/cxml/cvsroot/cxml/runes
In directory common-lisp.net:/tmp/cvs-serv10721/runes

Modified Files:
	runes.lisp 
Log Message:
new release

Date: Sat Jun 25 15:56:56 2005
Author: dlichteblau

Index: cxml/runes/runes.lisp
diff -u cxml/runes/runes.lisp:1.2 cxml/runes/runes.lisp:1.3
--- cxml/runes/runes.lisp:1.2	Fri Mar 25 19:16:56 2005
+++ cxml/runes/runes.lisp	Sat Jun 25 15:56:55 2005
@@ -147,12 +147,17 @@
 (defun char-rune (char)
   (code-rune (char-code char)))
 
-(defun rune-char (rune &optional (default #\?))
-  (if (>= rune char-code-limit)
-      default
-      (or (code-char rune) default)))
+(defparameter *invalid-rune* nil ;;#\?
+  "Rune to use as a replacement in RUNE-CHAR and ROD-STRING for runes not
+   representable as characters.  If NIL, an error is signalled instead.")
 
-(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))
 
 (defun string-rod (string)




More information about the Cxml-cvs mailing list