[racket] define-runtime-path-list and find-files

From: Sam Tobin-Hochstadt (samth at ccs.neu.edu)
Date: Mon Jul 5 14:21:34 EDT 2010

2010/7/5 Laurent <laurent.orseau at gmail.com>:

> Now another question:
> I'm in fact using `find-files' inside a function, say `find-files-ex', that
> is declared in the same file and used in the `define-runtime-path-list'
> call.
> The problem is that this function must be available both at compile time and
> at runtime because of `define-runtime-path-list'.
> I did not find anything that could do that as is, so I made this macro:
> (define-syntax-rule (define-also-for-syntax head body ...)
>   (begin
>     (define-for-syntax head body ...)
>     (define head body ...)
>     ))
> to avoid duplication of the function code.
> But I feel like it may not be the right thing to do. Am I missing something?

The right way to do this is to create a separate module, and then
`require' it both `for-syntax' and normally.

sam th
samth at ccs.neu.edu

Posted on the users mailing list.