
Any way to get the current-directory of a module? Invoking current-directory
only appears to return the working directory of the program.

Found syntax-source-module
which appears to work! :smile:

I’m building a macro to require files recursively from child directories, but it doesn’t appear to actually require things.


Nvm got it to work, was in the wrong transformer environment >.<

So is there any easy way for all racket files in a certain subdir to automatically require one other file without making your own #lang?

@macocio you probably want (define-runtime-path something ".")

also, you can write a macro (do-the-thing)
that requires the other file if it’s used in a particular directory

and as you note you could make a custom language that inserts a call to (do-the-thing)
.

@samth it could be interesting to let the top-level requirer add requires to modules which it itself requires…

I currently use a macro to require subdirectories for a utils
library, where I just wanna chuck code into a nice hierarchy but include everything when I use the utils
library (because require
boilerplate bores me)

Why not just make a utils.rkt
module that requires and reprovides everything in the utils/
subdirectory?

@lexi.lambda that’s what it does, but it recurses all the way down the dir hierarchy rn.

I’d just like my code that uses utils.rkt
in - say - actual-program/
to automatically require "utils.rkt"
, that’d be cool