BnMcGn
BnMcGn

Reputation: 1450

Loading a module from the current directory in racket

I have a file euler.rkt in my current working directory. How do I load it as a module?

-> (require euler)
; readline-input:20:9: euler: standard-module-name-resolver: collection not
;   found: "euler" in any of: (#<path:/home/ben/.racket/5.2.1/collects>
;   #<path:/home/ben/racket/collects>) in: euler [,bt for context]
-> 

Should I add my directory to collects? If so, what is the correct way to do it?

Upvotes: 5

Views: 1548

Answers (2)

Sam Tobin-Hochstadt
Sam Tobin-Hochstadt

Reputation: 5053

In addition to just using the path, as @soegaard mentions, you can also use raco link to set up a collection for your file.

Upvotes: 3

soegaard
soegaard

Reputation: 31147

Try this:

(require "euler.rkt")

Upvotes: 7

Related Questions