{"action":"created","issue":{"url":"https://api.github.com/repos/nim-lang/Nim/issues/6561","repository_url":"https://api.github.com/repos/nim-lang/Nim","labels_url":"https://api.github.com/repos/nim-lang/Nim/issues/6561/labels{/name}","comments_url":"https://api.github.com/repos/nim-lang/Nim/issues/6561/comments","events_url":"https://api.github.com/repos/nim-lang/Nim/issues/6561/events","html_url":"https://github.com/nim-lang/Nim/issues/6561","id":267438076,"number":6561,"title":"Introduce a keyword for pure enumerations","user":{"login":"GooRoo","id":668584,"avatar_url":"https://avatars1.githubusercontent.com/u/668584?v=4","gravatar_id":"","url":"https://api.github.com/users/GooRoo","html_url":"https://github.com/GooRoo","followers_url":"https://api.github.com/users/GooRoo/followers","following_url":"https://api.github.com/users/GooRoo/following{/other_user}","gists_url":"https://api.github.com/users/GooRoo/gists{/gist_id}","starred_url":"https://api.github.com/users/GooRoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GooRoo/subscriptions","organizations_url":"https://api.github.com/users/GooRoo/orgs","repos_url":"https://api.github.com/users/GooRoo/repos","events_url":"https://api.github.com/users/GooRoo/events{/privacy}","received_events_url":"https://api.github.com/users/GooRoo/received_events","type":"User","site_admin":false},"labels":[{"id":122058493,"url":"https://api.github.com/repos/nim-lang/Nim/labels/Language%20design","name":"Language design","color":"eb6420","default":false},{"id":32256242,"url":"https://api.github.com/repos/nim-lang/Nim/labels/RFC","name":"RFC","color":"1d1d1d","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2017-10-22T05:45:02Z","updated_at":"2017-10-22T17:20:36Z","closed_at":null,"author_association":"NONE","body":"I really like that there is a distinguish between \"pure\" and \"regular\" enums in Nim. However, I don't like that one of them is made with pragma 'cause it looks ugly:\r\n```nim\r\ntype\r\n  Layer {.pure.} = enum\r\n    Background, Foreground, Overlay\r\n```\r\nSeeing this `{.pure.}`, I feel like the language is not mature enough to spend my time on it :) Probably that's because of similarity of situation with Haskell where are [lots of language extensions](https://gist.github.com/sdiehl/e6a7efa4708a878507d0) which can be turned on by pragmas, but the language standard has not been adopted to these changes yet. And as a user, I don't know which one will be accepted as an official part of the language and which one will not. \r\n\r\nIn my opinion, there is no reason to remove \"pure\" enumerations from the language ever, is it? So why not to create an additional separate keyword for this? (Especially considering the fact that \"many keywords\" is Nim's philosophy).\r\n```nim\r\ntype\r\n  Layer = pure enum\r\n    Background, Foreground, Overlay\r\n```\r\nChoose any variant which is appropriate for you:\r\n- `pure enum` (or `pureenum`)\r\n- `scoped enum` (`scopedenum` – looks like some conjuration or curse in Latin)\r\n- `closed enum` (?)\r\n- `enum!` (Ruby-style name)\r\n- `enum class` (please, no)\r\n- whatever else comes into your mind\r\n\r\nAs for me, I would prefer to use `enum!` because this exclamation mark adds some strictness to the code look instantly. But I do not expect to see this in Nim as we have neither keywords with special characters nor postfix operators. \r\n\r\nP.S. Sorry if this is a duplication of some existing issue. I believe, someone had to ask about this already. "},"comment":{"url":"https://api.github.com/repos/nim-lang/Nim/issues/comments/338493934","html_url":"https://github.com/nim-lang/Nim/issues/6561#issuecomment-338493934","issue_url":"https://api.github.com/repos/nim-lang/Nim/issues/6561","id":338493934,"user":{"login":"GooRoo","id":668584,"avatar_url":"https://avatars1.githubusercontent.com/u/668584?v=4","gravatar_id":"","url":"https://api.github.com/users/GooRoo","html_url":"https://github.com/GooRoo","followers_url":"https://api.github.com/users/GooRoo/followers","following_url":"https://api.github.com/users/GooRoo/following{/other_user}","gists_url":"https://api.github.com/users/GooRoo/gists{/gist_id}","starred_url":"https://api.github.com/users/GooRoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GooRoo/subscriptions","organizations_url":"https://api.github.com/users/GooRoo/orgs","repos_url":"https://api.github.com/users/GooRoo/repos","events_url":"https://api.github.com/users/GooRoo/events{/privacy}","received_events_url":"https://api.github.com/users/GooRoo/received_events","type":"User","site_admin":false},"created_at":"2017-10-22T17:20:36Z","updated_at":"2017-10-22T17:20:36Z","author_association":"NONE","body":"@kobi2187 people judge by appearance first.\r\n\r\nI know lots of developers who don't want to learn Nim only because they don't like `proc` keyword. "}}
{"actor":{"display_login":"GooRoo"}}