define-runtime-path and pollen aren't cooperating properly
Closedopened 4 years ago by rfindler · 11 comments
Reference in New Issue
There is no content yet.
Delete Branch '%!s(<nil>)'
Deleting a branch is permanent. It CANNOT be undone. Continue?
prints the path
..../pollen/private/xinstead of the path to where the file is saved.
The problem seems to be that
syntax-source-module, which is not pointing at the original source file. Do you know how to adjust this value? For instance, one can adjust the result of
syntax/locdoesn’t seem to affect
@AlexKnauth asked the same question on
racket-users, though it went unanswered.
The confusing part is probably that
syntax-source-moduleis based on scopes (or "lexical context" in the docs), not source location... because it seemed like that might be a good idea back when
So, the answer to @AlexKnauth's question is
and I'll post that to the list.
Thanks, though that helps me see that my issue involves one more degree of complexity. My macro receives a list of syntax objects at the top level of a module and I don’t know which (if any) are
define-runtime-path. Of course,
define-runtime-pathcan only be at the top level of a module, so I suppose I could riffle through the list and apply this fix. That seems hacky — are there other forms like
define-runtime-paththat also need to be adjusted? — though if it’s necessary, I won’t worry about it.
Does your module-begin macro change the "lexical context" to be from some file in the
pollen/private/directory instead of the file they came from?
(replace-context #'here #'EXPRS)
Yeah, I was futzing with that line and I still couldn’t make it work. But in the words of @mflatt, “It's probably just a matter of trying harder.”
Is there a reason the
EXPRSare changed to the context of
here, instead of certain other statements/bindings changed from
That was a fun one to watch