I’m creating a serializable-struct
inside a lambda (used to configure the struct at runtime). This fails with module+: allowed only in a module body in: (module+ deserialize-info...
. Looking at the macro stepper, there is indeed a module+
form that gets expanded in the body of the lambda. Is there a way around to configure a serializable-struct at runtime?
I’m only guessing here, but this sounds like the definition of the struct needs to be lifted to the module level. This may require creating the struct inside a macro that uses https://docs.racket-lang.org/reference/stxtrans.html?q=lift%20expression#%28def._%28%28quote._~23~25kernel%29._syntax-local-lift-expression%29%29\|syntax-local-lift-expression
Of course if you need to create multiple structs with the same names that will probably be a problem
I’ll report back if I get stuck. But I think it should work. Thank you! :grinning: