Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit Declarations Syntax #4

Open
iamcarbon opened this issue Jan 25, 2017 · 1 comment
Open

Unit Declarations Syntax #4

iamcarbon opened this issue Jan 25, 2017 · 1 comment
Labels

Comments

@iamcarbon
Copy link
Member

iamcarbon commented Jan 25, 2017

Finalize unit declaration syntax.

Goals

  • Built-in support for SI units
  • Ability to define postfix symbol apart of declaration
  • Ability to define a relationships between units of the same type & infer conversions between all variations

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
Copy link
Member Author

iamcarbon commented Jan 26, 2017

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 

@iamcarbon iamcarbon changed the title Create UnitDeclaration Finalize Units Jan 26, 2017
@iamcarbon iamcarbon changed the title Finalize Units Unit Declarations Syntax Jan 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant