Email list hosting service & mailing list manager

Unicode lambda Lassi Kortela (12 May 2019 10:19 UTC)
Re: Unicode lambda Shiro Kawai (12 May 2019 11:18 UTC)
Re: Unicode lambda Lassi Kortela (12 May 2019 11:40 UTC)
Re: Unicode lambda Lassi Kortela (12 May 2019 11:50 UTC)
Re: Unicode lambda Shiro Kawai (12 May 2019 12:06 UTC)
Re: Unicode lambda Marc Nieper-Wißkirchen (12 May 2019 12:11 UTC)
Re: Unicode lambda Lassi Kortela (12 May 2019 12:23 UTC)
Re: Unicode lambda Lassi Kortela (12 May 2019 13:23 UTC)
Re: Unicode lambda Lassi Kortela (12 May 2019 13:46 UTC)
Re: Unicode lambda John Cowan (12 May 2019 14:20 UTC)
Re: Unicode lambda Lassi Kortela (12 May 2019 14:38 UTC)
Re: Unicode lambda Lassi Kortela (12 May 2019 14:55 UTC)
Re: Unicode lambda John Cowan (12 May 2019 15:00 UTC)
Re: Unicode lambda Lassi Kortela (12 May 2019 15:20 UTC)
Re: Unicode lambda Shiro Kawai (12 May 2019 18:42 UTC)
Re: Unicode lambda Lassi Kortela (12 May 2019 19:43 UTC)
Re: Unicode lambda John Cowan (12 May 2019 22:29 UTC)
Re: Unicode lambda Shiro Kawai (13 May 2019 10:48 UTC)
Re: Unicode lambda Lassi Kortela (14 May 2019 08:25 UTC)
Re: Unicode lambda Marc Nieper-Wißkirchen (14 May 2019 08:50 UTC)
Re: Unicode lambda Lassi Kortela (14 May 2019 10:10 UTC)
Re: Unicode lambda Lassi Kortela (14 May 2019 10:59 UTC)
Re: Unicode lambda Lassi Kortela (14 May 2019 12:35 UTC)
Re: Unicode lambda Lassi Kortela (14 May 2019 13:09 UTC)
Re: Unicode lambda Lassi Kortela (14 May 2019 14:04 UTC)
Re: Unicode lambda Shiro Kawai (14 May 2019 19:18 UTC)
Re: Unicode lambda Vincent Manis (14 May 2019 22:01 UTC)
Re: Unicode lambda Lassi Kortela (20 May 2019 09:21 UTC)
Re: Unicode lambda Marc Nieper-Wißkirchen (21 Oct 2019 14:20 UTC)
Re: Unicode lambda Shiro Kawai (21 Oct 2019 17:19 UTC)
Re: Unicode lambda John Cowan (21 Oct 2019 17:39 UTC)
Re: Unicode lambda Marc Nieper-Wißkirchen (21 Oct 2019 18:43 UTC)
Re: Unicode lambda John Cowan (21 Oct 2019 23:27 UTC)
Encoding declarations Lassi Kortela (22 Oct 2019 08:39 UTC)
Re: Encoding declarations John Cowan (22 Oct 2019 20:52 UTC)
#! directives, general and specific Lassi Kortela (22 Oct 2019 09:11 UTC)
Re: #! directives, general and specific John Cowan (22 Oct 2019 20:27 UTC)
Re: #! directives, general and specific Lassi Kortela (22 Oct 2019 20:43 UTC)
Re: Unicode lambda Marc Nieper-Wißkirchen (13 May 2019 08:50 UTC)
Re: Unicode lambda Lassi Kortela (13 May 2019 10:27 UTC)
Re: Unicode lambda Per Bothner (12 May 2019 14:17 UTC)
Re: Unicode lambda Peter (12 May 2019 15:06 UTC)

Re: Unicode lambda Lassi Kortela 12 May 2019 11:40 UTC

> I've been inclined to write "source code encoding magic comment" srfi,
> which Gauche is using.

Do you mean lines like this: ";; -*- coding:utf-8 -*-" -- this is the
same syntax that is used by Emacs, right?

> Without it, using non-ascii characters in the source code may cause a
> portability issue.

This is definitely true, but seems less of a problem with every passing
year. IMHO mandating UTF-8 would be simpler than choosing from a variety
of source file encodings. Is there still a large user base writing
Scheme in other encodings?

> If there's a comment that matches a specific pattern at the beginning of the source, it can
> specify the file encoding

If there is a facility to specify the file encoding, could it be an
S-expression instead of a magic comment? Magic comments are a hack in
general and Scheme/Lisp macros let us easily add metadata as
S-expressions. Emacs Lisp recently added "-*- lexical-binding: t -*-"
comments now that is has lexical binding support. I don't understand why
they didn't just go with some Lisp form such as (declare-file
(lexical-binding t)).

In the case of "-*- coding: -*-" I understand that Emacs already parses
it so the compatibility is valuable. However, it's not parsed by Vim and
other editors (which have their own editor-specific magic comments).
There are less magic and more portable solutions such as `.editorconfig`
files (<https://editorconfig.org/>) which are also easily supported by
Emacs (just install the 'editorconfig' package from MELPA) and many
other editors and require no annotations in Scheme files.

`.editorconfig` files are not (and probably should not be) parsed by
Scheme when loading source code, but if encoding markers are put in
Scheme files I think a S-expression such as (declare-file (coding
utf-8)) would be cleaner than a magic comment. Does S-expression parsing
have problems that do not occur with comment parsing (e.g. when using
non-ASCII-superset multi-byte encodings such as UTF-16 or Shift-JIS)?