{"action":"created","issue":{"url":"https://api.github.com/repos/godotengine/godot/issues/2966","labels_url":"https://api.github.com/repos/godotengine/godot/issues/2966/labels{/name}","comments_url":"https://api.github.com/repos/godotengine/godot/issues/2966/comments","events_url":"https://api.github.com/repos/godotengine/godot/issues/2966/events","html_url":"https://github.com/godotengine/godot/issues/2966","id":119773258,"number":2966,"title":"Add enums to GDScript","user":{"login":"bojidar-bg","id":5276727,"avatar_url":"https://avatars.githubusercontent.com/u/5276727?v=3","gravatar_id":"","url":"https://api.github.com/users/bojidar-bg","html_url":"https://github.com/bojidar-bg","followers_url":"https://api.github.com/users/bojidar-bg/followers","following_url":"https://api.github.com/users/bojidar-bg/following{/other_user}","gists_url":"https://api.github.com/users/bojidar-bg/gists{/gist_id}","starred_url":"https://api.github.com/users/bojidar-bg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bojidar-bg/subscriptions","organizations_url":"https://api.github.com/users/bojidar-bg/orgs","repos_url":"https://api.github.com/users/bojidar-bg/repos","events_url":"https://api.github.com/users/bojidar-bg/events{/privacy}","received_events_url":"https://api.github.com/users/bojidar-bg/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/godotengine/godot/labels/feature%20request","name":"feature request","color":"1144ff"},{"url":"https://api.github.com/repos/godotengine/godot/labels/needs%20discussion","name":"needs discussion","color":"ee77ee"},{"url":"https://api.github.com/repos/godotengine/godot/labels/topic:gdscript","name":"topic:gdscript","color":"ffdd44"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-01T17:58:32Z","updated_at":"2015-12-03T02:44:47Z","closed_at":null,"body":"### TL;DR\r\nI would like to avoid writing\r\n````js\r\nconst CORNER_W  = 0\r\nconst CORNER_NW = 1\r\nconst CORNER_NE = 2\r\nconst CORNER_E  = 3\r\nconst CORNER_SE = 4\r\nconst CORNER_SW = 5\r\n````\r\nAnd be able to write it like:\r\n````js\r\nenum {CORNER_W, CORNER_NW, CORNER_NE, CORNER_E, CORNER_SE, CORNER_SW}\r\n````\r\n----\r\n\r\n### Some more ideas\r\n\r\nThose ideas might simplify the usual workflow, or add additional features for strange workflows or setups.\r\n\r\n\r\nNice addition to avoid repetition:\r\n````js\r\nenum CORNER_{W, NW, NE, E, SE, SW}\r\n````\r\nCustom values idea 1:\r\n````js\r\nenum {CORNER_W = 1, CORNER_NW = 2, CORNER_NE = 3, CORNER_E = 4, CORNER_SE = 5, CORNER_SW = 6}\r\nenum {CORNER_W = 4, CORNER_NW, CORNER_NE, CORNER_E, CORNER_SE, CORNER_SW}\r\n````\r\nCustom values idea 2:\r\n````js\r\nenum {CORNER_W, CORNER_NW, CORNER_NE, CORNER_E, CORNER_SE, CORNER_SW} = [1,2,3,4,5,6]\r\nenum {CORNER_W, CORNER_NW, CORNER_NE, CORNER_E, CORNER_SE, CORNER_SW} = range(1,7)\r\n````\r\n\r\nMaybe `enum` should be prefixed by `const` or `var` depending on use? (IMO, it would be better to assume `const`, as to not create ambiguities, and/or hard to understand code)\r\n````js\r\nconst enum {…}\r\nvar enum {…}\r\n````"},"comment":{"url":"https://api.github.com/repos/godotengine/godot/issues/comments/161499620","html_url":"https://github.com/godotengine/godot/issues/2966#issuecomment-161499620","issue_url":"https://api.github.com/repos/godotengine/godot/issues/2966","id":161499620,"user":{"login":"WeAthFoLD","id":3516419,"avatar_url":"https://avatars.githubusercontent.com/u/3516419?v=3","gravatar_id":"","url":"https://api.github.com/users/WeAthFoLD","html_url":"https://github.com/WeAthFoLD","followers_url":"https://api.github.com/users/WeAthFoLD/followers","following_url":"https://api.github.com/users/WeAthFoLD/following{/other_user}","gists_url":"https://api.github.com/users/WeAthFoLD/gists{/gist_id}","starred_url":"https://api.github.com/users/WeAthFoLD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WeAthFoLD/subscriptions","organizations_url":"https://api.github.com/users/WeAthFoLD/orgs","repos_url":"https://api.github.com/users/WeAthFoLD/repos","events_url":"https://api.github.com/users/WeAthFoLD/events{/privacy}","received_events_url":"https://api.github.com/users/WeAthFoLD/received_events","type":"User","site_admin":false},"created_at":"2015-12-03T02:44:47Z","updated_at":"2015-12-03T02:44:47Z","body":"+1 Would really love to use enums. \r\n\r\nBut I don't think \"var\" enums are really helpful. (I think you mean \"var\" by being able to reassign enum values like `CORNER_W = 5`, correct? >.<). Do you have any use case in mind?"}}