Re: [racket-users] Obtaining the path of the application program?

2021-08-27 Thread Jeff Henrikson
On 8/26/21 8:14 AM, Matthew Flatt wrote: The analog to the first argument to main in C is (find-system-path 'run-file) I think that's probably what you want. Yes, this has the behavior I want.  Thank you. Procedure find-system-path seems well documented once one finds its section.  But

Re: [racket-users] Obtaining the path of the application program?

2021-08-26 Thread Ryan Culpepper
Usually, if you want to refer to data files etc relative to the current module's file, a good solution is to use `define-runtime-path`. It uses `#%variable-reference` as the basis for its implementation, but adds other features like cooperation with `raco exe` (see docs for `define-runtime-path`

Re: [racket-users] Obtaining the path of the application program?

2021-08-26 Thread Matthew Flatt
The analog to the first argument to main in C is (find-system-path 'run-file) I think that's probably what you want. Something closer to `get-current-source` but adapting to a run-time file is (variable-reference->module-source (#%variable-reference)) Here, `(#%variable-reference)` is

[racket-users] Obtaining the path of the application program?

2021-08-26 Thread Jeff Henrikson
Racket users, Many software applications use their location in the filesystem to establish filesystem relationships between their executable file, their configuration and their data.  For this purpose, C provides the first element of the string array provided to main, python provides