[racket] Problem with Racket REPL and pasting

From: Timothy Nelson (tn at cs.wpi.edu)
Date: Thu Sep 16 22:46:52 EDT 2010


I am running Racket 5.0.1 in Windows.
Specifically, I'm using racket.exe from the Windows cmd prompt.

If I enter a multi-line expression manually, it works fine:
> (+ 1 2

But if I copy and paste in the same expression, I get an error:
> (+ 1 2
reference to undefined identifier: R

If I define R before pasting:
> (define R 'foo)
> (+ 1 2
+: expects type <number> as 3rd argument, given: 'foo; other arguments
were: 1 2 3

If I break the expression after the 1, the error is at the 2nd
argument, so the location is tied to the newline.

The identifier seems to always be the first letter of the module name.
I discovered this by using raco exe and the read-eval-print-loop
function to create racket.exe doppelgangers: In my test.rkt module,
the identifier is 't. In a-test.rkt, it is 'a.

I've reproduced the problem on 3 separate Windows machines. The
problem does NOT occur in DrRacket or the GRacket REPL, just Racket.
Am I missing something silly?

Thanks for your time,
- Tim

Posted on the users mailing list.