[racket] phases

From: Danny Yoo (dyoo at hashcollision.org)
Date: Tue Jan 29 14:48:48 EST 2013

> ;; Access a file "data.txt" at run-time that is originally
> ;; located in the same directory as the module source file:
> (define-runtime-path sofa.dll
>   (format "sofa-~a-~a.dll" sofa-version arch))

By the way, you can probably use (system-type 'so-suffix)) to
determine the correct extension for the dynamic library, rather than
hardcode it.

    http://docs.racket-lang.org/reference/runtime.html#(def._((quote._~23~25kernel)._system-type))




> Also, since I am at it: putting the dll in the same directory as the
> interface module or the executable is a satisfactory solution for my needs.
> But if I want to distribute this package to others, what should I use as
> argument to the ffi-lib function, to make everyone happy?


If you're going to distribute other files alongside, you'll probably
want to use a define-runtime-path so that the library lookup won't
break even when the current-directory is somewhere else.

    http://docs.racket-lang.org/reference/Filesystem.html#(form._((lib._racket/runtime-path..rkt)._define-runtime-path))

Posted on the users mailing list.