Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quasiquotations are inadvertently expanded #73

Closed
jgrosso opened this issue Sep 29, 2019 · 0 comments
Closed

Quasiquotations are inadvertently expanded #73

jgrosso opened this issue Sep 29, 2019 · 0 comments
Labels
bug A bona fide implementation mistake. converter Anything related to the Haskell->Axel converter.

Comments

@jgrosso
Copy link
Collaborator

jgrosso commented Sep 29, 2019

Because the parser expands quasiquotations, and we run Axel source through the parser to convert it, e.g. `(=macro ~name (~args) ~@body) is converted into (AST.SExpression (GHCPrelude.Just (, "src/Axel.axel" (SM.Position 22 55))) (concat [['=macro] [name] [(AST.SExpression (GHCPrelude.Just (, "src/Axel.axel" (SM.Position 22 69))) (concat [[args]]))] (AST.toExpressionList body)])))... which is less than ideal.

Is there a foolproof way to undo quasiquotation? Is it OK if we accidentally "unquasiquote" manually-user-generated code (in the rare case that a user's code happens to replicate the behavior of quasiquote)?
(Maybe a good heuristic is: If the metadata is Nothing or not a literal value (e.g. it references a variable or something), it's user-generated; otherwise, replace it with quasiquote? Can we safely tell the users that any custom metadata literals they provide may be changed without notice?)

We will have a flag (etc.) for the parse methods that will disable quasiquote-expansion, (maybe hygenisization,) etc.

@jgrosso jgrosso added bug A bona fide implementation mistake. converter Anything related to the Haskell->Axel converter. labels Sep 29, 2019
@jgrosso jgrosso changed the title Quotations and quasiquotations are expanded during conversion Quasiquotations are inadvertently expanded Sep 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bona fide implementation mistake. converter Anything related to the Haskell->Axel converter.
Projects
None yet
Development

No branches or pull requests

1 participant