[plt-scheme] read, read-line

From: Eli Barzilay (eli at barzilay.org)
Date: Fri Jan 13 17:11:17 EST 2006

On Jan 13, Chongkai Zhu wrote:
> 
> ======= At 2006-01-13, 12:22:06 Eli Barzilay wrote: =======
> 
> >On Jan 13, Chongkai Zhu wrote:
> >> I have a program that occasionally needs user input. It 
> >> use (read) to get a S-exp and (read-line) to get a string.
> >> In v20x, all things work fine.
> >
> >I don't see any difference between 20x and 30x in the treatment of
> >newlines.
> 
> Just run
> 
> (read)
> (read-line)
> 
> in both v20x and v30x and you will see the difference.

That's not enough information.  This can depend on how your terminal
interacts with things, or perhaps if you run it in DrScheme or not.
To inspect a difference in behavior just for `read' and `read-line'
you should come up with an expression that shows a difference given
some fixed input (using something like open-input-string).

(I did try several combinations, including yours, and saw no
difference.  If you see a difference in DrScheme then this is
unrelated to what `read'/`read-line' do.)

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


Posted on the users mailing list.