Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Speculative implementation of a p:param function #838
Here's a first pass
The problem is that as a function, it can certainly get runtime values, but if the plan is to use this in the serialization options on
At best, what we mean is that if the function appears in a context that is going to be evaluated statically, then it will be. But then we can't really, usefully speak of them as runtime values. They're compile time values or something and it's just fundamentally odd to have an ordinary function to get those.
Are there any cases other than serialization parameters where we feel we need to have user-specified values available statically?
I think to call the values "runtime values" is confusing because they must be available during static analysis. Places they are needed (may be I missed one, please add):
My idea is that the function is available during static analysis. So the processor has to find a way to make this possible. To me (as you said) it makes only sense, if I can write this:
After thinking about it (and implementing it), I think we should do away with the function approach. I still believe that we could have a user set twin of p:system-property being useful during static analysis.
The main reason for abandoning the idea is, that it leads to very ugly pipelines. The function-approach with the necessary default value means that I have to write the default value over and over again - just in case there is no user set value. The option approach here was much better: Set it once with the default value - use it anywhere.
But that still does not mean I am happy with the static option/static variable approach because of all the complexities it leads to. After all I am not sure that we need static options AND static variables. Static options seems to fit all needs (and can be set from the outside). Do we really need both?
Sorry for having just questions and not offering a solution. But may be it rings a bell for somebody.