Re: Unicode lambda Lassi Kortela 12 May 2019 13:46 UTC

> Here's a quick sketch of the idea implemented in 100 lines of R7RS
> Scheme: <https://github.com/lassik/scheme-encoding-declaration>

Added an illustration of some more metadata that could be put into the
same declare-file form:
<https://github.com/lassik/scheme-encoding-declaration/blob/master/test.scm>

I quite like this because you can cleanly extend it with different kinds
of data. And with luck other Lisps could adopt the same form too.
There's nothing preventing you from having that exact same declare-file
form in Common Lisp, Emacs Lisp, or even in Clojure. For implementations
that don't recognize it, you can write a one-line macro to just ignore it.

Probably the raw-byte-based reader should skip all the data in that form
except the encoding declaration. That's simpler, faster and less
error-prone. Once the raw reader has figured out the character encoding,
the other data can be read by the normal Scheme reader.