4
votes

I am new to scheme and I am trying to trace a function. I have to load the "trace" function. According to the racket documentation, I have to execute a:

(require racket/trace)

But the response I am getting back is

require: undefined;
cannot reference undefined identifier

I am baffled. I am using language "R5RS" if that makes a difference. can't find anything online or on stack overflow on this.

2
If you want to do most anything useful with Racket, you can't use the R5RS language. Please choose a different language, such as Racket (choose "Use the language declared in the source", then put #lang racket at the top of your file), if you can.Chris Jester-Young

2 Answers

12
votes

Try this:

(#%require racket/trace)
4
votes

Chris Jester-Young's comment is correct: don't use R5RS. In the standard R5RS language, there's no such thing as a module. Go look at http://www.schemers.org/Documents/Standards/R5RS/; not a word about a module, right?

Racket takes the standard more seriously than you'd expect: if you tell it to work in R5RS mode, it will turn off language features that the standard does not describe.

If you're using the Racket toolchain, don't use the R5RS language unless you really want to work in a restrictive language. Use standard #lang racket instead. See: http://docs.racket-lang.org/guide/intro.html which shows how to use it in that mode.