{"action":"created","issue":{"url":"https://api.github.com/repos/golang/go/issues/12711","labels_url":"https://api.github.com/repos/golang/go/issues/12711/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/12711/comments","events_url":"https://api.github.com/repos/golang/go/issues/12711/events","html_url":"https://github.com/golang/go/issues/12711","id":107688331,"number":12711,"title":"Proposal: Enhanced octal base literal representation","user":{"login":"RomanSaveljev","id":2023288,"avatar_url":"https://avatars.githubusercontent.com/u/2023288?v=3","gravatar_id":"","url":"https://api.github.com/users/RomanSaveljev","html_url":"https://github.com/RomanSaveljev","followers_url":"https://api.github.com/users/RomanSaveljev/followers","following_url":"https://api.github.com/users/RomanSaveljev/following{/other_user}","gists_url":"https://api.github.com/users/RomanSaveljev/gists{/gist_id}","starred_url":"https://api.github.com/users/RomanSaveljev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RomanSaveljev/subscriptions","organizations_url":"https://api.github.com/users/RomanSaveljev/orgs","repos_url":"https://api.github.com/users/RomanSaveljev/repos","events_url":"https://api.github.com/users/RomanSaveljev/events{/privacy}","received_events_url":"https://api.github.com/users/RomanSaveljev/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/golang/go/labels/Proposal","name":"Proposal","color":"ededed"}],"state":"open","locked":false,"assignee":{"login":"adg","id":8446613,"avatar_url":"https://avatars.githubusercontent.com/u/8446613?v=3","gravatar_id":"","url":"https://api.github.com/users/adg","html_url":"https://github.com/adg","followers_url":"https://api.github.com/users/adg/followers","following_url":"https://api.github.com/users/adg/following{/other_user}","gists_url":"https://api.github.com/users/adg/gists{/gist_id}","starred_url":"https://api.github.com/users/adg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adg/subscriptions","organizations_url":"https://api.github.com/users/adg/orgs","repos_url":"https://api.github.com/users/adg/repos","events_url":"https://api.github.com/users/adg/events{/privacy}","received_events_url":"https://api.github.com/users/adg/received_events","type":"User","site_admin":false},"milestone":null,"comments":5,"created_at":"2015-09-22T10:44:34Z","updated_at":"2015-09-22T16:03:20Z","closed_at":null,"body":"## Shortly\r\n\r\nProposal is to add an alternative syntax for representing octal literals and deprecate the current syntax in Go 2+. Deprecation is not necessary, but is personally perceived to be inline with Go's idioms\r\n\r\nCurrent syntax: `octal_lit   = \"0\" { octal_digit } .`\r\nProposed change: `octal_lit   = \"0o\" { octal_digit } .`\r\n\r\n## Background\r\n\r\nThe idea is directly borrowed from CoffeeScript, where the feature exists to help developers to avoid various typos in their code:\r\n\r\n* Missed `x` in `0x1234`\r\n* Missed `.` after `0` in `0.1234`\r\n* Missed `.` before `0` in `.01234`\r\n* Extra leading `0` in decimal literal as in `01234`\r\n\r\n## Personal view on the current syntax\r\n\r\nI think that the current syntax for octal literals is outdated and was simply copied from ancestor languages, because the problem it introduced there was not evident. This proposal may very well be rejected on the grounds of Go 1 compatibility promise assesment, but I guess it is good to keep the pressure for a change."},"comment":{"url":"https://api.github.com/repos/golang/go/issues/comments/142333875","html_url":"https://github.com/golang/go/issues/12711#issuecomment-142333875","issue_url":"https://api.github.com/repos/golang/go/issues/12711","id":142333875,"user":{"login":"robpike","id":4324516,"avatar_url":"https://avatars.githubusercontent.com/u/4324516?v=3","gravatar_id":"","url":"https://api.github.com/users/robpike","html_url":"https://github.com/robpike","followers_url":"https://api.github.com/users/robpike/followers","following_url":"https://api.github.com/users/robpike/following{/other_user}","gists_url":"https://api.github.com/users/robpike/gists{/gist_id}","starred_url":"https://api.github.com/users/robpike/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robpike/subscriptions","organizations_url":"https://api.github.com/users/robpike/orgs","repos_url":"https://api.github.com/users/robpike/repos","events_url":"https://api.github.com/users/robpike/events{/privacy}","received_events_url":"https://api.github.com/users/robpike/received_events","type":"User","site_admin":false},"created_at":"2015-09-22T16:03:20Z","updated_at":"2015-09-22T16:03:20Z","body":"If anything like this is to happen in Go 2, it should be more interesting than this. One possibility is a general way to have literals of arbitrary base, such as 3r012 where 3 is the base (radix), r is the marker, and the digits follow. This form has been used in other languages.\r\n\r\nRegardless, I don't believe any change is worthwhile. There is no pressing need for any of this. The current triad is convenient, familiar, and within a tiny fraction of being always enough."}}