{"action":"created","comment":{"url":"https://api.github.com/repos/elixir-lang/elixir/pulls/comments/44410025","id":44410025,"diff_hunk":"@@ -11,9 +11,35 @@ defmodule Integer do\n   Returns `true` if `n` is an odd number, otherwise `false`.\n \n   Allowed in guard clauses.\n+\n+  ## Examples\n+\n+      iex> Integer.is_odd(3)\n+      true\n+\n+      iex> Integer.is_odd(4)\n+      false\n   \"\"\"\n+  @spec is_odd(integer) :: boolean\n   defmacro is_odd(n) do\n-    quote do: (unquote(n) &&& 1) == 1\n+    case Macro.Env.in_guard?(__CALLER__) do\n+      true ->\n+        quote do: (unquote(n) &&& 1) == 1\n+\n+      false ->\n+        quote bind_quoted: [n: n] do","path":"lib/elixir/lib/integer.ex","position":21,"original_position":21,"commit_id":"ccef0deaf8f7c7465a5b7c4d212c778fb59ecaff","original_commit_id":"ccef0deaf8f7c7465a5b7c4d212c778fb59ecaff","user":{"login":"josevalim","id":9582,"avatar_url":"https://avatars.githubusercontent.com/u/9582?v=3","gravatar_id":"","url":"https://api.github.com/users/josevalim","html_url":"https://github.com/josevalim","followers_url":"https://api.github.com/users/josevalim/followers","following_url":"https://api.github.com/users/josevalim/following{/other_user}","gists_url":"https://api.github.com/users/josevalim/gists{/gist_id}","starred_url":"https://api.github.com/users/josevalim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josevalim/subscriptions","organizations_url":"https://api.github.com/users/josevalim/orgs","repos_url":"https://api.github.com/users/josevalim/repos","events_url":"https://api.github.com/users/josevalim/events{/privacy}","received_events_url":"https://api.github.com/users/josevalim/received_events","type":"User","site_admin":false},"body":"We should never generate this much quoted code in the user. I don't think we should fix this, let's continue generating badarg. It sucks but at least it is consistent with all guard like things.","created_at":"2015-11-10T14:16:50Z","updated_at":"2015-11-10T14:16:50Z","html_url":"https://github.com/elixir-lang/elixir/pull/3950#discussion_r44410025","pull_request_url":"https://api.github.com/repos/elixir-lang/elixir/pulls/3950","_links":{"self":{"href":"https://api.github.com/repos/elixir-lang/elixir/pulls/comments/44410025"},"html":{"href":"https://github.com/elixir-lang/elixir/pull/3950#discussion_r44410025"},"pull_request":{"href":"https://api.github.com/repos/elixir-lang/elixir/pulls/3950"}}},"pull_request":{"url":"https://api.github.com/repos/elixir-lang/elixir/pulls/3950","id":50254642,"html_url":"https://github.com/elixir-lang/elixir/pull/3950","diff_url":"https://github.com/elixir-lang/elixir/pull/3950.diff","patch_url":"https://github.com/elixir-lang/elixir/pull/3950.patch","issue_url":"https://api.github.com/repos/elixir-lang/elixir/issues/3950","number":3950,"state":"open","locked":false,"title":"Integer - is_odd/1 & is_even/1: Add own raise message + @specs","user":{"login":"eksperimental","id":9133420,"avatar_url":"https://avatars.githubusercontent.com/u/9133420?v=3","gravatar_id":"","url":"https://api.github.com/users/eksperimental","html_url":"https://github.com/eksperimental","followers_url":"https://api.github.com/users/eksperimental/followers","following_url":"https://api.github.com/users/eksperimental/following{/other_user}","gists_url":"https://api.github.com/users/eksperimental/gists{/gist_id}","starred_url":"https://api.github.com/users/eksperimental/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eksperimental/subscriptions","organizations_url":"https://api.github.com/users/eksperimental/orgs","repos_url":"https://api.github.com/users/eksperimental/repos","events_url":"https://api.github.com/users/eksperimental/events{/privacy}","received_events_url":"https://api.github.com/users/eksperimental/received_events","type":"User","site_admin":false},"body":"Integer: is_odd/1 & is_even/1:\r\n- Adds @specs\r\n\r\n- Adds examples to docs\r\n\r\n- If given a wrong type, previous message was disguising:\r\n  > iex> Integer.is_odd(1.0)\r\n  > ** (ArithmeticError) bad argument in arithmetic expression\r\n    :erlang.band(1.0, 1)\r\n  \r\n  Now is:\r\n  > iex> Integer.is_odd(1.0)`\r\n  > ** (ArgumentError) Integer.is_odd/1 expects an integer as an argument, got: 1.0","created_at":"2015-11-10T13:42:18Z","updated_at":"2015-11-10T14:16:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"335f7887008bf03224c001d9ac1c6dadaeac7531","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/elixir-lang/elixir/pulls/3950/commits","review_comments_url":"https://api.github.com/repos/elixir-lang/elixir/pulls/3950/comments","review_comment_url":"https://api.github.com/repos/elixir-lang/elixir/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elixir-lang/elixir/issues/3950/comments","statuses_url":"https://api.github.com/repos/elixir-lang/elixir/statuses/ccef0deaf8f7c7465a5b7c4d212c778fb59ecaff","head":{"label":"eksperimental:integers","ref":"integers","sha":"ccef0deaf8f7c7465a5b7c4d212c778fb59ecaff","user":{"login":"eksperimental","id":9133420,"avatar_url":"https://avatars.githubusercontent.com/u/9133420?v=3","gravatar_id":"","url":"https://api.github.com/users/eksperimental","html_url":"https://github.com/eksperimental","followers_url":"https://api.github.com/users/eksperimental/followers","following_url":"https://api.github.com/users/eksperimental/following{/other_user}","gists_url":"https://api.github.com/users/eksperimental/gists{/gist_id}","starred_url":"https://api.github.com/users/eksperimental/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eksperimental/subscriptions","organizations_url":"https://api.github.com/users/eksperimental/orgs","repos_url":"https://api.github.com/users/eksperimental/repos","events_url":"https://api.github.com/users/eksperimental/events{/privacy}","received_events_url":"https://api.github.com/users/eksperimental/received_events","type":"User","site_admin":false},"repo":{"id":25033185,"name":"elixir","full_name":"eksperimental/elixir","owner":{"login":"eksperimental","id":9133420,"avatar_url":"https://avatars.githubusercontent.com/u/9133420?v=3","gravatar_id":"","url":"https://api.github.com/users/eksperimental","html_url":"https://github.com/eksperimental","followers_url":"https://api.github.com/users/eksperimental/followers","following_url":"https://api.github.com/users/eksperimental/following{/other_user}","gists_url":"https://api.github.com/users/eksperimental/gists{/gist_id}","starred_url":"https://api.github.com/users/eksperimental/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eksperimental/subscriptions","organizations_url":"https://api.github.com/users/eksperimental/orgs","repos_url":"https://api.github.com/users/eksperimental/repos","events_url":"https://api.github.com/users/eksperimental/events{/privacy}","received_events_url":"https://api.github.com/users/eksperimental/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/eksperimental/elixir","description":"Elixir is a dynamic, functional language designed for building scalable and maintainable applications","fork":true,"url":"https://api.github.com/repos/eksperimental/elixir","forks_url":"https://api.github.com/repos/eksperimental/elixir/forks","keys_url":"https://api.github.com/repos/eksperimental/elixir/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eksperimental/elixir/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eksperimental/elixir/teams","hooks_url":"https://api.github.com/repos/eksperimental/elixir/hooks","issue_events_url":"https://api.github.com/repos/eksperimental/elixir/issues/events{/number}","events_url":"https://api.github.com/repos/eksperimental/elixir/events","assignees_url":"https://api.github.com/repos/eksperimental/elixir/assignees{/user}","branches_url":"https://api.github.com/repos/eksperimental/elixir/branches{/branch}","tags_url":"https://api.github.com/repos/eksperimental/elixir/tags","blobs_url":"https://api.github.com/repos/eksperimental/elixir/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eksperimental/elixir/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eksperimental/elixir/git/refs{/sha}","trees_url":"https://api.github.com/repos/eksperimental/elixir/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eksperimental/elixir/statuses/{sha}","languages_url":"https://api.github.com/repos/eksperimental/elixir/languages","stargazers_url":"https://api.github.com/repos/eksperimental/elixir/stargazers","contributors_url":"https://api.github.com/repos/eksperimental/elixir/contributors","subscribers_url":"https://api.github.com/repos/eksperimental/elixir/subscribers","subscription_url":"https://api.github.com/repos/eksperimental/elixir/subscription","commits_url":"https://api.github.com/repos/eksperimental/elixir/commits{/sha}","git_commits_url":"https://api.github.com/repos/eksperimental/elixir/git/commits{/sha}","comments_url":"https://api.github.com/repos/eksperimental/elixir/comments{/number}","issue_comment_url":"https://api.github.com/repos/eksperimental/elixir/issues/comments{/number}","contents_url":"https://api.github.com/repos/eksperimental/elixir/contents/{+path}","compare_url":"https://api.github.com/repos/eksperimental/elixir/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eksperimental/elixir/merges","archive_url":"https://api.github.com/repos/eksperimental/elixir/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eksperimental/elixir/downloads","issues_url":"https://api.github.com/repos/eksperimental/elixir/issues{/number}","pulls_url":"https://api.github.com/repos/eksperimental/elixir/pulls{/number}","milestones_url":"https://api.github.com/repos/eksperimental/elixir/milestones{/number}","notifications_url":"https://api.github.com/repos/eksperimental/elixir/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eksperimental/elixir/labels{/name}","releases_url":"https://api.github.com/repos/eksperimental/elixir/releases{/id}","created_at":"2014-10-10T11:48:55Z","updated_at":"2015-02-14T08:24:55Z","pushed_at":"2015-11-10T13:41:57Z","git_url":"git://github.com/eksperimental/elixir.git","ssh_url":"git@github.com:eksperimental/elixir.git","clone_url":"https://github.com/eksperimental/elixir.git","svn_url":"https://github.com/eksperimental/elixir","homepage":"http://elixir-lang.org/","size":31961,"stargazers_count":0,"watchers_count":0,"language":"Elixir","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"base":{"label":"elixir-lang:master","ref":"master","sha":"361d2f065d53e1dab2441f100d90841cd0fc7965","user":{"login":"elixir-lang","id":1481354,"avatar_url":"https://avatars.githubusercontent.com/u/1481354?v=3","gravatar_id":"","url":"https://api.github.com/users/elixir-lang","html_url":"https://github.com/elixir-lang","followers_url":"https://api.github.com/users/elixir-lang/followers","following_url":"https://api.github.com/users/elixir-lang/following{/other_user}","gists_url":"https://api.github.com/users/elixir-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/elixir-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elixir-lang/subscriptions","organizations_url":"https://api.github.com/users/elixir-lang/orgs","repos_url":"https://api.github.com/users/elixir-lang/repos","events_url":"https://api.github.com/users/elixir-lang/events{/privacy}","received_events_url":"https://api.github.com/users/elixir-lang/received_events","type":"Organization","site_admin":false},"repo":{"id":1234714,"name":"elixir","full_name":"elixir-lang/elixir","owner":{"login":"elixir-lang","id":1481354,"avatar_url":"https://avatars.githubusercontent.com/u/1481354?v=3","gravatar_id":"","url":"https://api.github.com/users/elixir-lang","html_url":"https://github.com/elixir-lang","followers_url":"https://api.github.com/users/elixir-lang/followers","following_url":"https://api.github.com/users/elixir-lang/following{/other_user}","gists_url":"https://api.github.com/users/elixir-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/elixir-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elixir-lang/subscriptions","organizations_url":"https://api.github.com/users/elixir-lang/orgs","repos_url":"https://api.github.com/users/elixir-lang/repos","events_url":"https://api.github.com/users/elixir-lang/events{/privacy}","received_events_url":"https://api.github.com/users/elixir-lang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/elixir-lang/elixir","description":"Elixir is a dynamic, functional language designed for building scalable and maintainable applications","fork":false,"url":"https://api.github.com/repos/elixir-lang/elixir","forks_url":"https://api.github.com/repos/elixir-lang/elixir/forks","keys_url":"https://api.github.com/repos/elixir-lang/elixir/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elixir-lang/elixir/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elixir-lang/elixir/teams","hooks_url":"https://api.github.com/repos/elixir-lang/elixir/hooks","issue_events_url":"https://api.github.com/repos/elixir-lang/elixir/issues/events{/number}","events_url":"https://api.github.com/repos/elixir-lang/elixir/events","assignees_url":"https://api.github.com/repos/elixir-lang/elixir/assignees{/user}","branches_url":"https://api.github.com/repos/elixir-lang/elixir/branches{/branch}","tags_url":"https://api.github.com/repos/elixir-lang/elixir/tags","blobs_url":"https://api.github.com/repos/elixir-lang/elixir/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elixir-lang/elixir/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elixir-lang/elixir/git/refs{/sha}","trees_url":"https://api.github.com/repos/elixir-lang/elixir/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elixir-lang/elixir/statuses/{sha}","languages_url":"https://api.github.com/repos/elixir-lang/elixir/languages","stargazers_url":"https://api.github.com/repos/elixir-lang/elixir/stargazers","contributors_url":"https://api.github.com/repos/elixir-lang/elixir/contributors","subscribers_url":"https://api.github.com/repos/elixir-lang/elixir/subscribers","subscription_url":"https://api.github.com/repos/elixir-lang/elixir/subscription","commits_url":"https://api.github.com/repos/elixir-lang/elixir/commits{/sha}","git_commits_url":"https://api.github.com/repos/elixir-lang/elixir/git/commits{/sha}","comments_url":"https://api.github.com/repos/elixir-lang/elixir/comments{/number}","issue_comment_url":"https://api.github.com/repos/elixir-lang/elixir/issues/comments{/number}","contents_url":"https://api.github.com/repos/elixir-lang/elixir/contents/{+path}","compare_url":"https://api.github.com/repos/elixir-lang/elixir/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elixir-lang/elixir/merges","archive_url":"https://api.github.com/repos/elixir-lang/elixir/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elixir-lang/elixir/downloads","issues_url":"https://api.github.com/repos/elixir-lang/elixir/issues{/number}","pulls_url":"https://api.github.com/repos/elixir-lang/elixir/pulls{/number}","milestones_url":"https://api.github.com/repos/elixir-lang/elixir/milestones{/number}","notifications_url":"https://api.github.com/repos/elixir-lang/elixir/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elixir-lang/elixir/labels{/name}","releases_url":"https://api.github.com/repos/elixir-lang/elixir/releases{/id}","created_at":"2011-01-09T08:43:57Z","updated_at":"2015-11-10T09:25:32Z","pushed_at":"2015-11-10T13:42:18Z","git_url":"git://github.com/elixir-lang/elixir.git","ssh_url":"git@github.com:elixir-lang/elixir.git","clone_url":"https://github.com/elixir-lang/elixir.git","svn_url":"https://github.com/elixir-lang/elixir","homepage":"http://elixir-lang.org/","size":58477,"stargazers_count":5293,"watchers_count":5293,"language":"Elixir","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":736,"mirror_url":null,"open_issues_count":46,"forks":736,"open_issues":46,"watchers":5293,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elixir-lang/elixir/pulls/3950"},"html":{"href":"https://github.com/elixir-lang/elixir/pull/3950"},"issue":{"href":"https://api.github.com/repos/elixir-lang/elixir/issues/3950"},"comments":{"href":"https://api.github.com/repos/elixir-lang/elixir/issues/3950/comments"},"review_comments":{"href":"https://api.github.com/repos/elixir-lang/elixir/pulls/3950/comments"},"review_comment":{"href":"https://api.github.com/repos/elixir-lang/elixir/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elixir-lang/elixir/pulls/3950/commits"},"statuses":{"href":"https://api.github.com/repos/elixir-lang/elixir/statuses/ccef0deaf8f7c7465a5b7c4d212c778fb59ecaff"}}}}