icu icon indicating copy to clipboard operation
icu copied to clipboard

ICU-22939 Function composition and default bidi strategy

Open catamorphism opened this issue 5 months ago • 5 comments

This PR does several things:

  1. Implements the changes to resolved values necessary to implement function composition, as described in an approved design doc.
  2. Implements lazy/call-by-need evaluation. The previous implementation used lazy/call-by-name evaluation. Call-by-need is necessary because custom functions can potentially depend on external state and thus may return different values on different calls (for example, a function that returns the system time).
  3. Implements the default bidi strategy as described in another approved design doc. The changes are related to the changes to resolved values, which is why these changes appear in a single PR.
  4. Updates spec tests to the current version of the message-format-wg repo, with the exception of currency and math tests (these functions are not yet implemented).

Note 1: There are a few differences between the code and two design docs, which I detailed in an email to the icu-design list. ~~This PR is contingent on those changes being approved, but since there's a lot here to review, I wanted to go ahead and make the PR available for review.~~ As there have been no objections to the email, I'm considering the additional changes approved.

~~Note 2: I will be on leave from July 2-July 14 and won't see review comments during that time. I'll reply to comments when I return.~~

Checklist

  • [x] Required: Issue filed: ICU-22939
  • [x] Required: The PR title must be prefixed with a JIRA Issue number. Example: "ICU-1234 Fix xyz"
  • [x] Required: Each commit message must be prefixed with a JIRA Issue number. Example: "ICU-1234 Fix xyz"
  • [x] Issue accepted (done by Technical Committee after discussion)
  • [x] Tests included, if applicable
  • [x] API docs and/or User Guide docs changed or added, if applicable

catamorphism avatar Jun 28 '25 04:06 catamorphism

Hooray! The files in the branch are the same across the force-push. 😃

~ Your Friendly Jira-GitHub PR Checker Bot

Notice: the branch changed across the force-push!

  • icu4c/source/i18n/messageformat2_function_registry.cpp is different

View Diff Across Force-Push

~ Your Friendly Jira-GitHub PR Checker Bot

I'm guessing the Windows compilation errors might have something to do with the changes in #3521. I'll look into it.

catamorphism avatar Jul 23 '25 20:07 catamorphism

Notice: the branch changed across the force-push!

  • icu4c/source/i18n/unicode/messageformat2_function_registry.h is different
  • icu4c/source/i18n/unicode/messageformat2.h is different

View Diff Across Force-Push

~ Your Friendly Jira-GitHub PR Checker Bot

Notice: the branch changed across the force-push!

  • icu4c/source/i18n/unicode/messageformat2_data_model.h is different
  • icu4c/source/i18n/unicode/messageformat2_formattable.h is different

View Diff Across Force-Push

~ Your Friendly Jira-GitHub PR Checker Bot