@@ -469,7 +469,9 @@ abstract "input" and "output" types.
469469Returning to Example Y1, consider two possible models
470470of the runtime behavior of function composition.
471471
472- ** Model 1:**
472+ #### Preservation Model
473+
474+ This model preserves the options in the result of the function.
473475
4744761 . Evaluate ` $num ` to a value and pass it to the ` :number ` function,
475477 along with named options ` {"maxFrac": "2"} `
@@ -494,7 +496,10 @@ of the runtime behavior of function composition.
494496
495497then the formatted result is "0.33 0.33333".
496498
497- ** Model 2:**
499+ #### Formatted Value Model
500+
501+ This model preserves the formatted value of the function,
502+ but not the options that were passed to the function.
498503
4995041 . Evaluate ` $num ` to a value and pass it to the ` :number ` function,
500505 along with named options ` {"maxFrac": "2"} `
@@ -512,10 +517,12 @@ then the formatted result is "0.33 0.33333".
512517
513518then the formatted result is "0.33 0.33".
514519
520+ #### Comparison between models
521+
515522The difference is in step 2: whether the implementation
516523of the ` number ` function returns a value encapsulating
517- the various options that were passed in (model 1 ),
518- or only a formatted result (model 2 ).
524+ the various options that were passed in (preservation model ),
525+ or only a formatted result (formatted value model ).
519526
520527In terms of implementation, the result depends on
521528what the nature is of the value that is bound to
@@ -529,10 +536,10 @@ before a function call.
529536Still, whatever value is stored in the environment
530537must capture as much information as is needed by functions.
531538
532- In Model 2 , the value is a simple "formatted value",
539+ In the formatted value model , the value is a simple "formatted value",
533540analogously to MessageFormat 1.
534541
535- In Model 1 , it is a more structured value that captures
542+ In the preservation model , it is a more structured value that captures
536543both the "formatted value", and everything that was used to construct it,
537544as in the first model.
538545
@@ -546,7 +553,7 @@ A "resolved value"
546553is also the operand of a function.
547554
548555Another way to resolve the ambiguity between
549- Models 1 and 2 is to ask
556+ the simple and the preservation model is to ask
550557when two resolved values are the same
551558and when they are different.
552559
@@ -597,7 +604,7 @@ interchangeable in any further piece of the message
597604that follows this fragment.
598605No processing can distinguish the resolved values
599606of the two variables.
600- This corresponds to model 1 .
607+ This corresponds to the formatted value model .
601608
602609Interpretation 2: The meaning of ` $x ` is
603610a value that represents
@@ -608,7 +615,7 @@ If the resolved value of `$x`, V, is passed to another function,
608615that function can distinguish V from another value V1
609616that represents the same formatted string,
610617with different options.
611- This corresponds to model 2 .
618+ This corresponds to the preservation model .
612619
613620The choice of interpretation affects the meaning of
614621function composition,
@@ -752,14 +759,14 @@ as both are "resolved values" according to the spec.
752759But both interpretation 1 and interpretation 2 complicate that.
753760
754761Alternative 1: A function returns a "formatted value".
755- This matches model 1 , where formatted values
762+ This matches the formatted value model , where formatted values
756763are bound to names.
757764
758765Alternative 2: A function returns a composite value
759766that conceptually pairs a base value (possibly the
760767operand of the function, but possibly not; see Example B1)
761768with options.
762- This matches model 2 .
769+ This matches the preservation model .
763770If we preserve the single usage of "resolved value"
764771in the spec, this implies that the (base value, options)
765772representation applies to all resolved values,
@@ -783,8 +790,8 @@ There seem to be several areas of ambiguity:
783790
784791* Are named values essentially ` FormattedValue ` s,
785792or do they have additional structure that is used
786- internally in the formatter? (Model 1 vs. Model 2 )
787- * In Model 2 , some functions "look back" for the original value,
793+ internally in the formatter? (formatted value model vs. preservation model )
794+ * In the preservation model , some functions "look back" for the original value,
788795(like ` number ` )
789796while others return a new "source value"
790797(like ` getAge ` in Example B1).
@@ -801,12 +808,15 @@ The question is how to craft the spec in a way that is consistent with expectati
801808
802809## Requirements
803810
804- In the rest of this document, we assume some version of Model 2.
805- However, if Model 1 is more desired, the questions arise of how to
811+ In the rest of this document, we assume some version of
812+ the preservation model.
813+ However, if the formatted value model is more desired,
814+ the questions arise of how to
806815forbid compositions of functions that would do surprising things
807816under that model.
808817
809- Even under Model 2, some instances of composition won't make sense,
818+ Even under the preservation model, some instances of composition
819+ won't make sense,
810820so we need to define the error behavior when it doesn't make sense.
811821
812822This implies that we need:
0 commit comments