[plt-scheme] read, read-line

From: Chongkai Zhu (u0476504 at utah.edu)
Date: Fri Jan 13 17:40:23 EST 2006

======= At 2006-01-13, 15:11:17 Eli Barzilay wrote: =======

>> 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.)

Yes, I'm using DrScheme.

But as you suggested, I just tried what happens in MzScheme, only to
find that (read-line) always return "#\r", both in v209 and in v300.3
on my Windows. So now I'm quite confused. What should my program be if 

it will occasionally ask the user to input a S-exp
it will occasionally ask the user to input a string
it should work both under MzScheme and DrScheme

???


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

Chongkai



Posted on the users mailing list.