Re: [racket-users] Path to file in dynamic-place

2018-01-23 Thread Philip McGrath
When the thing you want to refer to at runtime is specifically a module, using define-runtime-module-path-index or define-runtime-module-path (also from racket/runtime-path) may be even better choice than define-runtime-path. -Philip On Tue, Jan 23, 2018 at 10:03 PM, Jack Firth

Re: [racket-users] Path to file in dynamic-place

2018-01-23 Thread Jack Firth
A rule of thumb you can follow to avoid tricky bugs like this: *never use string literals as dynamic module names.* Anywhere you see a dynamic / reflective function on modules called with a literal string, a contradiction exists between the programmer and the dynamic function: 1. The

Re: [racket-users] Path to file in dynamic-place

2018-01-22 Thread 'Royall Spence' via Racket Users
Bah, I spoke too soon. Setting the current-load-relative-directory has no effect on the file loading behavior of dynamic-place. On Mon, Jan 22, 2018, at 12:02 PM, 'Royall Spence' via Racket Users wrote: > Thanks, this makes more sense now. I'll just slap this at the type of my > place-creating

Re: [racket-users] Path to file in dynamic-place

2018-01-22 Thread 'Royall Spence' via Racket Users
Thanks, this makes more sense now. I'll just slap this at the type of my place-creating modules for my own sanity: (current-load-relative-directory (current-directory)) On Mon, Jan 22, 2018, at 11:52 AM, Sam Tobin-Hochstadt wrote: > `dynamic-place` works like (I believe) `dynamic-require`, which

Re: [racket-users] Path to file in dynamic-place

2018-01-22 Thread Sam Tobin-Hochstadt
`dynamic-place` works like (I believe) `dynamic-require`, which starts in `(current-load-relative-directory)`. If you want to use it in a file and get consistent file-relative behavior, I suggest using `define-runtime-path` or `quote-module-path`. Sam On Mon, Jan 22, 2018 at 11:48 AM, 'Royall

[racket-users] Path to file in dynamic-place

2018-01-22 Thread 'Royall Spence' via Racket Users
In the docs for places (https://docs.racket-lang.org/reference/places.html), the example shows creating a place like so: (dynamic-place "place-worker.rkt" 'place-main) When I do