I'm a Racket newbie and this is perhaps a common question, but I haven't found any answers on this.
Here's a simple function just returning a large list:
(define slow-test
(range 1 100000000))
(writeln "after")
Note that the function is not called. However, it takes a lot of time when running this program. Running it in DrRacket creates a lot of "Interactions disabled; out of memory" (and offers to increase the memory). Running the program from command line give the same behavior (but no out of memory errors) and it takes about 13s to run.
I am assuming that it has something to do with how Racket reads and compiles functions. Is there some a way of avoiding this behavior (apart from commenting the unused function definitions)?
Environment:
- Racket v8.3
- Linux Ubuntu 20.05
Best,
Hakan