如何解决错误eval:2:0:提供:不在模块级别

时间:2018-10-25 20:59:12

标签: jupyter-notebook racket

(provide my-class-getter my-class-setter)

eval:2:0: provide: not at module level
  in: (provide my-class-getter my-class-setter)
  location...:
   eval:2:0
  context...:
   raise-syntax-error
   apply-transformer-in-context
   apply-transformer52
   dispatch-transformer41
   expand-capturing-lifts
   loop
   /Applications/Racket v7.0/share/pkgs/sandbox-lib/racket/sandbox.rkt:493:0: call-with-custodian-shutdown
   /Applications/Racket v7.0/collects/racket/private/more-scheme.rkt:148:2: call-with-break-parameterization
   .../more-scheme.rkt:261:28
   /Applications/Racket v7.0/share/pkgs/sandbox-lib/racket/sandbox.rkt:861:5: loop

我刚刚在jupyter笔记本中设置了iracket。似乎它不支持provide

如何解决此错误?

1 个答案:

答案 0 :(得分:1)

IRacket笔记本的单元格就像REPL上的单独交互。因此,您不能使用provide表单,该表单只能在模块的顶层使用。