Skip to content

Change :math to :offset and remove draft status #1073

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

aphillips
Copy link
Member

In the 2025-05-12 teleconference, the group agreed to make the name of this function less generic. A number of alternative names were proposed in the call. The name :offset was used here, partially as a placeholder while we seek consensus.

We agreed that the new function would be limited to adjusting the value of the operand by small integer values. Digit Size Option, used here, would make that from 0 to 999. It has been proposed that this be restricted to 1 to 99.

In this pull request, note that I added the function name to subsections. The current spec doesn't link properly to subsections because all functions use the same section ID. I did not change the other functions to match, pending discussion.

In the 2025-05-12 teleconference, the group agreed to make the name of this function less generic. A number of alternative names were proposed in the call. The name `:offset` was used here, partially as a placeholder while we seek consensus.

We agreed that the new function would be limited to adjusting the value of the operand by small integer values. _Digit Size Option_, used here, would make that from `0` to `999`. It has been proposed that this be restricted to `1` to `99`.

In this pull request, note that I added the function name to subsections. The current spec doesn't link properly to subsections because all functions use the same section ID. I did not change the other functions to match, pending discussion.
##### Operands
> [!NOTE]
> The purpose of this _function_ is to supply compatibility with
> ICU's `PluralFormat` and its `offset` feature, also found in ICU MessageFormat.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
> ICU's `PluralFormat` and its `offset` feature, also found in ICU MessageFormat.
> ICU's `PluralFormat` and its `offset` feature, also found in ICU MessageFormat.
> It is needed for migration, because it is commonly used for messages
> that need to convey the first few items of a list plus the count of the remainder,
> such as in the example above.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we're inverting things a bit here. As I see it, the primary purpose of this function is the same as that of plural offset in MF1, to enable the expression of messages with plural variance that depends on an offset count. Supporting migration from MF1 arises from that; it ought not be presented as "the purpose" of the function as a whole.

Comment on lines +192 to 194
The _options_ on `:offset` are exclusive with each other,
and exactly one _option_ is always required.
The _options_ do not have default values.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The _options_ on `:offset` are exclusive with each other,
and exactly one _option_ is always required.
The _options_ do not have default values.

Delete, there is only one, and it is required below.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But this PR is not changing the inclusion of both add and subtract options?

and exactly one _option_ is always required.
The _options_ do not have default values.

The following _options_ are REQUIRED to be available on the function `:math`:
The following _options_ are REQUIRED to be available on the function `:offset`:

- `add`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's actually a subtract, since it is the remaining count.

@@ -222,18 +223,18 @@ If the _operand_ of the _expression_ is an implementation-defined numeric type,
such as the _resolved value_ of an _expression_ with a `:number` or `:integer` _annotation_,
it can include option values.
These are included in the resolved option values of the _expression_.
The `:math` _options_ are not included in the resolved option values.
The `:offset` _options_ are not included in the resolved option values.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At least two reasons:

  1. Clarity; the function processes and "consumes" the option, as its resolved value includes the offset. This also allows for an implementation to present the resolved value of an :offset and a :number using the same representation.
  2. We've not identified any use cases that would benefit from a consumer of an :offset value to know that an offset was applied to the value, or what that offset was.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants