我在试着解决SICP的4.48段节选。我试图让加载机制运行,即加载CH4-mcval.scm(期望所有定义都可用),但我似乎没有正确的语法。
我试过了
#lang planet neil/sicp和#lang sicp,尝试了(load "ch4-mceval.scm")和(#%require "ch4-mceval.scm"),都没有成功。
我有一个简单的解决方案,我基本上把这两个文件合并成一个,但我发现这真的很难看。
任何帮助都将不胜感激。
启动ch4-ambeval.rkt,尝试加载CH4-mcval.rkt
#lang planet neil/sicp ; added 07 MAR 2022
;;;;AMB EVALUATOR FROM SECTION 4.3 OF
;;;; STRUCTURE AND INTERPRETATION OF COMPUTER PROGRAMS
;;;;Matches code in ch4.scm.
;;;; To run the sample programs and exercises, code below also includes
;;;; -- enlarged primitive-procedures list
;;;; -- support for Let (as noted in footnote 56, p.428)
;;;;This file can be loaded into Scheme as a whole.
;;;;**NOTE**This file loads the metacircular evaluator of
;;;; sections 4.1.1-4.1.4, since it uses the expression representation,
;;;; environment representation, etc.
;;;; You may need to change the (load ...) expression to work in your
;;;; version of Scheme.
;;;;**WARNING: Don't load mceval twice (or you'll lose the primitives
;;;; interface, due to renamings of apply).
;;;;Then you can initialize and start the evaluator by evaluating
;;;; the two lines at the end of the file ch4-mceval.scm
;;;; (setting up the global environment and starting the driver loop).
;;;;In the driver loop, do
;(define (require p)
; (if (not p) (amb)))
;;**implementation-dependent loading of evaluator file
;;Note: It is loaded first so that the section 4.2 definition
;; of eval overrides the definition from 4.1.1
(load "ch4-mceval.scm")发布于 2022-03-09 12:29:20
https://stackoverflow.com/questions/71393274
复制相似问题