属性和实例 - Scheme、Racket:模块中的未绑定标识符

Attributes and Instances - Scheme, Racket: unbound identifier in module

我正在尝试为我被要求做的练习定义一种数据集。这是代码:

#lang racket
(
 (
  (pers(sol nub lluv))
  (tmp numeric)
  (hum numeric)
  (vin (yes no))
  (class (+ -))
  )

 ;Instances
(sol 30 40 no +)
(lluv 24 70 yes -)
(sol 20 80 no +)
)

问题是当我 运行 此代码时,我收到以下消息:

pers: 模块中的未绑定标识符 in: pers

我必须以不同的方式定义标识符吗?

感谢您的回答!

嗯,其实就是一个文件,不用写“#lang racket”。问题是我认为我必须 运行 它但根据练习它没关系。

下一个练习是阅读它,代码如下:

#lang racket
(define (read-file filename)
(define datafile (with-input-from-file filename read))
datafile
)

;Store file info in a variable
(define fileinfo (read-file "filewithinfo.scm"))

所以在 运行ning 之后,我可以在控制台上编写 "fileinfo" 来显示文件信息,即:

 >fileinfo

'(((pers (sol nub lluv)) (tmp numeric) (hum numeric) (vin (yes no)) (class (+ -))) (sol 30 40 no +) (lluv 24 70 yes -) (sol 20 80 no +))

更多信息:https://en.wikibooks.org/wiki/Scheme_Programming/Input_and_Output