Emacs `racket-mode` REPL does not load recognition routines

I just installed racket-mode

in my emacs 24.3, when I run the REPL with a command racket-repl

, the REPL starts correctly, but some of the racket procedures / functions are not recognized. iee

<present> <code> (object of class%); class: undefined; ; cannot refer to an undefined identifier> (enter! "test.rkt"); enter !: undefined; ; cannot reference undefined id Code>

The current value of the variable is racket-racket-program

set to Racket.exe

. On the other hand, if I just run Racket.exe

from the Windows command prompt, it REPL

works as expected.

Any help with this is greatly appreciated.

+3


source to share


2 answers


  • When you execute racket-repl

    , the REPL first opens with an equivalent #lang racket/base

    . On the command line, you can type (require racket)

    to get a broader language including a class eg object%

    .

    ( Open a question about it here. Feel free to call there.)

  • (enter! "test.rkt")

    Try instead of typing on the command line ,run test.rkt

    .

    • In fact, the easiest way to do this is to open an Emacs buffer on test.rkt. Then you can press C-c C-kaka M-x racket-run

      .

      (Note that this leaves a point in the test.rkt buffer. If you prefer to jump to the REPL, you can instead use the M-x racket-run-and-switch-to-repl

      default bound to F5, as in DrRacket.)

TL; DR the most common usage pattern with racket-mode is:



  • Visit the .rkt file in the buffer.
  • "Start" it with C-c C-c(or F5).
  • Explore the REPL interactively however you want.
  • Go to 2.
+3


source


If your file contains #lang racket

, then the REPL chooses which language to use. If there is no such line, my guess is what is used racket/base

- and object%

not defined in racket/base

.

Try to enter this program:



#lang racket
(+ 1 2)

      

Then run the REPL and try your snippet again.

+2


source







All Articles