Reduce scope of Amount by avoiding unit conversion#29
Conversation
In discussions among various TC39 delegates, it has become clear that the concept of a unit brings up a number of challenges that can be cleanly separated from the more fundamental problem of representing mathematical values together with a precision. This is an important part of the notion of measurement that is a subset of the original motivation and argument for Measure. We propose to separate these challenges from those that come from supporting measurements, such as: * the need for unit conversion, * compound units (e.g., "foot-and-inch"), * whether: some units (and which ones?) should be included (SI?) out-of-the-box, * user-customizable units, * arithmetic: involved in conversions (rationals? decimals? binary floats?), etc.
eemeli
left a comment
There was a problem hiding this comment.
Units and currencies must not be left out of Amount. Unit conversion and compound units can and should be left for later, but at least for me the primary purpose of Amount is for it to hold a numerical value together with an indicator of what it's an amount of.
It was an accident to drop them. They're supposed to be there. But we do not intend to support unit conversion, certainly, given the issues involved there.
Indeed, this was a big mistake. Can you take another look? Units are, of course, supposed to be included. |
Co-authored-by: Eemeli Aro <eemeli@gmail.com>
Co-authored-by: Eemeli Aro <eemeli@gmail.com>
Co-authored-by: Eemeli Aro <eemeli@gmail.com>
Co-authored-by: Eemeli Aro <eemeli@gmail.com>
Co-authored-by: Eemeli Aro <eemeli@gmail.com>
Co-authored-by: Eemeli Aro <eemeli@gmail.com>
Co-authored-by: Eemeli Aro <eemeli@gmail.com>
Co-authored-by: Eemeli Aro <eemeli@gmail.com>
Co-authored-by: Eemeli Aro <eemeli@gmail.com>
Co-authored-by: Eemeli Aro <eemeli@gmail.com>
Co-authored-by: Eemeli Aro <eemeli@gmail.com>
Co-authored-by: Eemeli Aro <eemeli@gmail.com>
Co-authored-by: Eemeli Aro <eemeli@gmail.com>
Co-authored-by: Eemeli Aro <eemeli@gmail.com>
Co-authored-by: Eemeli Aro <eemeli@gmail.com>
eemeli
left a comment
There was a problem hiding this comment.
One small nitpick/addition, otherwise looks good!
Co-authored-by: Eemeli Aro <eemeli@gmail.com>
In discussions among various TC39 delegates, it has become clear that the concept of a unit conversion brings up a number of challenges that can be cleanly separated from the more fundamental problem of representing a mathematical value, tagged with a unit, together with a precision. This is an important part of the notion of measurement that is a subset of the original motivation and argument for Measure. We propose to separate these challenges from those that come from supporting measurements, such as:
etc.