Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7963d9c

Browse files
authored
Drop references to a "function registry" (#983)
* Drop references to a "function registry" * Linkify Function Resolution & Default Function references
1 parent a664331 commit 7963d9c

File tree

6 files changed

+35
-38
lines changed

6 files changed

+35
-38
lines changed

spec/formatting.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ At a minimum, it includes:
9797
defining variable values that are available during _variable resolution_.
9898
This is often determined by a user-provided argument of a formatting function call.
9999

100-
- The _function registry_,
101-
providing the _function handlers_ of the functions referred to by _message_ _functions_.
100+
- A mapping of string identifiers to the _function handlers_
101+
that are available during _function resolution_.
102102

103103
- Optionally, a fallback string to use for the _message_ if it is not _valid_.
104104

@@ -290,8 +290,8 @@ the following steps are taken:
290290
emit an _Unknown Function_ error
291291
and return a _fallback value_ as the _resolved value_ of the _expression_.
292292
293-
Implementations are not required to implement _namespaces_ or installable
294-
_function registries_.
293+
Implementations are not required to implement _namespaces_ or
294+
support _functions_ other than the _default functions_.
295295
296296
3. Perform _option resolution_.
297297

spec/functions/README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# MessageFormat 2.0 Default Function Registry
1+
# MessageFormat 2.0 Default Functions
22

33
## Table of Contents
44

@@ -18,8 +18,9 @@
1818

1919
## Introduction
2020

21-
This section defines the **REQUIRED** _functions_ which are REQUIRED for conformance with this specification,
22-
along with **RECOMMENDED** _functions_ that SHOULD be implemented to support
21+
This section defines the **_<dfn>default functions</dfn>_**
22+
which are REQUIRED for conformance with this specification,
23+
along with _default functions_ that SHOULD be implemented to support
2324
additional functionality.
2425

2526
To **_<dfn>accept</dfn>_** a function means that an implementation MUST NOT
@@ -34,34 +35,33 @@ Implementations MAY emit an _Unsupported Operation_ error for _options_
3435
or _option_ values that they cannot support.
3536

3637
_Functions_ can define _options_.
37-
An _option_ can be **REQUIRED** or **RECOMMENDED**.
38+
An _option_ can be REQUIRED or RECOMMENDED.
3839

39-
Implementations MUST _accept_ each **REQUIRED** _function_ and
40-
MUST _accept_ all _options_ defined as **REQUIRED** for those _functions_.
40+
Implementations MUST _accept_ each REQUIRED _default function_ and
41+
MUST _accept_ all _options_ defined as REQUIRED for those _functions_.
4142

42-
Implementations SHOULD _accept_ each **RECOMMENDED** _function_.
43+
Implementations SHOULD _accept_ each RECOMMENDED _default function_.
4344
For each such _function_, the implementation MUST accept all _options_
44-
listed as **REQUIRED** for that _function_.
45+
listed as REQUIRED for that _function_.
4546

46-
Implementations SHOULD _accept_ _options_ that are marked as **RECOMMENDED**.
47+
Implementations SHOULD _accept_ _options_ that are marked as RECOMMENDED.
4748

4849
Implementations MAY _accept_ _functions_ not defined in this specification.
4950
In addition, implementations SHOULD provide mechanisms for users to
50-
register and use user-defined _functions_ and their associated _functional handlers_.
51+
register and use user-defined _functions_ and their associated _function handlers_.
5152
Functions not defined by any version of this specification SHOULD use
5253
an implementation-defined or user-defined _namespace_.
5354

5455
Implementations MAY implement additional _options_ not defined
55-
by any version of this specification
56-
for **REQUIRED** and **RECOMMENDED** functions.
56+
by any version of this specification for _default functions_.
5757
Such _options_ MUST use an implementation-specific _namespace_.
5858

5959
Implementations MAY _accept_, for _options_ defined in this specification,
6060
_option_ values which are not defined in this specification.
6161
However, such values might become defined with a different meaning in the future,
6262
including with a different, incompatible name
6363
or using an incompatible value space.
64-
Supporting implementation-specific _option_ values for **REQUIRED** or **RECOMMENDED** functions is NOT RECOMMENDED.
64+
Supporting implementation-specific _option_ values for _default functions_ is NOT RECOMMENDED.
6565

6666
Implementations MAY _accept_, for _operands_ or _options_ defined in this specification,
6767
values with implementation-defined types.

spec/functions/datetime.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## Date and Time Value Formatting
22

33
This subsection describes the functions and options for date/time formatting.
4-
Selection based on date and time values is not required in this release.
4+
Selection based on date and time values is NOT REQUIRED in this release.
55

66
> [!NOTE]
77
> Selection based on date/time types is not required by MF2.

spec/functions/number.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ the value of other options, or both.
2020
> [options](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options)
2121
> in JavaScript's `Intl.NumberFormat`.
2222
23-
The following options and their values are required to be available on the function `:number`:
23+
The following options and their values are REQUIRED to be available on the function `:number`:
2424

2525
- `select`
2626
- `plural` (default; see [Default Value of `select` Option](#default-value-of-select-option) below)
@@ -126,8 +126,7 @@ the value of other options, or both.
126126
> [options](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options)
127127
> in JavaScript's `Intl.NumberFormat`.
128128
129-
The following options and their values are required in the default registry to be available on the
130-
function `:integer`:
129+
The following options and their values are REQUIRED to be available on the function `:integer`:
131130
132131
- `select`
133132
- `plural` (default; see [Default Value of `select` Option](#default-value-of-select-option) below)
@@ -205,8 +204,7 @@ The options on `:math` are exclusive with each other,
205204
and exactly one option is always required.
206205
The options do not have default values.
207206
208-
The following options and their values are
209-
required in the default registry to be available on the function `:math`:
207+
The following options and their values are REQUIRED to be available on the function `:math`:
210208
211209
- `add`
212210
- ([digit size option](#digit-size-options))
@@ -352,7 +350,7 @@ Some implementations might not be able to produce all of these formats for every
352350
> [options](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options)
353351
> in JavaScript's `Intl.NumberFormat`.
354352
355-
The following options and their values are required to be available on the function `:currency`:
353+
The following options and their values are REQUIRED to be available on the function `:currency`:
356354
357355
- `currency`
358356
- well-formed [Unicode Currency Identifier](https://unicode.org/reports/tr35/tr35.html#UnicodeCurrencyIdentifier)
@@ -435,7 +433,7 @@ together with the resolved options' values.
435433
### The `:unit` function
436434
437435
The _function_ `:unit` is **Proposed** for inclusion in the next release of this specification but has not yet been finalized.
438-
The _function_ `:unit` is proposed to be a **RECOMMENDED** formatter for unitized values,
436+
The _function_ `:unit` is proposed to be a RECOMMENDED formatter for unitized values,
439437
that is, for numeric values associated with a unit of measurement.
440438
This is a specialized form of numeric formatting.
441439
@@ -481,7 +479,8 @@ In general, the default values for such _options_ depend on the locale,
481479
the unit,
482480
the value of other _options_, or all of these.
483481
484-
The following options and their values are required to be available on the function `:unit`:
482+
The following options and their values are REQUIRED to be available on the function `:unit`,
483+
unless otherwise indicated:
485484
486485
- `unit`
487486
- valid [Unit Identifier](https://www.unicode.org/reports/tr35/tr35-general.html#unit-identifiers)

spec/intro.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
1. [`message.abnf`](message.abnf)
1111
1. [Formatting](formatting.md)
1212
1. [Errors](errors.md)
13-
1. [Default Function Registry](functions/README.md)
13+
1. [Default Functions](functions/README.md)
1414
1. [`u:` Namespace](u-namespace.md)
1515
1. [Interchange data model](data-model/README.md)
1616
1. [Appendices](appendices.md)
@@ -95,10 +95,10 @@ that previously did not specify a _fallback value_.
9595
Updates to this specification will not change the syntactical meaning
9696
of any syntax defined in this specification.
9797

98-
Updates to this specification will not remove any _functions_ defined in the default function registry.
98+
Updates to this specification will not remove any _default functions_.
9999

100100
Updates to this specification will not remove any _options_ or _option_ values
101-
defined in the default function registry.
101+
defined for _default functions_.
102102

103103
> [!NOTE]
104104
> The foregoing policies are _not_ a guarantee that the results of formatting will never change.
@@ -137,7 +137,7 @@ based on this version being invalid.
137137
> - Future versions may add additional structure or meaning to existing syntax.
138138
> - Future versions may define new _keywords_.
139139
> - Future versions may make previously invalid _messages_ valid.
140-
> - Future versions may define additional _functions_ in the default registry
140+
> - Future versions may define additional _default functions_.
141141
> or may reserve the names of _functions_ for the purposes of interoperability.
142142
> - Future versions may define additional _options_ to existing functions.
143143
> - Future versions may define additional _option_ values for existing _options_.

spec/syntax.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -545,14 +545,12 @@ values during formatting.
545545
A _function_ can appear in an _expression_ by itself or following a single _operand_.
546546
When following an _operand_, the _operand_ serves as input to the _function_.
547547
548-
Each _function_ is defined by the runtime's _function registry_.
549-
A _function_'s entry in the _function registry_ will define
550-
whether the _function_ is a _selector_ or formatter (or both),
551-
whether an _operand_ is required,
552-
what form the values of an _operand_ can take,
553-
what _options_ and _option_ values are acceptable,
554-
and what outputs might result.
555-
See [function registry](./functions/README.md) for more information.
548+
The resolution of a _function_ relies on an implementation-defined _function handler_.
549+
Some _functions_ can be used both as a _selector_ as well as in a _placeholder_;
550+
others are only valid in one of these positions.
551+
_Functions_ also differ in their requirements on the _operand_ and _options_ that they accept.
552+
See [Function Resolution](./spec/formatting.md#function-resolution)
553+
and [Default Functions](./spec/functions/README.md) for more information.
556554
557555
A _function_ starts with a prefix sigil `:` followed by an _identifier_.
558556
The _identifier_ MAY be followed by one or more _options_.

0 commit comments

Comments
 (0)