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

Skip to content

Commit 1c0bf19

Browse files
authored
Fix the operands section
- Make the format and notes match date/time - Make clear that passed literals that match `numeric-literal` work - Remove the excess normative statement about non-numerics
1 parent 47957d2 commit 1c0bf19

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

exploration/number-selection.md

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -127,22 +127,29 @@ The function `:integer` operates identically to `:number`, except:
127127
128128
### Operands
129129
130-
The operand of a number function is either a literal that matches the `number-literal`
131-
production in the [ABNF](/main/spec/message.abnf) and which is parsed by the
132-
implementation into a number; or an implementation-defined numeric type.
130+
The _operand_ of a number function is either an implementation-defined numeric type or
131+
a literal that matches the `number-literal` production in the [ABNF](/main/spec/message.abnf).
132+
All other values produce a _Selection Error_ when evaluated for selection
133+
or a _Formatting Error_ when attempting to format the value.
133134
134135
> For example, in Java, any subclass of `java.lang.Number` plus the primitive
135136
> types (`byte`, `short`, `int`, `long`, `float`, `double`, etc.)
136137
> might be considered as the "implementation-defined numeric types".
137138
> Implementations in other programming languages would define different types
138139
> or classes according to their local needs.
139140
140-
Implementations MUST treat literals that do not match `number-literal` as
141-
non-numeric string literals.
142-
Non-numeric values, including non-numeric string literals, result in
143-
a _Selection Error_.
144-
145-
> _Ed note:_ Alternatively we can require that non-numeric values result in `*`
141+
> [!NOTE]
142+
> String values passed as variables in the _formatting context_'s
143+
> _input mapping_ can be formatted as numeric values as long as their
144+
> contents match the `number-literal` production in the [ABNF](/main/spec/message.abnf).
145+
>
146+
> For example, if the value of the variable `num` were the string
147+
> `-1234.567`, it would behave identically to the local
148+
> variable in this example:
149+
> ```
150+
> .local $example = {|-1234.567| :number}
151+
> {{{$num :number} == {$example}}}
152+
> ```
146153
147154
### Options
148155

0 commit comments

Comments
 (0)