{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/215","labels_url":"https://api.github.com/repos/dotnet/roslyn/issues/215/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/215/comments","events_url":"https://api.github.com/repos/dotnet/roslyn/issues/215/events","html_url":"https://github.com/dotnet/roslyn/issues/215","id":56420910,"number":215,"title":"Proposal: Binary literals","user":{"login":"MadsTorgersen","id":6677272,"avatar_url":"https://avatars.githubusercontent.com/u/6677272?v=3","gravatar_id":"","url":"https://api.github.com/users/MadsTorgersen","html_url":"https://github.com/MadsTorgersen","followers_url":"https://api.github.com/users/MadsTorgersen/followers","following_url":"https://api.github.com/users/MadsTorgersen/following{/other_user}","gists_url":"https://api.github.com/users/MadsTorgersen/gists{/gist_id}","starred_url":"https://api.github.com/users/MadsTorgersen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MadsTorgersen/subscriptions","organizations_url":"https://api.github.com/users/MadsTorgersen/orgs","repos_url":"https://api.github.com/users/MadsTorgersen/repos","events_url":"https://api.github.com/users/MadsTorgersen/events{/privacy}","received_events_url":"https://api.github.com/users/MadsTorgersen/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dotnet/roslyn/labels/1%20-%20Planning","name":"1 - Planning","color":"cccccc"},{"url":"https://api.github.com/repos/dotnet/roslyn/labels/Area-Language%20Design","name":"Area-Language Design","color":"5319e7"},{"url":"https://api.github.com/repos/dotnet/roslyn/labels/Feature%20Request","name":"Feature Request","color":"fc2929"},{"url":"https://api.github.com/repos/dotnet/roslyn/labels/Language-C%23","name":"Language-C#","color":"207de5"}],"state":"open","locked":false,"assignee":{"login":"MadsTorgersen","id":6677272,"avatar_url":"https://avatars.githubusercontent.com/u/6677272?v=3","gravatar_id":"","url":"https://api.github.com/users/MadsTorgersen","html_url":"https://github.com/MadsTorgersen","followers_url":"https://api.github.com/users/MadsTorgersen/followers","following_url":"https://api.github.com/users/MadsTorgersen/following{/other_user}","gists_url":"https://api.github.com/users/MadsTorgersen/gists{/gist_id}","starred_url":"https://api.github.com/users/MadsTorgersen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MadsTorgersen/subscriptions","organizations_url":"https://api.github.com/users/MadsTorgersen/orgs","repos_url":"https://api.github.com/users/MadsTorgersen/repos","events_url":"https://api.github.com/users/MadsTorgersen/events{/privacy}","received_events_url":"https://api.github.com/users/MadsTorgersen/received_events","type":"User","site_admin":false},"milestone":null,"comments":10,"created_at":"2015-02-03T19:01:03Z","updated_at":"2015-02-06T01:48:53Z","closed_at":null,"body":"There’s a relatively common request to add binary literals to C# and VB. For bitmasks (e.g. flag enums) this seems genuinely useful, but it would also be great just for educational purposes.\r\n\r\nBinary literals would look like this:\r\n``` c#\r\nint nineteen = 0b10011;\r\n```\r\n\r\nSyntactically and semantically they are identical to hexadecimal literals, except for using `b`/`B` instead of `x`/`X`, having only digits `0` and `1` and being interpreted in base 2 instead of 16.\r\n\r\nThere’s little cost to implementing these, and little conceptual overhead to users of the language.\r\n\r\nSyntax\r\n======\r\n\r\nThe grammar would be as follows:\r\n\r\n> *integer-literal:*\r\n> &emsp;  ...\r\n> &emsp;  *binary-integer-literal*\r\n\r\n> *binary-integer-literal:*\r\n> &emsp;  `0b`  &emsp;  *binary-digits*  &emsp;  *integer-type-suffixopt*\r\n> &emsp;  `0B`  &emsp;  *binary-digits*  &emsp;  *integer-type-suffixopt*\r\n> \r\n> *binary-digits:*\r\n> &emsp;  *binary-digit*\r\n> &emsp;  *binary-digits*  &emsp;  *binary-digit*\r\n> \r\n> *binary-digit:*  &emsp; one of\r\n> &emsp;  `0`  `1`\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/comments/73167338","html_url":"https://github.com/dotnet/roslyn/issues/215#issuecomment-73167338","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/215","id":73167338,"user":{"login":"paulomorgado","id":470455,"avatar_url":"https://avatars.githubusercontent.com/u/470455?v=3","gravatar_id":"","url":"https://api.github.com/users/paulomorgado","html_url":"https://github.com/paulomorgado","followers_url":"https://api.github.com/users/paulomorgado/followers","following_url":"https://api.github.com/users/paulomorgado/following{/other_user}","gists_url":"https://api.github.com/users/paulomorgado/gists{/gist_id}","starred_url":"https://api.github.com/users/paulomorgado/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulomorgado/subscriptions","organizations_url":"https://api.github.com/users/paulomorgado/orgs","repos_url":"https://api.github.com/users/paulomorgado/repos","events_url":"https://api.github.com/users/paulomorgado/events{/privacy}","received_events_url":"https://api.github.com/users/paulomorgado/received_events","type":"User","site_admin":false},"created_at":"2015-02-06T01:48:53Z","updated_at":"2015-02-06T01:48:53Z","body":"@tmat, @SirCmpwn and since that's where C# is heading hard and heavy now, it might make sense to consider the effort of introducing octal numbers."}}