{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/vblang/issues/200","repository_url":"https://api.github.com/repos/dotnet/vblang","labels_url":"https://api.github.com/repos/dotnet/vblang/issues/200/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/vblang/issues/200/comments","events_url":"https://api.github.com/repos/dotnet/vblang/issues/200/events","html_url":"https://github.com/dotnet/vblang/issues/200","id":271149172,"number":200,"title":"Units Of Measure","user":{"login":"AdamSpeight2008","id":900107,"avatar_url":"https://avatars1.githubusercontent.com/u/900107?v=4","gravatar_id":"","url":"https://api.github.com/users/AdamSpeight2008","html_url":"https://github.com/AdamSpeight2008","followers_url":"https://api.github.com/users/AdamSpeight2008/followers","following_url":"https://api.github.com/users/AdamSpeight2008/following{/other_user}","gists_url":"https://api.github.com/users/AdamSpeight2008/gists{/gist_id}","starred_url":"https://api.github.com/users/AdamSpeight2008/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AdamSpeight2008/subscriptions","organizations_url":"https://api.github.com/users/AdamSpeight2008/orgs","repos_url":"https://api.github.com/users/AdamSpeight2008/repos","events_url":"https://api.github.com/users/AdamSpeight2008/events{/privacy}","received_events_url":"https://api.github.com/users/AdamSpeight2008/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-11-04T00:04:38Z","updated_at":"2017-11-04T02:36:16Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"I propose that we borrow from F# the language feature of [Units Of Measure](https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/units-of-measure).\r\n\r\n**Units Of Measure** expands on the type-safety principles, by optionally enhancing the type with a explicit kind.\r\n\r\n```vbnet\r\nImports UnitOfMeasure.SI\r\n\r\nModule Example\r\n \r\n  Public Sub Main()\r\n    Dim  G = 9.98[m/s^2]\r\n    Dim speed As [m/s] = distance[m] / time[s]\r\n    Dim Area As [m^2] = height[m] * width[m]\r\n    Dim Volume As [m^3] = height[m] * width[m] * depth[m]\r\n  End Sub\r\n\r\nEnd Module\r\n```\r\n\r\n## Define a Unit Of Measure\r\nImplemented by a new block construct `UnitOfMeasure .... End UnitOfMeasure`, which is, similar to a `namespace` block. These blocks can be imported.\r\n\r\nThe language will provide a base set of units of measure (SI Units and their derived Units)\r\n```vbnet\r\nUnitOfMeasure SI\r\n  UnitOfMeasure Distance\r\n    [m]  ' metres\r\n    [m^2] = [m] * [m]\r\n    [m^3] = [m] * [m] * [m]\r\n    [m^3] = [m^2] * [m]\r\n    [m^3] = [m] * [m^2]\r\n  End UnitOfMeasure\r\n\r\n  UnitOfMeasure Mass\r\n    [kg] ' kilograms (mass)\r\n  End UnitOfMeasure\r\n\r\n  UnitOfMeasure Duration\r\n    [s]  ' seconds\r\n  End UnitOfMeasure\r\n \r\n  UnitOfMeasure Temperature\r\n    [K]   ' Kelvins\r\n    [K].Min = 0[K]\r\n  End UnitOfMeasure\r\n\r\n  UnitOfMeasure AmountOfSubstance\r\n    [mol] ' Mole\r\n  End UnitOfMeasure  \r\n\r\n  UnitOfMeasure LuminousIntensity\r\n    [cd]  ' candela\r\n  End UnitOfMeasure\r\n\r\n  UnitOfMeasure ElectricCurrent\r\n    [A]   ' Amperes\r\n  End UnitOfMeasure\r\n\r\nEnd UnitOfMeasure\r\n```\r\n\r\n```vbnet\r\nUnitOfMeasure SI_Derived\r\n\r\n  UnitOfMeasure Distance\r\n    [min] = [s] / 60\r\n    [s]   = [min] * 60\r\n  End UnitOfMeasure\r\n\r\n  UnitOfMeasure Duration\r\n    [ms] = [s] / 100\r\n    [ns] = [s] * 1000000\r\n  End UnitOfMeasure\r\n\r\n  UnitOfMeasure Frequency\r\n    [Hz] ' Hertz\r\n    [Hz] = [1/s] \r\n    [Hz] = [s^-1]\r\n    [KHz] = [Hz] / 1000\r\n    [MHz] = [KHz] / 1000\r\n    [GHz] = [MHz] / 1000\r\n    [THz] = [GHz] / 1000\r\n  End UnitOfMeasure\r\n\r\nEnd UnitOfMeasure\r\n```\r\n```vb\r\nConst C = 299792458[m/s]\r\nConst G = 9.98[m/s^2]\r\nConst Avogadro= (6.022140857 x 10^23)[mol^-1]\r\n```"},"comment":{"url":"https://api.github.com/repos/dotnet/vblang/issues/comments/341865994","html_url":"https://github.com/dotnet/vblang/issues/200#issuecomment-341865994","issue_url":"https://api.github.com/repos/dotnet/vblang/issues/200","id":341865994,"user":{"login":"Bill-McC","id":8454020,"avatar_url":"https://avatars2.githubusercontent.com/u/8454020?v=4","gravatar_id":"","url":"https://api.github.com/users/Bill-McC","html_url":"https://github.com/Bill-McC","followers_url":"https://api.github.com/users/Bill-McC/followers","following_url":"https://api.github.com/users/Bill-McC/following{/other_user}","gists_url":"https://api.github.com/users/Bill-McC/gists{/gist_id}","starred_url":"https://api.github.com/users/Bill-McC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bill-McC/subscriptions","organizations_url":"https://api.github.com/users/Bill-McC/orgs","repos_url":"https://api.github.com/users/Bill-McC/repos","events_url":"https://api.github.com/users/Bill-McC/events{/privacy}","received_events_url":"https://api.github.com/users/Bill-McC/received_events","type":"User","site_admin":false},"created_at":"2017-11-04T02:36:16Z","updated_at":"2017-11-04T02:36:16Z","author_association":"NONE","body":"Is this different from #120  ?\r\n"}}
{"actor":{"display_login":"Bill-McC"}}