-
Notifications
You must be signed in to change notification settings - Fork 6
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
mergeQualifiers should be parameterized by a corresponding inherited attribute #106
Comments
I wouldn't put too much weight on this one. We haven't really explored doing things this way much yet, imo. We didn't have lambdas and rich enough function types before, and nowadays we do. Function attributes could turn out to be a great tool. Also, it's not only style, there is one big semantic difference: With a
But of course if there's actually a good reason, go for it. Mind showing me a tiny example of what this weirdness looks like? It'd be interesting to accumulate some more experience about when a function attribute might be a bad idea... |
I ran into this for the closure extension, wanting to override the
which I guess isn't as bad as I thought.
Yeah, good point. But this is a |
I started working on this by splitting the attribute into synthesized
I didn't like the style of duplicating these case expressions, so my first thought was to create a function
But then I realized that this isn't much different than the original solution and probably doesn't address your issue. What would your ideal |
That is pretty much exactly the refactor I was proposing. If we do this refactoring, we should for sure have a seperate
But after thinking about Ted's comments, I could also be convinced that leaving it the way it is is just fine. However either way I think we for sure should still add a seperate |
Currently
mergeQualifiers<a>
has type(a ::= a)
. Instead should have typea
, and there should be a corresponding inherited attributemergeQualifiersWith<a>::a
(or whatever you want to call it) that is used as the 'parameter' to this analysis instead. This is mainly a stylistic thing for consistency, since right now it doesn't really jive with how we do this sort of transformation in attribute grammars, but also in order to make things considerably less weird for extensions, if they want to override this equation on a forwardingType
(in a non-interfering way, of course - one may simply want to 'do the best job possible' in preserving their custom type, in order to maintainpp
, etc.)The text was updated successfully, but these errors were encountered: