我试着从Which lang packet is proper for SICP in Dr.Racket?学习如何做scheme和sicp
但是当我在被接受的答案中运行代码时
#lang sicp
(paint-highres (below (beside diagonal-shading
(rotate90 diagonal-shading))
(beside (rotate270 diagonal-shading)
(rotate180 diagonal-shading))))我得到了错误
paint-hires: unbound identifier in: paint-hires

我已经安装了sicp包。有人知道问题出在哪里吗?
发布于 2019-01-16 03:11:45
@sorawee-porncharoenwase感谢您的文档链接。@soegaard感谢您为DrRacket最近的更改提供的上下文。
最终对我起作用的是这个
#lang sicp
(#%require sicp-pict)
(paint (below (beside diagonal-shading
(rotate90 diagonal-shading))
(beside (rotate270 diagonal-shading)
(rotate180 diagonal-shading))))我认为文档中错误地说要使用paint-hires。
发布于 2019-01-15 06:33:50
paint-hires函数是原始MIT Scheme实现的遗留函数。当时它的“高分辨率”在实验时使用起来太慢了,所以paint-hires被用来获得“最终”图像。
当最初的麻省理工学院方案实现的SICP图片语言被移植到PLT方案时,paint-hires被保留下来。
最近(在一两年内),SICP图片语言在现代球拍上重新实现。这使您能够使用具有您选择的分辨率的图片语言,颜色!(最初的MIT方案用于单色显示器)等等。
复制:"main.rkt“和einstein2.jpg”,并将它们保存在同一个文件夹中。
在DrRacket中打开"main.rkt“并运行它。
请看底部的示例。
在"main.rkt“的底部添加你自己的程序。
浏览这些文件,了解如何使用颜色等。
两个文件都在这里:https://github.com/sicp-lang/sicp/tree/master/sicp-pict
https://stackoverflow.com/questions/54175013
复制相似问题