1
;creating traffic signal image 
(require 2htdp/image)

(define (bulb c)
  (circle 10 "solid" c))

(above (bulb "red")
       (bulb "yellow")
       (bulb "green"))

显示的错误是:。Module Language: there can only be one expression in the definitions window in: (define (bulb c) (circle 10 "solid" c))

禁用交互。///我无法找出错误

4

1 回答 1

1

DrRacket 无法识别代码中使用的语言。您需要手动选择一种语言。看起来您正在学习 HtDP 教科书的第一章,所以我建议您选择初级学生语言。你可以这样做:

  • #lang htdp/bsl在文件开头添加
  • 使用 DrRacket 窗口底部的选择器:

DrRacket 语言选择器

于 2017-07-23T17:23:35.463 回答