[CM] extending the reader?

Gregg Reynolds dev at mobileink.com
Fri Oct 8 06:23:17 PDT 2021


I've got a peculiar need. Literally: it involves "peculiar" identifiers.

I'm using s7 to convert Dune build files to Bazel build files. Dune is the
standard build tool for OCaml.  Its build language syntax is
s-expressions.  Unfortunately they are not quite Scheme s-expressions.
Here's one I've come across that makes the s7 reader puke:

(run %{bin:tezos-protocol-compiler}  .)

The error message is ";read-error ("unexpected close paren: ... (write
(define x '(action .)) ...").."

The problem is the isolated '.'; if I change that to './' then it reads
just fine. I believe that's because './' is a legal "peculiar identifier"
(at least for R7RS) while '.' is not.

So my question is: can I extend the reader to accept '.' as a peculiar
identifier without breaking things?  I'm guessing it would be a simple
change if I knew where that code is, but I'm wondering about unintended
consequences.

Of course I could warn my users that they need to use './' and not '.' (as
a directory name), but I think extending the reader would be better. The
tool is not intended for general programming, and scripts written for it
would have very limited scope, so it's not really critical to have a
strictly conformant Scheme.

Thanks,

Gregg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cm-mail.stanford.edu/pipermail/cmdist/attachments/20211008/da7c3a6c/attachment.html>


More information about the Cmdist mailing list