[Openmcl-cvs-notifications] r15328 - in /trunk/source: level-1/l1-unicode.lisp lib/ccl-export-syms.lisp

rme at clozure.com rme at clozure.com
Mon Apr 16 12:34:18 CDT 2012


Author: rme
Date: Mon Apr 16 12:34:17 2012
New Revision: 15328

Log:
Define and export ccl:list-character-encodings.  Use it
in ccl:describe-character-encodings.

Closes ticket:948.

Modified:
    trunk/source/level-1/l1-unicode.lisp
    trunk/source/lib/ccl-export-syms.lisp

Modified: trunk/source/level-1/l1-unicode.lisp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/source/level-1/l1-unicode.lisp (original)
+++ trunk/source/level-1/l1-unicode.lisp Mon Apr 16 12:34:17 2012
@@ -4696,6 +4696,17 @@
   :character-size-in-octets-function 'four-octets-per-character
   )
 =

+(defun list-character-encodings (&key include-aliases)
+  "Return a list of the names of supported character encodings."
+  (let ((names nil))
+    (maphash #'(lambda (name enc)
+		 (if (eq name (character-encoding-name enc))
+		   (push name names)
+		   (when include-aliases
+		     (push name names))))
+	     *character-encodings*)
+    names))
+
 (defun describe-character-encoding (name)
   (let* ((enc (lookup-character-encoding name)))
     (when enc
@@ -4711,11 +4722,7 @@
         (values)))))
       =

 (defun describe-character-encodings ()
-  (let* ((names nil))
-    (maphash #'(lambda (name enc)
-                 (when (eq name (character-encoding-name enc))
-                   (push name names)))
-             *character-encodings*)
+  (let* ((names (list-character-encodings)))
     (dolist (name (sort names #'string<) (values))
       (describe-character-encoding name))))
 =


Modified: trunk/source/lib/ccl-export-syms.lisp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/source/lib/ccl-export-syms.lisp (original)
+++ trunk/source/lib/ccl-export-syms.lisp Mon Apr 16 12:34:17 2012
@@ -709,6 +709,7 @@
      external-format-line-termination
      character-encoding
      define-character-encoding
+     list-character-encodings
      describe-character-encoding
      describe-character-encodings
      get-character-encoding



More information about the Openmcl-cvs-notifications mailing list