[racket] Problem with Racket REPL and pasting

From: Eli Barzilay (eli at barzilay.org)
Date: Mon Sep 20 16:21:49 EDT 2010

On Sep 19, Danny Yoo wrote:
> 
> Quick experiment: I opened up a new Command Prompt terminal.  Ran
> mzscheme, and then wrote the following at the REPL:
> 
> > (let loop () (printf "~s\n" (read-byte)) (loop))
> 
> I pressed enter.  I saw the following:
> 
> 13
> 10
> 
> which is slightly unexpected, in the sense that I expected the
> reader to have already absorbed the carriage-return+newline
> combination, but oh well.

That's expected -- the reader finished reading the expression, and
stopped right after the last closing paren, leaving the CRLF sequence
in the input.


> Then, with my clipboard containing the content:
> [...]
> The byte stream that's observed by read-bytes is the following:
> 
> > (bytes 40 43 32 49 32 50 32 13 10 77 32 32 51 41 13 10)
> #"(+ 1 2 \r\nM  3)\r\n"
> 
> No clue why "M" is being introduced into the stream.

That's the problem.


> Note: when I'm using cygwin's bash console, I don't see the error.
> 
> I've only been able to replicate what you're seeing with the Command
> Prompt application on Windows 7.

Yeah -- it happens only inside a cmd box.

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!


Posted on the users mailing list.