Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"require" not working in dr racket

Tags:

scheme

racket

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.

like image 564
Steve Quezadas Avatar asked Dec 05 '22 14:12

Steve Quezadas


2 Answers

Try this:

(#%require racket/trace)
like image 74
Steffe Avatar answered Jan 14 '23 19:01

Steffe


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.

like image 29
dyoo Avatar answered Jan 14 '23 19:01

dyoo