{"action":"created","issue":{"url":"https://api.github.com/repos/chapel-lang/chapel/issues/9306","repository_url":"https://api.github.com/repos/chapel-lang/chapel","labels_url":"https://api.github.com/repos/chapel-lang/chapel/issues/9306/labels{/name}","comments_url":"https://api.github.com/repos/chapel-lang/chapel/issues/9306/comments","events_url":"https://api.github.com/repos/chapel-lang/chapel/issues/9306/events","html_url":"https://github.com/chapel-lang/chapel/issues/9306","id":316899592,"number":9306,"title":"Should enums support `<`, `<=`, `>`, `>=` by default?","user":{"login":"bradcray","id":7536222,"avatar_url":"https://avatars0.githubusercontent.com/u/7536222?v=4","gravatar_id":"","url":"https://api.github.com/users/bradcray","html_url":"https://github.com/bradcray","followers_url":"https://api.github.com/users/bradcray/followers","following_url":"https://api.github.com/users/bradcray/following{/other_user}","gists_url":"https://api.github.com/users/bradcray/gists{/gist_id}","starred_url":"https://api.github.com/users/bradcray/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bradcray/subscriptions","organizations_url":"https://api.github.com/users/bradcray/orgs","repos_url":"https://api.github.com/users/bradcray/repos","events_url":"https://api.github.com/users/bradcray/events{/privacy}","received_events_url":"https://api.github.com/users/bradcray/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"bradcray","id":7536222,"avatar_url":"https://avatars0.githubusercontent.com/u/7536222?v=4","gravatar_id":"","url":"https://api.github.com/users/bradcray","html_url":"https://github.com/bradcray","followers_url":"https://api.github.com/users/bradcray/followers","following_url":"https://api.github.com/users/bradcray/following{/other_user}","gists_url":"https://api.github.com/users/bradcray/gists{/gist_id}","starred_url":"https://api.github.com/users/bradcray/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bradcray/subscriptions","organizations_url":"https://api.github.com/users/bradcray/orgs","repos_url":"https://api.github.com/users/bradcray/repos","events_url":"https://api.github.com/users/bradcray/events{/privacy}","received_events_url":"https://api.github.com/users/bradcray/received_events","type":"User","site_admin":false},"assignees":[{"login":"bradcray","id":7536222,"avatar_url":"https://avatars0.githubusercontent.com/u/7536222?v=4","gravatar_id":"","url":"https://api.github.com/users/bradcray","html_url":"https://github.com/bradcray","followers_url":"https://api.github.com/users/bradcray/followers","following_url":"https://api.github.com/users/bradcray/following{/other_user}","gists_url":"https://api.github.com/users/bradcray/gists{/gist_id}","starred_url":"https://api.github.com/users/bradcray/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bradcray/subscriptions","organizations_url":"https://api.github.com/users/bradcray/orgs","repos_url":"https://api.github.com/users/bradcray/repos","events_url":"https://api.github.com/users/bradcray/events{/privacy}","received_events_url":"https://api.github.com/users/bradcray/received_events","type":"User","site_admin":false}],"milestone":null,"comments":4,"created_at":"2018-04-23T17:02:04Z","updated_at":"2018-05-02T18:30:44Z","closed_at":null,"author_association":"OWNER","body":"Issue #8794 proposed that the compiler should only create `==` and `!=` comparisons for enums by default.  It could be argued that it should also create `>`, `>=`, `<`, and `<=` since an enumerated type has a well-defined order.\r\n\r\nOne challenge to implementing such comparisons is that if an enum's underlying integer values were not statically known to be monotonically increasing, these could not be implemented simply by casting to integers and calling the integer comparisons.  Instead, we'd need to have some sort of \"enum to order\" function that would convert an enum to an ordinal value that we could do the comparison on.  This is functionality that would likely be required to support enum ranges as well (see #9117).  Presumably, with additional effort the compiler could distinguish between cases that need this extra conversion step and those that don't in order to implement the monotonic case more efficiently."},"comment":{"url":"https://api.github.com/repos/chapel-lang/chapel/issues/comments/386076265","html_url":"https://github.com/chapel-lang/chapel/issues/9306#issuecomment-386076265","issue_url":"https://api.github.com/repos/chapel-lang/chapel/issues/9306","id":386076265,"user":{"login":"mppf","id":3653132,"avatar_url":"https://avatars3.githubusercontent.com/u/3653132?v=4","gravatar_id":"","url":"https://api.github.com/users/mppf","html_url":"https://github.com/mppf","followers_url":"https://api.github.com/users/mppf/followers","following_url":"https://api.github.com/users/mppf/following{/other_user}","gists_url":"https://api.github.com/users/mppf/gists{/gist_id}","starred_url":"https://api.github.com/users/mppf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mppf/subscriptions","organizations_url":"https://api.github.com/users/mppf/orgs","repos_url":"https://api.github.com/users/mppf/repos","events_url":"https://api.github.com/users/mppf/events{/privacy}","received_events_url":"https://api.github.com/users/mppf/received_events","type":"User","site_admin":false},"created_at":"2018-05-02T18:30:44Z","updated_at":"2018-05-02T18:30:44Z","author_association":"CONTRIBUTOR","body":"But, it's also unclear to me why we would want to support enum ranges."}}
{"actor":{"display_login":"mppf"}}