Opened 7 years ago
Closed 4 years ago
#456 closed defect (fixed)
SYSTEM:AVAILABLE-ENCODINGS symbols strangeness
Reported by: | Mark Evenson | Owned by: | Mark Evenson |
---|---|---|---|
Priority: | minor | Milestone: | 1.8.0 |
Component: | other | Version: | |
Keywords: | Cc: | ||
Parent Tickets: |
Description
In https://github.com/armedbear/abcl/issues/82 Robert Dodier reports
I see that SYSTEM:AVAILABLE-ENCODINGS returns a list of symbols which
represent the various encodings that are discovered via
Charset.availableCharsets. That's great, but the symbols are
apparently not interned in the keyword package, so it makes it
somewhat confusing to determine whether a given encoding is on the
list.
e.g. (member :utf-16 (system:available-encodings))
returns NIL, although looking at the list, you can see that :UTF-16
is there.
Confusingly, {(mapcar #'symbol-package (system:available-encodings))
} shows that all symbols are in the keyword package, but (find-symbol "UTF-16" :keyword)
returns NIL.
I believe the problem is that availableEncodings
in src/org/armedbear/lisp/Stream.java says, in part, (at line 399 in the current version)
new Symbol(charset, PACKAGE_KEYWORD)
but I think more appropriate would be
PACKAGE_KEYWORD.intern(charset)
Here is a patch which implements that change, and fixes the bug, from what I can tell.
Index: src/org/armedbear/lisp/Stream.java =================================================================== --- src/org/armedbear/lisp/Stream.java (revision 15113) +++ src/org/armedbear/lisp/Stream.java (working copy) @@ -396,7 +396,7 @@ SortedMap<String, Charset> available = Charset.availableCharsets(); Set<String> encodings = available.keySet(); for (String charset : encodings) { - result.add(new Symbol(charset, PACKAGE_KEYWORD)); + result.add (PACKAGE_KEYWORD.intern (charset)); } return result; }
Change History (7)
comment:1 Changed 5 years ago by
Milestone: | 1.6.0 → 1.6.1 |
---|
comment:3 Changed 5 years ago by
Milestone: | 1.6.2 → 1.7.0 |
---|
comment:7 Changed 4 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Ticket retargeted after milestone closed