<div dir="ltr"><div>Thanks. Looking at the c code I realized I made an embarrassingly dumb mistake interpreting the error. The problem is not that the reader does not accept '.', but that it expects it to be followed by an expression as in '(a . b)'. So it chokes on '(a .)', as it should. Hacking the C code to accept the latter would obviously be a bad idea. ;) So I'll just catch the error and tell the user to use './' instead of '.'.</div><div><br></div><div>On the other hand, it would be nice if the error args included the string that caused the error in a more convenient form. It's included in the message string, but it would be nice if it were passed in isolation, like '(:data ...badcode here...)' or some such.</div><div><br></div><div>Thanks!</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Oct 8, 2021 at 9:27 AM <<a href="mailto:bil@ccrma.stanford.edu">bil@ccrma.stanford.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I can't think of a way to do this in scheme code.<br>
*read-error-hook* is not currently called at the<br>
point of the error (probably line 69449 in s7.c).<br>
I suppose it could be called, but I'd need to back<br>
out with the new input (if any), which would take<br>
a ton of testing. You could change the C code,<br>
perhaps --<br>
<br>
{<br>
s7_pointer pt;<br>
pt = current_input_port(sc);<br>
fprintf(stderr, "%c\n", port_data(pt)[port_position(pt) - 2]);<br>
}<br>
<br>
at that pointer prints ".", so you know it's reading<br>
".)". You'd need to add the symbol ./ to the current<br>
list in the reader, then pop back to whatever was<br>
being read before that -- kinda tricky!<br>
I'll look into extending *read-error-hook*, but with<br>
input like that, there are probably more such gotchas.<br>
<br>
</blockquote></div></div>