-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add draft as regression tests #14413
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
Add draft as regression tests #14413
Conversation
Draft higher order quoted expressions.
d957ec6
to
ab81d47
Compare
// Splicing can only be done on Expr[_ <: Any]. | ||
// `apply methods on higher order expression provide a way to replace the unbound variables. | ||
|
||
// This can be used for HOAS quoted patterns to not return a lambda. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a link to https://en.wikipedia.org/wiki/Higher-order_abstract_syntax ? It helped me understand what was going on in this example :).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// This can be used for HOAS quoted patterns to not return a lambda. | ||
// The use would be the same as each higher order expression would have an apply method. | ||
// But as it would be an expression, the expression would showable. | ||
// The expression could also be directly transformed into a Term of the reflection API. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean, we could have a Term with holes? How would that work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not no holes in the sense of the Hole
AST. It would contain references to unbound variables in the current scope. We should probably also have a way to list the symbols of those variables to be able to identify them when reflecting on the AST. I still need to figure out what is the best way to encode this internally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would contain references to unbound variables in the current scope.
So what can we do with such a term? I thought translating from an Expr to a Term should always produce a valid hygiienic tree.
Draft higher order quoted expressions.