【问题标题】:How to load Chicken Scheme files that contain #><# sharp-sign read syntax?如何加载包含 #><# sharp-sign read 语法的 Chicken Scheme 文件?
【发布时间】:2016-08-13 19:24:40
【问题描述】:

我可以在 repl 中使用大多数 sharp-sign read macros,或者在使用 (load) 加载的文件中:

#;1> #${ abcdef }
#${abcdef}

但是我不能使用foreign declare语法#&gt; &lt;#

#;1> #>#include "md5-base.c"<#
Error: invalid sharp-sign read syntax: #\>

当然,可能没有理由在 repl 中使用它,但我正在尝试编写一个程序,在运行时 (load)s 其他来源并自省它们,当它遇到语法时它就会崩溃:

(load "/tmp/temp29fe.31217/md5/md5.scm")
; loading /tmp/temp29fe.31217/md5/md5.scm ...

Error: (line 11) invalid sharp-sign read syntax: #\>

        Call history:

        <syntax>          (load "/tmp/temp29fe.31217/md5/md5.scm")
        <eval>    (load "/tmp/temp29fe.31217/md5/md5.scm")      <--

如何(load) 包含#&gt; 尖锐语法的文件?

【问题讨论】:

    标签: scheme chicken-scheme


    【解决方案1】:

    该语法仅在编译器中受支持;在评估代码中使用它是没有意义的。如果您只对在其上使用 read 感兴趣,则可以使用 set-sharp-read-syntax! 定义自己的覆盖。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-05-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多