X10D
X10D

Reputation: 620

How to provide full path in require in racket?

Trying to have access to functions from another file. Placed (provide (all-defined-out)) inside the other file. Now trying to actually refer to it using full path:

(require “C:\Users\functions.rkt”)

returns this error: #%require: bad require spec in: “C:Usersfunctions.rkt”

(require "C:\Users\functions.rkt")

returns this error: read-syntax: no hex digit following \U

Upvotes: 0

Views: 389

Answers (1)

Óscar López
Óscar López

Reputation: 236114

There are two syntax errors in this snippet:

(require “C:\Users\functions.rkt”)

For starters, the double quote characters are incorrect. And you must escape the backslashes, and as Ryan points using file is mandatory. Try this:

(require (file "C:\\Users\\functions.rkt"))

Upvotes: 2

Related Questions