加载库时方案顶层环境错误

时间:2018-06-24 12:46:51

标签: scheme mit-scheme

我正在尝试使用以下方式为<{3}}库加载 mit-scheme

(load "loader.scm")

但我仍然收到以下错误:

~/hlsim/STABLE/SRC-SNAPSHOT $ mit-scheme
MIT/GNU Scheme running under GNU/Linux
Type `^C' (control-C) followed by `H' to obtain information about interrupts.

Copyright (C) 2011 Massachusetts Institute of Technology
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

Image saved on Sunday February 7, 2016 at 10:35:34 AM
  Release 9.1.1 || Microcode 15.3 || Runtime 15.7 || SF 4.41 || LIAR/x86-64 4.118 || Edwin 3.116
;Loading "/home/cristi/.scheme.init"... done

1 ]=> (load "loader.scm")

;Loading "loader.scm"...
;  Loading "sim.scm"...
;This form allowed only at top level: (the-environment)
;To continue, call RESTART with an option number:
; (RESTART 1) => Return to read-eval-print level 1.

2 error> 

错误似乎是由 sim.scm 文件中的以下行引起的:

(environment (let () (the-environment)) read-only true)

如何解决此错误?我应该尝试定义顶级环境吗?如果是,那么如何将其链接到上面的代码行?

我尝试注释此行,但这给了我另一个错误:

1 ]=> (load "loader.scm")

;Loading "loader.scm"...
;  Loading "sim.scm"...
;The procedure #[compiled-closure 13 ("record" #x3d) #x96a #x14eef2a #x168bca0] has been called with 5 arguments; it requires between 8 and 9 arguments.
;To continue, call RESTART with an option number:
; (RESTART 1) => Return to read-eval-print level 1.

2 error> 

0 个答案:

没有答案