Units of Measure
On Oct 26, 2007, at 12:48 PM, Darryl wrote:
I think it'd be interesting and useful to have some way to have units of measure as part of the structure of a number.
See www.mozilla.org/js/language/old-es4/rationale/units.html
(and everyone, please help disambiguate by using "program units" when
talking about the other units, the kind included in ES4 as proposed:
proposals:program_units ;-).
Waldemar's write-up there in the old-es4 doc-tree references Dav
Raggett's Spide (www.mozilla.org/js/language
bibliography.html#spice), worth a read too.
It's just an idea but I think it'd be incredibly useful in the future for designing advanced web applications.
At this point, as the overview says, we are not taking new proposals
for ES4. Units are tempting to consider for a future Edition, but
IIRC Waldemar had some unsolved problems in his design. It would be
good to hear from him, if he remembers the details.
I think it'd be interesting and useful to have some way to have units of measure as part of the structure of a number. For instance
You could register a new unit of measure by relating it to other units of measure:
and then convert back and for using standard type conversion
The system would treat units like constants, in most situations, but allow them in certain contexts that variables aren't allowed (such as immediately preceeding or following a number, as above). It would also treat the variable as containing "something" thats numberlike, so they could be multiplied against one another and still retain their unit-behavior.
It's just an idea but I think it'd be incredibly useful in the future for designing advanced web applications.
o/// Be seeing you...