Brilliant.  Thanks, Alex.

On Fri, Sep 23, 2016 at 8:15 AM, Alex Knauth <alexan...@knauth.org> wrote:

>
> > On Sep 23, 2016, at 10:53 AM, David Storrs <david.sto...@gmail.com>
> wrote:
> >
> > Is there a Racket equivalent of Perl's __FILE__ token?
>
> Yes, it's called `quote-source-file`, in syntax/location.
> http://docs.racket-lang.org/syntax/Source_Locations.html#%
> 28form._%28%28lib._syntax%2Flocation..rkt%29._quote-source-file%29%29
>
> You can also read Greg Hendershott's blog post about writing macros like
> this:
> http://www.greghendershott.com/2014/06/-file-and-line-in-racket.html
>
> Alex Knauth
>
> > In Perl I can do this:
> >
> >
> > I'd like to be able to access files at runtime that have a path known in
> relation to the current file.  I can do this:
> >
> >     (define-runtime-path this-dir ".")
> >     (file-exists? (build-path this-dir (some-func-that-returns-a-path)))
> >
> > ...but that requires the define-runtime-path in any file I want to do
> this in.
> >
> > Is there a built-in version of     (define-runtime-path this-dir ".") ?
> >
> > Alternatively, is there a built-in version of Perl's __FILE__ token,
> which gives me the absolute path to the source file in which it is used?
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to