[racket] Finding files

From: David Vanderson (david.vanderson at gmail.com)
Date: Thu Jan 31 19:36:07 EST 2013

Very interesting - thanks for explaining!

On 01/31/2013 03:07 PM, Danny Yoo wrote:
> On Thu, Jan 31, 2013 at 3:30 PM, David Vanderson
> <david.vanderson at gmail.com> wrote:
>> (enter! "C:\\indexing\\serve.rkt")
>>
>> Does that work?  It looks like you just need to escape the backslashes -
>> they are the escape character for Racket strings.
>
> This won't work, unfortunately.  enter! takes in "module paths", and
> according to the rules, if it's a plain string, it must be a relative
> path string.  See the "rel-string" stuff in
> http://docs.racket-lang.org/reference/require.html.
>
> To make this work, John can do:
>
>      (enter! (file "C:\\indexing\\serve.rkt"))
>
> in which case since we're telling Racket it's ok to use a
> platform-dependent path, Racket will acquiesce.
>
>
>
> Alternatively, he can change the current directory first:
>
>      (current-directory "C:\\indexing")
>
> after which:
>
>      (enter! "serve.rkt")
>
> should be fine, because "serve.rkt" is relative to the current directory.
>
>
>
> But if we're already in DrRacket, why use the enter! stuff to begin
> with, when we've got the Run button?
>


Posted on the users mailing list.