[asdf-devel] source file encoding

Faré fahree at gmail.com
Sat Jan 29 16:36:04 UTC 2011

Dear Anton,

> How to specify source files encoding in ASD2? I.e. what value to pass to the :external-format argument of the compile-file?
> In the old ASDF I did it by
> (let ((asdf:*compile-file-external-format* #+:clisp charset:cp1251
>                       #+:sbcl :cp1251))
>  (asdf:operate 'asdf:load-op :mysystem))
Sorry, I see no trace of *compile-file-external-format* in 1.369, the
version I inherited from Gary King, or 1.97, the version that Gary
King inherited from Nikodemus and Xof.

I'm not saying what you have isn't a good idea, but it seems to rely
on some local patch to ASDF that was never merged upstream.

> But today the variable asdf:*compile-file-external-format* does not exist. Also, it of course would be better
> to specify the encoding in the .asd file (the system author knows the files encoding, and should care
> about this, but not the system user).
> Could you advise me how to do it?
You need to send me a patch to ASDF that modifies
(defmethod perform ((operation compile-op) (c cl-source-file))
(defmethod perform ((operation load-source-op) (c cl-source-file))
to do something about external-format.

Also it might or might not be a good idea to store the external-format
in a slot of cl-source-file, and to have a proper :initform in it with
a valid default value to be used when upgrading ASDF.

Finally, you need to document that feature in the manual and explain
that it will only be available starting with e.g. ASDF 2.013.

The problem for you will be to reasonably support 11 implementations
existing implementations or so.

Good luck!

[ François-René ÐVB Rideau | Reflection&Cybernethics | http://fare.tunes.org ]
I'm a polyatheist — there are many gods I don't believe in. — Dan Fouts

More information about the asdf-devel mailing list