How can I fix the error eval:2:0: provide: not at module level

Viewed 84
(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

I just set up iracket in jupyter notebook. Seems it doesn't support provide.

How can I fix this error?

1 Answers

The cells of an IRacket notebook are like individual interactions at the REPL. So you cannot use the provide form, which is only allowed at the top level of a module.

Related