首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >让SICP在球拍上运行: excercise 4.48,无法让load()工作

让SICP在球拍上运行: excercise 4.48,无法让load()工作
EN

Stack Overflow用户
提问于 2022-03-08 10:15:30
回答 1查看 101关注 0票数 0

我在试着解决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

代码语言:javascript
复制
#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")
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-03-09 12:29:20

我试过mceval.scm in DrRacket,load似乎没什么问题。

我没有planet neil/sicp,因为球拍(>8.0)已经有一个内置的sicp语言。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71393274

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档