Hi, MIT Scheme people,

I have run across an annoying issue which seems like it should be easy
to solve, but I can't find documentation on this anywhere. I am
reporting to "mit-scheme-users" because I suspect this is perhaps not
a bug but a feature.

When I try to `load` or compile (with `cf`) a Scheme program, for
example `(load "./lib/thing.sld")`, I get an error:

    Unexpected read restart on: #[textual-input-port 1 for file
"./lib/thing.sld"]

I did some dissecting, and it turns out that the problem is caused by
a comment line "-*- coding: utf-8 -*-". When I remove this line, both
`cf` and `load` work without issue. I did a check with `read-char` and
could confirm that the entire file contains only ASCII characters
(code points 127 and lower), so I do not believe the issue is a
mismatched character encoding.

My Scheme version:

    Image saved on Tuesday May 16, 2023 at 2:38:25 PM
      Release 12.1 || SF || LIAR/x86-64

I have also tried this on Mac OS using the "svm1" and can reproduce
this exact same issue there as well.

I cannot find any documentation on `load-options` or how to configure
the textual port readers to ignore these comment lines. I can work
around this issue by removing these comments, of course, but it seems
a little odd to have to alter my source code for MIT Scheme because of
this issue. I'd like to be able to keep the special editor comments
"-*- encoding: utf-8 -*-" if possible.

Any advice would be appreciated.

Thanks in advance for your help,
-- Ramin Honary

Reply via email to