processor / E

Core library for dscript (parser, expressions, etc)
1 stars 1 forks source link

Unit Declarations Syntax #4

Open iamcarbon opened 7 years ago

iamcarbon commented 7 years ago

Finalize unit declaration syntax.

Goals

Unit Declarations

Angle protocal : Number { }

rad  unit : Angle @name("Radian") @SI = 1;
deg  unit : Angle @name("Degree")     = (π/180) rad;
turn unit : Angle @name("Turn")       = 360 deg;               
grad unit : Angle @name("Gradian")    = (1/400) turn;
arcs unit : Angle @name("Arcsecond")  = (1/3600) deg;            
arcm unit : Angle @name("Arcminute")  = (1/60) deg;

Usage

3 rad
5 deg to rad
rotate(3 rad)
iamcarbon commented 7 years ago

Move all unit definitions & relations of core into D modules.

Finalize locations of SI Units.

Namespace              Types
Thermodynamics     Temperature
Time                          Time
Physics                      Length, Mass, Pressure