Hi Mike,

On Wed 27 May 2009 00:26, Mike Gran <spk...@yahoo.com> writes:

> If one can't depend on the order of evaluation, the the source encoding
> has to become a pragma that is preprocessed.

One can depend on the order of evaluation, but not of the order of
reading and evaluation.

> The reader could probably preprocess the file looking for where 
> the text "coding: XXXXX" appears within a comment in the top dozen
> lines of a source code file. Or perhaps a line that is explicitly
> ";;;; #pragma coding: XXXXX" in the top few lines of a file.

This sounds almost sane to me. I think python has a standard for this:

   http://www.python.org/dev/peps/pep-0263/

This is complicated in Guile by #!. A reasonable thing would be to have
the reader have a bit on whether it actually saw an expression yet or
not. If not, "^;+ [^\n]*coding: ..." would set the file's encoding.

Andy
-- 
http://wingolog.org/


Reply via email to