{"action":"created","issue":{"url":"https://api.github.com/repos/hhvm/hack-langspec/issues/87","repository_url":"https://api.github.com/repos/hhvm/hack-langspec","labels_url":"https://api.github.com/repos/hhvm/hack-langspec/issues/87/labels{/name}","comments_url":"https://api.github.com/repos/hhvm/hack-langspec/issues/87/comments","events_url":"https://api.github.com/repos/hhvm/hack-langspec/issues/87/events","html_url":"https://github.com/hhvm/hack-langspec/issues/87","id":195627144,"number":87,"title":"list intrinsic grammar is too permissive","user":{"login":"ericlippert","id":9200228,"avatar_url":"https://avatars.githubusercontent.com/u/9200228?v=3","gravatar_id":"","url":"https://api.github.com/users/ericlippert","html_url":"https://github.com/ericlippert","followers_url":"https://api.github.com/users/ericlippert/followers","following_url":"https://api.github.com/users/ericlippert/following{/other_user}","gists_url":"https://api.github.com/users/ericlippert/gists{/gist_id}","starred_url":"https://api.github.com/users/ericlippert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericlippert/subscriptions","organizations_url":"https://api.github.com/users/ericlippert/orgs","repos_url":"https://api.github.com/users/ericlippert/repos","events_url":"https://api.github.com/users/ericlippert/events{/privacy}","received_events_url":"https://api.github.com/users/ericlippert/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-14T19:45:31Z","updated_at":"2016-12-14T19:47:19Z","closed_at":"2016-12-14T19:47:19Z","body":"The grammar says\r\n\r\n      list-intrinsic:\r\n         list  (  list-expression-list-opt  )\r\n      list-expression-list:\r\n        expression\r\n        ,\r\n        list-expression-list  ,  expression-opt\r\n\r\nAnd then goes on to say\r\n\r\n    Only the right-most list-or-variable can be omitted.\r\n\r\nThis is a weird way to characterize that the grammar permits a trailing comma.  I don't think of \r\n\r\n    list($x, $y,)\r\n\r\nas having *omitted* a variable after the comma, but rather, having *added* an unnecessary comma.  Characterizing this as an \"omission\" implies that something ought to be there.\r\n\r\nI would remove the sentence entirely and enforce the rule in the grammar:\r\n\r\n      list-intrinsic:\r\n         list  (  expression-list-opt  )\r\n      expression-list:\r\n        expressions ,-opt\r\n      expressions:\r\n        expression\r\n        expressions  ,  expression\r\n\r\nNow there is no need for the supporting text, and the only things that can be \"omitted\" are (1) the entire list, or (2) the trailing comma.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/hhvm/hack-langspec/issues/comments/267136427","html_url":"https://github.com/hhvm/hack-langspec/issues/87#issuecomment-267136427","issue_url":"https://api.github.com/repos/hhvm/hack-langspec/issues/87","id":267136427,"user":{"login":"ericlippert","id":9200228,"avatar_url":"https://avatars.githubusercontent.com/u/9200228?v=3","gravatar_id":"","url":"https://api.github.com/users/ericlippert","html_url":"https://github.com/ericlippert","followers_url":"https://api.github.com/users/ericlippert/followers","following_url":"https://api.github.com/users/ericlippert/following{/other_user}","gists_url":"https://api.github.com/users/ericlippert/gists{/gist_id}","starred_url":"https://api.github.com/users/ericlippert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericlippert/subscriptions","organizations_url":"https://api.github.com/users/ericlippert/orgs","repos_url":"https://api.github.com/users/ericlippert/repos","events_url":"https://api.github.com/users/ericlippert/events{/privacy}","received_events_url":"https://api.github.com/users/ericlippert/received_events","type":"User","site_admin":false},"created_at":"2016-12-14T19:47:19Z","updated_at":"2016-12-14T19:47:19Z","body":"Whoops, I already entered this one as #82.\r\n"}}
{"actor":{"display_login":"ericlippert"}}