Name: Anonymous 2012-02-25 15:48
Are there any programming languages that let you specify dimensional units as part of the type information? It would add to the analyzability of code at compile time.
Something like this:
Something like this:
type Second;
type Minute = 60 Second;
type Hour = 60 Minute;
type Meter;
type Mile = 1609.344 Meter;
type DegreeC;
type DegreeF = DegreeC * 9/5 + 32;
float(Meter/Second) mps = (Mile/Hour)60; // converts Miles/Hour into Meters/Second
float(Meter/Second) x = (Hour)60; // type error