closure-common:sbcl borks,因为标准的readtable modified

时间:2016-02-12 18:26:53

标签: lisp common-lisp sbcl

我将quicklisp更新到最新的二月版本,然后为我正在开发的xlmanip工作簿/工作表阅读器重新运行了一些单元测试。 SBCL对单元测试进行了测试,因为它重新编译了closure-common包,而closure-common修改了标准的可读表(实际上是一种很好的方式)。

我的一个选择是分叉closure-common代码库,希望维护者实际响应补丁,并祈祷修补程序被接受,遵循clozure-common依赖于quicklisp {{1}因为同样的原因也被称为。

是否有人知道此问题的解决方法? SET-DISPATCH-MACRO-CHARACTER并不是唯一有这个问题的软件包,我相当肯定。

编辑:如果我必须克隆并破解closure-common,那么本地化可读修改或切换到自定义可读表的建议/首选方法是什么?

编辑#2:这里是使用新安装的quicklisp的输出脚本(具体来说,请查看clozure-common调用closure-common-20101107-git/syntax.lisp的最后一行):

SET-DISPATCH-MACRO-CHARACTER

生成此输出的脚本:

To load "xlmanip/tests":
  Load 1 ASDF system:
    xlmanip/tests
; Loading "xlmanip/tests"
.
;;; Checking for wide character support... WARNING: Lisp implementation doesn't use UTF-16, but accepts surrogate code points.
 yes, using code points.
..
;;; Checking for wide character support... WARNING: Lisp implementation doesn't use UTF-16, but accepts surrogate code points.
 yes, using code points.
;;; Building Closure with CHARACTER RUNES
........While evaluating the form starting at line 4, column 0
  of #P"/tmp/xlmanip17497a.lisp":
Fatal condition:
SET-DISPATCH-MACRO-CHARACTER would modify the standard readtable.
See also:
  The ANSI Standard, Section 2.1.1.2
  The ANSI Standard, Glossary entry for "standard readtable"
Backtrace for: #<SB-THREAD:THREAD "main thread" RUNNING {1002A7D263}>
0: ((LAMBDA NIL :IN SB-DEBUG::FUNCALL-WITH-DEBUG-IO-SYNTAX))
1: (SB-IMPL::CALL-WITH-SANE-IO-SYNTAX #<CLOSURE (LAMBDA NIL :IN SB-DEBUG::FUNCALL-WITH-DEBUG-IO-SYNTAX) {1006B1F8BB}>)
2: (SB-IMPL::%WITH-STANDARD-IO-SYNTAX #<CLOSURE (LAMBDA NIL :IN SB-DEBUG::FUNCALL-WITH-DEBUG-IO-SYNTAX) {1006B1F88B}>)
3: (SB-DEBUG:PRINT-BACKTRACE :STREAM #<SB-SYS:FD-STREAM for "standard error" {1003135713}> :START 0 :FROM :DEBUGGER-FRAME :COUNT 4611686018427387903 :PRINT-THREAD T :PRINT-FRAME-SOURCE NIL :METHOD-FRAME-STYLE NIL :EMERGENCY-BEST-EFFORT NIL)
4: ((LAMBDA NIL :IN UIOP/IMAGE:PRINT-BACKTRACE))
5: ((LAMBDA NIL :IN UIOP/STREAM:CALL-WITH-SAFE-IO-SYNTAX))
6: (SB-IMPL::%WITH-STANDARD-IO-SYNTAX #<CLOSURE (LAMBDA NIL :IN UIOP/STREAM:CALL-WITH-SAFE-IO-SYNTAX) {1006B1F86B}>)
7: (UIOP/IMAGE:PRINT-CONDITION-BACKTRACE #<SB-INT:STANDARD-READTABLE-MODIFIED-ERROR {1006B1D643}> :STREAM #<SB-SYS:FD-STREAM for "standard error" {1003135713}> :COUNT NIL)
8: (UIOP/IMAGE:HANDLE-FATAL-CONDITION #<SB-INT:STANDARD-READTABLE-MODIFIED-ERROR {1006B1D643}>)
9: (SIGNAL #<SB-INT:STANDARD-READTABLE-MODIFIED-ERROR {1006B1D643}>)
10: (CERROR "Frob it anyway!" SB-INT:STANDARD-READTABLE-MODIFIED-ERROR :OPERATION SET-DISPATCH-MACRO-CHARACTER)
11: (SET-DISPATCH-MACRO-CHARACTER #\# #\/ RUNES::RUNE-READER #<READTABLE {100041EA83}>)
12: (SB-FASL::LOAD-FASL-GROUP #S(SB-FASL::FASL-INPUT :STREAM #<SB-SYS:FD-STREAM for "file <homedir>/.cache/common-lisp/sbcl-1.3.1.243-55a6786-macosx-x64/<homedir>/quicklisp/dists/quicklisp/software/closure-common-20101107-git/syntax.fasl" {1006B0F693}> :TABLE #(282 SET *PACKAGE* "RUNES" #<PACKAGE "SB-IMPL"> SB-IMPL::%DEFUN #<PACKAGE "RUNES"> RUNES::RT-WHITE-SPACE-P STRING MAKE-STRING-INPUT-STREAM :EOF PEEK-CHAR ...) :STACK #(0 SET-DISPATCH-MACRO-CHARACTER #\# #\/ RUNES::RUNE-READER 0 50 "<homedir>/quicklisp/dists/quicklisp/software/closure-common-20101107-git/syntax.lisp" #<SB-KERNEL:LAYOUT for SB-C:DEFINITION-SOURCE-LOCATION {10000415B3}> NIL NIL NIL ...) :DEPRECATED-STUFF NIL :SKIP-UNTIL NIL) NIL)
<...truncated... error occurs in syntax.lisp>

1 个答案:

答案 0 :(得分:1)

诊断问题:在加载closure-common的代码流中的某个地方,似乎有类似的调用:

(with-standard-io-syntax
  (load "closure-common"))

这是我发现标准*readtable*修改的唯一途径。在所有其他情况下,例如,sbcl提示,set-dispatch-macro-character不会修改标准*readtable*。我还没有将问题追溯到ASDF,UIOP或Quicklisp本身,尽管这些也可能是候选人。

我已经咬了一下子弹,克隆了封闭式普通仓库并决定和named-readtables一起去。很可能如果我将这些更改发布到quicklisp,隐含地采取维护,那么使用#"提供的#/closure-common阅读器宏的其他相关软件包将会出现涟漪变化