I'm working on a Racket script (on a Linux machine) that requires the math/number-theory library. My entire script at the moment is thus:
#!/usr/bin/racket
(require math/number-theory)
Yes, it's literally just requiring the library.
When I try to run it, I get an error that reads "expected a `module' declaration found: something else".
However, when I actually start up Racket in the terminal like so:
/usr/bin/racket
and enter (require math/number-theory) in the command line, it treats it like it's totally valid.
What's going on here?
Make sure the top of your racket files contains a #lang
statement as well.
In other words, you need this at the top of the file:
#!/usr/bin/racket
#lang racket
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With