From e2418891a4aaafe89c885a18a69abeb03f28b919 Mon Sep 17 00:00:00 2001 From: Dimitri Fontaine Date: Thu, 23 Jun 2022 17:15:47 +0200 Subject: [PATCH] Fix looping over sbcl *external-formats*. The internal represtation of the SBCL *external-formats* has changed to a new structure which is not an hash-table anymore. --- src/utils/charsets.lisp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/utils/charsets.lisp b/src/utils/charsets.lisp index 692eae5..9131d0f 100644 --- a/src/utils/charsets.lisp +++ b/src/utils/charsets.lisp @@ -232,8 +232,20 @@ in 2 bytes. #+ccl (parse-ccl-encodings-desc (with-output-to-string (*standard-output*) (ccl:describe-character-encodings))) - #+sbcl - (let ((result '())) + #+sbcl + (typecase sb-impl::*external-formats* + (vector + (loop :for encoding :across sb-impl::*external-formats* + :when encoding + :collect + (mapcar (function string-upcase) + (typecase encoding + (sb-impl::external-format + (slot-value encoding 'sb-impl::names)) + (list + (slot-value (first encoding) 'sb-impl::names)))))) + (hash-table + (let ((result '())) (maphash (lambda (name encoding) (declare (ignore name)) (pushnew encoding result)) @@ -241,7 +253,7 @@ in 2 bytes. (mapcar (lambda (encoding) (mapcar (function string-upcase) (slot-value encoding 'sb-impl::names))) - result)))) + result)))))) (sort encoding-and-aliases #'string< :key #'car))) (defun show-encodings ()