[racket] Newbie question - Drscheme hangs on directory-exists?

From: John Sampson (jrs.idx at ntlworld.com)
Date: Thu Jul 22 04:27:12 EDT 2010


Many thanks.

Perhaps where "directory-exists?" is explained in the documentation, 
there should also be a pointer
to an explanation what to substitute for the place-holder "path" (in 
italic). This would mention the need
to escape the backslash, which to a newbie like myself is not obvious. 
Or an example could be given,
which would show the escaping backslash.

I haven't really found my way round the documentation yet. I find that 
if I want to look up "directory-exists?"
using Google in Mozilla Firefox is the best way.


_John Sampson_

On 21/07/2010 23:08, Eli Barzilay wrote:
> On Jul 21, Ryan Culpepper wrote:
>> You need to escape the backslash in your string:
>>     (directory-exists? "C:\\iconsource")
>> DrRacket colors the bad string red to indicate that there's a
>> problem with it. If you insert the extra backslash, it turns green.
>> Wouldn't it be nice for DrRacket to signal an error when you hit
>> enter instead? Yes, but it strikes me as a subtle problem. (We do,
>> after all, want to permit multi-line repl entries.) I'll let someone
>> who's thought about it more address that part.
> (Funny coincidence: it's been doing what it does now for a while, and
> recently I suggested changing things so the read error will be
> reported instead of waiting for you to fix it.)

Posted on the users mailing list.