Skip to content

Unit Declarations Syntax #4

@iamcarbon

Description

@iamcarbon

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions