ICU-23424 mf2: API improvements for composed functions#4054
Conversation
c326839 to
49101c7
Compare
|
Hooray! The files in the branch are the same across the force-push. 😃 ~ Your Friendly Jira-GitHub PR Checker Bot |
49101c7 to
a579c8e
Compare
|
Notice: the branch changed across the force-push!
~ Your Friendly Jira-GitHub PR Checker Bot |
|
I think that in the last TC meeting the agreed direction was to allow the overriding of the custom functions AND/OR to allow the use of function contexts to override the locale based on function name. And (if my memory serves me well) Matt this was supposed to think if the function context was an acceptable solution (makes sense, since this function context idea was new it was hard to judge "on the spot"). If we are going in that direction there is no need for any custom functions or function overrides. Am I understanding this correctly? |
I sent a slack message — I'd like to understand the new function context idea in enough detail to have an API proposal. Can you help sketch it out?
No tinkering here. This PR (#4054) is so that overriding can still call the existing functions— otherwise the caller needs to reimplement all of them, from the ground up, without access to internals. This doesn't give access to internals, but allows composition, in the style of f(g(x)) or maybe f(g(x)+K) |
@mihnita i've updated my API proposal. |
a579c8e to
1a408e7
Compare
|
Notice: the branch changed across the force-push!
~ Your Friendly Jira-GitHub PR Checker Bot |
- FunctionContext.getCalledFunctionName() - FunctionContext.withLocale() - FunctionContext.getStandardFunction() Also, - internal improvements to support the above - FunctionValue.getFunctionName() now returns a FunctionName Co-authored-by: Tim Chevalier <tjc@igalia.com>
1a408e7 to
9a84b6d
Compare
|
Hooray! The files in the branch are the same across the force-push. 😃 ~ Your Friendly Jira-GitHub PR Checker Bot |
Thank you, but I am afraid I am still confused. We go ahead with API proposals that I don't think are the right way to solve the problem. If we have a way to set a locale per function, there is no need to override the function at all, and there is no need to do function composition at all. Once we get to APIs we switch to "how to expose solution X", bypassing the whole discussion on what we try to solve, what are the options, pros and cons, which option we choose, why. So I think the friction I see here (me reviewing these PRs) come from 2 causes:
I think that number 1 would benefit from a design document. I am fine to start it, list the options I'm aware or. For number 2, I agree that it would have been ideal to keep them in sync from the get go. For example the function context does not exist in the Java APIs. And C++ implementations also benefits from the fact that it is happening with the spec already finalized. Most of the Java APIs were exposed before we had a final spec. But I think that rushing in with APIs approvals from TC without 1 and 2 is not a good way to proceed. |
This does not depend on #4041 but only deals with the API improvements.
Also,
Checklist