{"action":"created","comment":{"url":"https://api.github.com/repos/dlang/phobos/pulls/comments/178463891","pull_request_review_id":108524124,"id":178463891,"diff_hunk":"@@ -8590,3 +8591,119 @@ enum isCopyable(S) = is(typeof(\n     static assert(isCopyable!int);\n     static assert(isCopyable!(int[]));\n }\n+\n+/++\n+ + Determines if `F` is a strongly `pure` function. To be strongly `pure`, a function must satisfy the following:\n+ + $(UL\n+ +   $(LI Each parameter is `immutable`, OR can be converted automatically to `immutable`\n+ +   (i.e. has no mutable indirections) AND is passed by value)\n+ +   $(LI The Return Type is `immutable` OR can be impicitly converted to `immutable`)\n+ + )\n+ + Params:\n+ + F = The function to be tested\n+ +\n+ + Returns:\n+ + `true` if the function is strongly `pure`, `false` if otherwise.\n+ + ++/\n+template isStronglyPure(F...)\n+if (F.length == 1 && isCallable!F)\n+{\n+    bool isStronglyPure()\n+    {\n+        alias STC = ParameterStorageClass;\n+\n+        if (!(functionAttributes!F & FunctionAttribute.pure_))\n+            return false;\n+\n+        alias params = Parameters!F;\n+\n+        static foreach (i; 0 .. arity!F)","path":"std/traits.d","position":38,"original_position":38,"commit_id":"31fb0fd120fbea8310cb57787937cf862bd5031c","original_commit_id":"31fb0fd120fbea8310cb57787937cf862bd5031c","user":{"login":"MetaLang","id":4450317,"avatar_url":"https://avatars0.githubusercontent.com/u/4450317?v=4","gravatar_id":"","url":"https://api.github.com/users/MetaLang","html_url":"https://github.com/MetaLang","followers_url":"https://api.github.com/users/MetaLang/followers","following_url":"https://api.github.com/users/MetaLang/following{/other_user}","gists_url":"https://api.github.com/users/MetaLang/gists{/gist_id}","starred_url":"https://api.github.com/users/MetaLang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MetaLang/subscriptions","organizations_url":"https://api.github.com/users/MetaLang/orgs","repos_url":"https://api.github.com/users/MetaLang/repos","events_url":"https://api.github.com/users/MetaLang/events{/privacy}","received_events_url":"https://api.github.com/users/MetaLang/received_events","type":"User","site_admin":false},"body":"You could instead write `static foreach (i, param; Parameters!F)`","created_at":"2018-04-01T17:16:47Z","updated_at":"2018-04-01T17:16:48Z","html_url":"https://github.com/dlang/phobos/pull/6403#discussion_r178463891","pull_request_url":"https://api.github.com/repos/dlang/phobos/pulls/6403","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/dlang/phobos/pulls/comments/178463891"},"html":{"href":"https://github.com/dlang/phobos/pull/6403#discussion_r178463891"},"pull_request":{"href":"https://api.github.com/repos/dlang/phobos/pulls/6403"}}},"pull_request":{"url":"https://api.github.com/repos/dlang/phobos/pulls/6403","id":178736256,"html_url":"https://github.com/dlang/phobos/pull/6403","diff_url":"https://github.com/dlang/phobos/pull/6403.diff","patch_url":"https://github.com/dlang/phobos/pull/6403.patch","issue_url":"https://api.github.com/repos/dlang/phobos/issues/6403","number":6403,"state":"open","locked":false,"title":"Add std.traits.isStronglyPure","user":{"login":"scarface-one","id":22617812,"avatar_url":"https://avatars1.githubusercontent.com/u/22617812?v=4","gravatar_id":"","url":"https://api.github.com/users/scarface-one","html_url":"https://github.com/scarface-one","followers_url":"https://api.github.com/users/scarface-one/followers","following_url":"https://api.github.com/users/scarface-one/following{/other_user}","gists_url":"https://api.github.com/users/scarface-one/gists{/gist_id}","starred_url":"https://api.github.com/users/scarface-one/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scarface-one/subscriptions","organizations_url":"https://api.github.com/users/scarface-one/orgs","repos_url":"https://api.github.com/users/scarface-one/repos","events_url":"https://api.github.com/users/scarface-one/events{/privacy}","received_events_url":"https://api.github.com/users/scarface-one/received_events","type":"User","site_admin":false},"body":"See relevant NG discussion: https://forum.dlang.org/thread/p9m6lb$iud$1@digitalmars.com\r\n\r\nD currently allows functions to be pure even though they are not strictly pure.\r\nTo be strictly pure, a function must satisfy the following:\r\n* Each parameter:\r\n  - is `immutable`, OR\r\n  - can be converted automatically to `immutable` (i.e. has no mutable indirections) AND is passed by value\r\n* The return type:\r\n  - is `immutable`, OR\r\n  - can be converted automatically to `immutable`\r\n\r\nAndrei has said that `const` will not count for now\r\n\r\nI'm also unsure on how to unittest the second overload for isStronglyPure,  since overloading of functions within the local scope is not allowed. Please help with this. Thanks!","created_at":"2018-04-01T16:19:48Z","updated_at":"2018-04-01T17:16:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"94a34f44f92d99b111298b3e31f3aae4ae8d417c","assignee":null,"assignees":[],"requested_reviewers":[{"login":"klickverbot","id":19335,"avatar_url":"https://avatars1.githubusercontent.com/u/19335?v=4","gravatar_id":"","url":"https://api.github.com/users/klickverbot","html_url":"https://github.com/klickverbot","followers_url":"https://api.github.com/users/klickverbot/followers","following_url":"https://api.github.com/users/klickverbot/following{/other_user}","gists_url":"https://api.github.com/users/klickverbot/gists{/gist_id}","starred_url":"https://api.github.com/users/klickverbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/klickverbot/subscriptions","organizations_url":"https://api.github.com/users/klickverbot/orgs","repos_url":"https://api.github.com/users/klickverbot/repos","events_url":"https://api.github.com/users/klickverbot/events{/privacy}","received_events_url":"https://api.github.com/users/klickverbot/received_events","type":"User","site_admin":false},{"login":"ZombineDev","id":3475150,"avatar_url":"https://avatars2.githubusercontent.com/u/3475150?v=4","gravatar_id":"","url":"https://api.github.com/users/ZombineDev","html_url":"https://github.com/ZombineDev","followers_url":"https://api.github.com/users/ZombineDev/followers","following_url":"https://api.github.com/users/ZombineDev/following{/other_user}","gists_url":"https://api.github.com/users/ZombineDev/gists{/gist_id}","starred_url":"https://api.github.com/users/ZombineDev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZombineDev/subscriptions","organizations_url":"https://api.github.com/users/ZombineDev/orgs","repos_url":"https://api.github.com/users/ZombineDev/repos","events_url":"https://api.github.com/users/ZombineDev/events{/privacy}","received_events_url":"https://api.github.com/users/ZombineDev/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/dlang/phobos/pulls/6403/commits","review_comments_url":"https://api.github.com/repos/dlang/phobos/pulls/6403/comments","review_comment_url":"https://api.github.com/repos/dlang/phobos/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dlang/phobos/issues/6403/comments","statuses_url":"https://api.github.com/repos/dlang/phobos/statuses/31fb0fd120fbea8310cb57787937cf862bd5031c","head":{"label":"scarface-one:std.traits.isStronglyPure","ref":"std.traits.isStronglyPure","sha":"31fb0fd120fbea8310cb57787937cf862bd5031c","user":{"login":"scarface-one","id":22617812,"avatar_url":"https://avatars1.githubusercontent.com/u/22617812?v=4","gravatar_id":"","url":"https://api.github.com/users/scarface-one","html_url":"https://github.com/scarface-one","followers_url":"https://api.github.com/users/scarface-one/followers","following_url":"https://api.github.com/users/scarface-one/following{/other_user}","gists_url":"https://api.github.com/users/scarface-one/gists{/gist_id}","starred_url":"https://api.github.com/users/scarface-one/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scarface-one/subscriptions","organizations_url":"https://api.github.com/users/scarface-one/orgs","repos_url":"https://api.github.com/users/scarface-one/repos","events_url":"https://api.github.com/users/scarface-one/events{/privacy}","received_events_url":"https://api.github.com/users/scarface-one/received_events","type":"User","site_admin":false},"repo":{"id":127635859,"name":"phobos","full_name":"scarface-one/phobos","owner":{"login":"scarface-one","id":22617812,"avatar_url":"https://avatars1.githubusercontent.com/u/22617812?v=4","gravatar_id":"","url":"https://api.github.com/users/scarface-one","html_url":"https://github.com/scarface-one","followers_url":"https://api.github.com/users/scarface-one/followers","following_url":"https://api.github.com/users/scarface-one/following{/other_user}","gists_url":"https://api.github.com/users/scarface-one/gists{/gist_id}","starred_url":"https://api.github.com/users/scarface-one/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scarface-one/subscriptions","organizations_url":"https://api.github.com/users/scarface-one/orgs","repos_url":"https://api.github.com/users/scarface-one/repos","events_url":"https://api.github.com/users/scarface-one/events{/privacy}","received_events_url":"https://api.github.com/users/scarface-one/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/scarface-one/phobos","description":"The standard library of the D programming language","fork":true,"url":"https://api.github.com/repos/scarface-one/phobos","forks_url":"https://api.github.com/repos/scarface-one/phobos/forks","keys_url":"https://api.github.com/repos/scarface-one/phobos/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scarface-one/phobos/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scarface-one/phobos/teams","hooks_url":"https://api.github.com/repos/scarface-one/phobos/hooks","issue_events_url":"https://api.github.com/repos/scarface-one/phobos/issues/events{/number}","events_url":"https://api.github.com/repos/scarface-one/phobos/events","assignees_url":"https://api.github.com/repos/scarface-one/phobos/assignees{/user}","branches_url":"https://api.github.com/repos/scarface-one/phobos/branches{/branch}","tags_url":"https://api.github.com/repos/scarface-one/phobos/tags","blobs_url":"https://api.github.com/repos/scarface-one/phobos/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scarface-one/phobos/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scarface-one/phobos/git/refs{/sha}","trees_url":"https://api.github.com/repos/scarface-one/phobos/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scarface-one/phobos/statuses/{sha}","languages_url":"https://api.github.com/repos/scarface-one/phobos/languages","stargazers_url":"https://api.github.com/repos/scarface-one/phobos/stargazers","contributors_url":"https://api.github.com/repos/scarface-one/phobos/contributors","subscribers_url":"https://api.github.com/repos/scarface-one/phobos/subscribers","subscription_url":"https://api.github.com/repos/scarface-one/phobos/subscription","commits_url":"https://api.github.com/repos/scarface-one/phobos/commits{/sha}","git_commits_url":"https://api.github.com/repos/scarface-one/phobos/git/commits{/sha}","comments_url":"https://api.github.com/repos/scarface-one/phobos/comments{/number}","issue_comment_url":"https://api.github.com/repos/scarface-one/phobos/issues/comments{/number}","contents_url":"https://api.github.com/repos/scarface-one/phobos/contents/{+path}","compare_url":"https://api.github.com/repos/scarface-one/phobos/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scarface-one/phobos/merges","archive_url":"https://api.github.com/repos/scarface-one/phobos/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scarface-one/phobos/downloads","issues_url":"https://api.github.com/repos/scarface-one/phobos/issues{/number}","pulls_url":"https://api.github.com/repos/scarface-one/phobos/pulls{/number}","milestones_url":"https://api.github.com/repos/scarface-one/phobos/milestones{/number}","notifications_url":"https://api.github.com/repos/scarface-one/phobos/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scarface-one/phobos/labels{/name}","releases_url":"https://api.github.com/repos/scarface-one/phobos/releases{/id}","deployments_url":"https://api.github.com/repos/scarface-one/phobos/deployments","created_at":"2018-04-01T14:19:30Z","updated_at":"2018-04-01T14:19:34Z","pushed_at":"2018-04-01T16:10:59Z","git_url":"git://github.com/scarface-one/phobos.git","ssh_url":"git@github.com:scarface-one/phobos.git","clone_url":"https://github.com/scarface-one/phobos.git","svn_url":"https://github.com/scarface-one/phobos","homepage":"dlang.org/phobos","size":47946,"stargazers_count":0,"watchers_count":0,"language":"D","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"bsl-1.0","name":"Boost Software License 1.0","spdx_id":"BSL-1.0","url":"https://api.github.com/licenses/bsl-1.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dlang:master","ref":"master","sha":"2e105c72a9e5fa028f31f1898ec8d479a9bae4a1","user":{"login":"dlang","id":565913,"avatar_url":"https://avatars3.githubusercontent.com/u/565913?v=4","gravatar_id":"","url":"https://api.github.com/users/dlang","html_url":"https://github.com/dlang","followers_url":"https://api.github.com/users/dlang/followers","following_url":"https://api.github.com/users/dlang/following{/other_user}","gists_url":"https://api.github.com/users/dlang/gists{/gist_id}","starred_url":"https://api.github.com/users/dlang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dlang/subscriptions","organizations_url":"https://api.github.com/users/dlang/orgs","repos_url":"https://api.github.com/users/dlang/repos","events_url":"https://api.github.com/users/dlang/events{/privacy}","received_events_url":"https://api.github.com/users/dlang/received_events","type":"Organization","site_admin":false},"repo":{"id":1257084,"name":"phobos","full_name":"dlang/phobos","owner":{"login":"dlang","id":565913,"avatar_url":"https://avatars3.githubusercontent.com/u/565913?v=4","gravatar_id":"","url":"https://api.github.com/users/dlang","html_url":"https://github.com/dlang","followers_url":"https://api.github.com/users/dlang/followers","following_url":"https://api.github.com/users/dlang/following{/other_user}","gists_url":"https://api.github.com/users/dlang/gists{/gist_id}","starred_url":"https://api.github.com/users/dlang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dlang/subscriptions","organizations_url":"https://api.github.com/users/dlang/orgs","repos_url":"https://api.github.com/users/dlang/repos","events_url":"https://api.github.com/users/dlang/events{/privacy}","received_events_url":"https://api.github.com/users/dlang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dlang/phobos","description":"The standard library of the D programming language","fork":false,"url":"https://api.github.com/repos/dlang/phobos","forks_url":"https://api.github.com/repos/dlang/phobos/forks","keys_url":"https://api.github.com/repos/dlang/phobos/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dlang/phobos/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dlang/phobos/teams","hooks_url":"https://api.github.com/repos/dlang/phobos/hooks","issue_events_url":"https://api.github.com/repos/dlang/phobos/issues/events{/number}","events_url":"https://api.github.com/repos/dlang/phobos/events","assignees_url":"https://api.github.com/repos/dlang/phobos/assignees{/user}","branches_url":"https://api.github.com/repos/dlang/phobos/branches{/branch}","tags_url":"https://api.github.com/repos/dlang/phobos/tags","blobs_url":"https://api.github.com/repos/dlang/phobos/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dlang/phobos/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dlang/phobos/git/refs{/sha}","trees_url":"https://api.github.com/repos/dlang/phobos/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dlang/phobos/statuses/{sha}","languages_url":"https://api.github.com/repos/dlang/phobos/languages","stargazers_url":"https://api.github.com/repos/dlang/phobos/stargazers","contributors_url":"https://api.github.com/repos/dlang/phobos/contributors","subscribers_url":"https://api.github.com/repos/dlang/phobos/subscribers","subscription_url":"https://api.github.com/repos/dlang/phobos/subscription","commits_url":"https://api.github.com/repos/dlang/phobos/commits{/sha}","git_commits_url":"https://api.github.com/repos/dlang/phobos/git/commits{/sha}","comments_url":"https://api.github.com/repos/dlang/phobos/comments{/number}","issue_comment_url":"https://api.github.com/repos/dlang/phobos/issues/comments{/number}","contents_url":"https://api.github.com/repos/dlang/phobos/contents/{+path}","compare_url":"https://api.github.com/repos/dlang/phobos/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dlang/phobos/merges","archive_url":"https://api.github.com/repos/dlang/phobos/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dlang/phobos/downloads","issues_url":"https://api.github.com/repos/dlang/phobos/issues{/number}","pulls_url":"https://api.github.com/repos/dlang/phobos/pulls{/number}","milestones_url":"https://api.github.com/repos/dlang/phobos/milestones{/number}","notifications_url":"https://api.github.com/repos/dlang/phobos/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dlang/phobos/labels{/name}","releases_url":"https://api.github.com/repos/dlang/phobos/releases{/id}","deployments_url":"https://api.github.com/repos/dlang/phobos/deployments","created_at":"2011-01-15T07:00:06Z","updated_at":"2018-04-01T09:55:15Z","pushed_at":"2018-04-01T17:08:51Z","git_url":"git://github.com/dlang/phobos.git","ssh_url":"git@github.com:dlang/phobos.git","clone_url":"https://github.com/dlang/phobos.git","svn_url":"https://github.com/dlang/phobos","homepage":"dlang.org/phobos","size":47942,"stargazers_count":867,"watchers_count":867,"language":"D","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":599,"mirror_url":null,"archived":false,"open_issues_count":122,"license":{"key":"bsl-1.0","name":"Boost Software License 1.0","spdx_id":"BSL-1.0","url":"https://api.github.com/licenses/bsl-1.0"},"forks":599,"open_issues":122,"watchers":867,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dlang/phobos/pulls/6403"},"html":{"href":"https://github.com/dlang/phobos/pull/6403"},"issue":{"href":"https://api.github.com/repos/dlang/phobos/issues/6403"},"comments":{"href":"https://api.github.com/repos/dlang/phobos/issues/6403/comments"},"review_comments":{"href":"https://api.github.com/repos/dlang/phobos/pulls/6403/comments"},"review_comment":{"href":"https://api.github.com/repos/dlang/phobos/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dlang/phobos/pulls/6403/commits"},"statuses":{"href":"https://api.github.com/repos/dlang/phobos/statuses/31fb0fd120fbea8310cb57787937cf862bd5031c"}},"author_association":"NONE"}}
{"actor":{"display_login":"MetaLang"}}