
@leif It seems like you either need to refer to something in the current module (in which case you can just give the module’s context to the identifier) or from a module that the current one can and should import via syntax-local-lift-require
to make the identifier available. Maybe it all goes back to the problem of identifying the current module somehow at compile time; or maybe the problem is that you need to replicate the same strategy that the macro system implements with MPIs, where everything is relative to a “self” MPI (so the “self” case can be detected). It’s possible to synthesize any kind of binding that you want by working in a different namespace: adjust the module name resolver while evaluating a “dummy” module, require
the module into an otherwise empty namespace to set up a binding, then add that namespace’s scope to an identifier with namespace-syntax-introduce
. That’s an extreme solution, though.

I mean, just checking for self (even if I could) is not quite enough, because the pseudo-identifier could also (in principle) could point to a module that requires ‘self’. I think you’re right that replicating the MPI system is probably the way to go here. Although I certainly agree that that is a bit of an extreme solution. :slightly_smiling_face:

@mflatt ^

@kevinforrestconnors has joined the channel

@landeste has joined the channel

@mflatt That ‘seems’ to work: https://gist.github.com/LeifAndersen/d35d386ddb1a1b25d7b22d97ab6287e8

Thanks.

@mike.hoarn has joined the channel