How to determine allowable external formats at run time

Alan Ruttenberg alanruttenberg at
Mon Mar 26 04:06:25 UTC 2018

On Sat, Mar 24, 2018 at 7:14 PM, Robert Dodier <robert.dodier at>

> Hi,
> I'm wondering if there is a way to get the list of allowable values of
> the :EXTERNAL-FORMAT keyword for OPEN. Is there a way to determine the
> possible values at run time? I looked into the source code for
> MAKE-FILE-STREAM but I got a little lost ... perhaps someone can point
> me in the right direction.
> What I'm trying to do is to verify whether a given format is
> acceptable. I am thinking that I can inspect a list to see if the
> given format is on the list. Another workable solution would be a
> function which can report whether the given format is acceptable, if
> such a function exists.

I don't know that there's a way to enumerate them. However you can call
open with an external format and it seems it will throw an exception if it
isn't one.

Undefined encoding: FUDGE
   [Condition of type simple-error]

 0: [retry] Retry SLIME REPL evaluation request.
 1: [*abort] Return to SLIME's top level.
 2: [abort] Abort thread.

  0: (invoke-debugger #<simple-error {2EDCBCEA}>)
  1: org.armedbear.lisp.Lisp.error(

There's also some documentation in
shows that one of the possibilities is a list with a charset as car. You
can get the available charsets with

(loop for k being the hash-keys of (jss::hashmap-to-hashtable
(#"availableCharsets" 'charset.charset)) collect k)


> Thanks for your help,
> Robert Dodier
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the armedbear-devel mailing list