GitHub PullRequestReviewCommentEvent at 2014-08-14 17:26:03
Repository: vital.vim
Actor: thinca
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/vim-jp/vital.vim/pulls/comments/16252390","id":16252390,"diff_hunk":"@@ -426,6 +426,38 @@ group_by({list}, {expr})\t\t\t*Vital.Data.List.group_by*\n \techo L.group_by(['a', 'b', 'ab'], 'v:val[0]')\n \t\" {'a': ['a', 'ab'], 'b': ['b']}\n <\n+\t\t\t\t\t\t*Vital.Data.List.binary_search*\n+binary_search({list}, {expr}, [{func}, [{dict}]])\n+\tReturns the index in {list} where the item has a value equal to\n+\t{expr}.  {list} must be sorted.  If {expr} is not found, it returns\n+\t-1.\n+\tWhen {func} is given, it is used to check the lhs of {func} is less\n+\tthan the rhs of {func}.  {func} must be |string| or |Funcref||\n+\tWhen {func} is |string|, it must be a name of function.\n+\tWhen {func} is |Funcref| and it is function with \"dict\" attribute, {dict}\n+\talso must be specified.  {dict} is used as \"self\" in \"dict\" function.","path":"doc/vital-data-list.txt","position":13,"original_position":13,"commit_id":"8b7d437e3bfe2bc606e4a5f4f8892c10ac7723f9","original_commit_id":"8b7d437e3bfe2bc606e4a5f4f8892c10ac7723f9","user":{"login":"thinca","id":20474,"avatar_url":"https://avatars.githubusercontent.com/u/20474?v=2","gravatar_id":"3b83f8f7a25019f3ee01791df024bf3c","url":"https://api.github.com/users/thinca","html_url":"https://github.com/thinca","followers_url":"https://api.github.com/users/thinca/followers","following_url":"https://api.github.com/users/thinca/following{/other_user}","gists_url":"https://api.github.com/users/thinca/gists{/gist_id}","starred_url":"https://api.github.com/users/thinca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thinca/subscriptions","organizations_url":"https://api.github.com/users/thinca/orgs","repos_url":"https://api.github.com/users/thinca/repos","events_url":"https://api.github.com/users/thinca/events{/privacy}","received_events_url":"https://api.github.com/users/thinca/received_events","type":"User","site_admin":false},"body":"関数名から察しろってことなのかもしれないですが、二分探索をするってことが書いてないですね…。","created_at":"2014-08-14T17:26:03Z","updated_at":"2014-08-14T17:26:03Z","html_url":"https://github.com/vim-jp/vital.vim/pull/190#discussion_r16252390","pull_request_url":"https://api.github.com/repos/vim-jp/vital.vim/pulls/190","_links":{"self":{"href":"https://api.github.com/repos/vim-jp/vital.vim/pulls/comments/16252390"},"html":{"href":"https://github.com/vim-jp/vital.vim/pull/190#discussion_r16252390"},"pull_request":{"href":"https://api.github.com/repos/vim-jp/vital.vim/pulls/190"}}},"pull_request":{"url":"https://api.github.com/repos/vim-jp/vital.vim/pulls/190","id":19800406,"html_url":"https://github.com/vim-jp/vital.vim/pull/190","diff_url":"https://github.com/vim-jp/vital.vim/pull/190.diff","patch_url":"https://github.com/vim-jp/vital.vim/pull/190.patch","issue_url":"https://api.github.com/repos/vim-jp/vital.vim/issues/190","number":190,"state":"open","locked":false,"title":"[Data.List] Added missing function for binary search","user":{"login":"rhysd","id":823277,"avatar_url":"https://avatars.githubusercontent.com/u/823277?v=2","gravatar_id":"81c7022cd3d17c75e8da981274da6911","url":"https://api.github.com/users/rhysd","html_url":"https://github.com/rhysd","followers_url":"https://api.github.com/users/rhysd/followers","following_url":"https://api.github.com/users/rhysd/following{/other_user}","gists_url":"https://api.github.com/users/rhysd/gists{/gist_id}","starred_url":"https://api.github.com/users/rhysd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhysd/subscriptions","organizations_url":"https://api.github.com/users/rhysd/orgs","repos_url":"https://api.github.com/users/rhysd/repos","events_url":"https://api.github.com/users/rhysd/events{/privacy}","received_events_url":"https://api.github.com/users/rhysd/received_events","type":"User","site_admin":false},"body":"この間の momonga.vim # 6.1 で二分再帰のコードを書いていたときに，「そういえば二分探索って基本的なアルゴリズムなのに標準関数に無いですね．`index()` は線形探索だし…」みたいな話をしたので，書いてみました．\r\n二分探索の一般的な実装は再帰ですが，Vim script は `maxfuncdepth` の問題とかあるので，ループで実装しました．（この辺りは @koron さんにアドバイスもらいました）\r\n\r\nざっとで良いのでレビューをお願いしたいのと，関数名どうしようかなというのを迷っているのでそこを相談したいです．\r\n\r\n候補は\r\n\r\n- `binary_search`\r\n- `binsearch`\r\n- `bsearch`\r\n\r\nです．特に異論が無ければこのままでいきます．","created_at":"2014-08-14T16:59:48Z","updated_at":"2014-08-14T17:26:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e29e35406c743bfab7e625f4520c241018b44438","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/vim-jp/vital.vim/pulls/190/commits","review_comments_url":"https://api.github.com/repos/vim-jp/vital.vim/pulls/190/comments","review_comment_url":"https://api.github.com/repos/vim-jp/vital.vim/pulls/comments/{number}","comments_url":"https://api.github.com/repos/vim-jp/vital.vim/issues/190/comments","statuses_url":"https://api.github.com/repos/vim-jp/vital.vim/statuses/8b7d437e3bfe2bc606e4a5f4f8892c10ac7723f9","head":{"label":"rhysd:add/data-list-binary_search","ref":"add/data-list-binary_search","sha":"8b7d437e3bfe2bc606e4a5f4f8892c10ac7723f9","user":{"login":"rhysd","id":823277,"avatar_url":"https://avatars.githubusercontent.com/u/823277?v=2","gravatar_id":"81c7022cd3d17c75e8da981274da6911","url":"https://api.github.com/users/rhysd","html_url":"https://github.com/rhysd","followers_url":"https://api.github.com/users/rhysd/followers","following_url":"https://api.github.com/users/rhysd/following{/other_user}","gists_url":"https://api.github.com/users/rhysd/gists{/gist_id}","starred_url":"https://api.github.com/users/rhysd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhysd/subscriptions","organizations_url":"https://api.github.com/users/rhysd/orgs","repos_url":"https://api.github.com/users/rhysd/repos","events_url":"https://api.github.com/users/rhysd/events{/privacy}","received_events_url":"https://api.github.com/users/rhysd/received_events","type":"User","site_admin":false},"repo":{"id":10498006,"name":"vital.vim","full_name":"rhysd/vital.vim","owner":{"login":"rhysd","id":823277,"avatar_url":"https://avatars.githubusercontent.com/u/823277?v=2","gravatar_id":"81c7022cd3d17c75e8da981274da6911","url":"https://api.github.com/users/rhysd","html_url":"https://github.com/rhysd","followers_url":"https://api.github.com/users/rhysd/followers","following_url":"https://api.github.com/users/rhysd/following{/other_user}","gists_url":"https://api.github.com/users/rhysd/gists{/gist_id}","starred_url":"https://api.github.com/users/rhysd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhysd/subscriptions","organizations_url":"https://api.github.com/users/rhysd/orgs","repos_url":"https://api.github.com/users/rhysd/repos","events_url":"https://api.github.com/users/rhysd/events{/privacy}","received_events_url":"https://api.github.com/users/rhysd/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rhysd/vital.vim","description":"A comprehensive Vim utility functions for Vim plugins","fork":true,"url":"https://api.github.com/repos/rhysd/vital.vim","forks_url":"https://api.github.com/repos/rhysd/vital.vim/forks","keys_url":"https://api.github.com/repos/rhysd/vital.vim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rhysd/vital.vim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rhysd/vital.vim/teams","hooks_url":"https://api.github.com/repos/rhysd/vital.vim/hooks","issue_events_url":"https://api.github.com/repos/rhysd/vital.vim/issues/events{/number}","events_url":"https://api.github.com/repos/rhysd/vital.vim/events","assignees_url":"https://api.github.com/repos/rhysd/vital.vim/assignees{/user}","branches_url":"https://api.github.com/repos/rhysd/vital.vim/branches{/branch}","tags_url":"https://api.github.com/repos/rhysd/vital.vim/tags","blobs_url":"https://api.github.com/repos/rhysd/vital.vim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rhysd/vital.vim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rhysd/vital.vim/git/refs{/sha}","trees_url":"https://api.github.com/repos/rhysd/vital.vim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rhysd/vital.vim/statuses/{sha}","languages_url":"https://api.github.com/repos/rhysd/vital.vim/languages","stargazers_url":"https://api.github.com/repos/rhysd/vital.vim/stargazers","contributors_url":"https://api.github.com/repos/rhysd/vital.vim/contributors","subscribers_url":"https://api.github.com/repos/rhysd/vital.vim/subscribers","subscription_url":"https://api.github.com/repos/rhysd/vital.vim/subscription","commits_url":"https://api.github.com/repos/rhysd/vital.vim/commits{/sha}","git_commits_url":"https://api.github.com/repos/rhysd/vital.vim/git/commits{/sha}","comments_url":"https://api.github.com/repos/rhysd/vital.vim/comments{/number}","issue_comment_url":"https://api.github.com/repos/rhysd/vital.vim/issues/comments/{number}","contents_url":"https://api.github.com/repos/rhysd/vital.vim/contents/{+path}","compare_url":"https://api.github.com/repos/rhysd/vital.vim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rhysd/vital.vim/merges","archive_url":"https://api.github.com/repos/rhysd/vital.vim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rhysd/vital.vim/downloads","issues_url":"https://api.github.com/repos/rhysd/vital.vim/issues{/number}","pulls_url":"https://api.github.com/repos/rhysd/vital.vim/pulls{/number}","milestones_url":"https://api.github.com/repos/rhysd/vital.vim/milestones{/number}","notifications_url":"https://api.github.com/repos/rhysd/vital.vim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rhysd/vital.vim/labels{/name}","releases_url":"https://api.github.com/repos/rhysd/vital.vim/releases{/id}","created_at":"2013-06-05T08:14:12Z","updated_at":"2014-02-09T17:00:38Z","pushed_at":"2014-08-14T17:23:27Z","git_url":"git://github.com/rhysd/vital.vim.git","ssh_url":"git@github.com:rhysd/vital.vim.git","clone_url":"https://github.com/rhysd/vital.vim.git","svn_url":"https://github.com/rhysd/vital.vim","homepage":"","size":2509,"stargazers_count":0,"watchers_count":0,"language":"VimL","has_issues":false,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"vim-jp:master","ref":"master","sha":"98f94033ea3e7b051cb52661d94c552b493f2261","user":{"login":"vim-jp","id":1051958,"avatar_url":"https://avatars.githubusercontent.com/u/1051958?v=2","gravatar_id":"b5e75215e85a8da912280280ee1a1edc","url":"https://api.github.com/users/vim-jp","html_url":"https://github.com/vim-jp","followers_url":"https://api.github.com/users/vim-jp/followers","following_url":"https://api.github.com/users/vim-jp/following{/other_user}","gists_url":"https://api.github.com/users/vim-jp/gists{/gist_id}","starred_url":"https://api.github.com/users/vim-jp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vim-jp/subscriptions","organizations_url":"https://api.github.com/users/vim-jp/orgs","repos_url":"https://api.github.com/users/vim-jp/repos","events_url":"https://api.github.com/users/vim-jp/events{/privacy}","received_events_url":"https://api.github.com/users/vim-jp/received_events","type":"Organization","site_admin":false},"repo":{"id":1308435,"name":"vital.vim","full_name":"vim-jp/vital.vim","owner":{"login":"vim-jp","id":1051958,"avatar_url":"https://avatars.githubusercontent.com/u/1051958?v=2","gravatar_id":"b5e75215e85a8da912280280ee1a1edc","url":"https://api.github.com/users/vim-jp","html_url":"https://github.com/vim-jp","followers_url":"https://api.github.com/users/vim-jp/followers","following_url":"https://api.github.com/users/vim-jp/following{/other_user}","gists_url":"https://api.github.com/users/vim-jp/gists{/gist_id}","starred_url":"https://api.github.com/users/vim-jp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vim-jp/subscriptions","organizations_url":"https://api.github.com/users/vim-jp/orgs","repos_url":"https://api.github.com/users/vim-jp/repos","events_url":"https://api.github.com/users/vim-jp/events{/privacy}","received_events_url":"https://api.github.com/users/vim-jp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/vim-jp/vital.vim","description":"A comprehensive Vim utility functions for Vim plugins","fork":false,"url":"https://api.github.com/repos/vim-jp/vital.vim","forks_url":"https://api.github.com/repos/vim-jp/vital.vim/forks","keys_url":"https://api.github.com/repos/vim-jp/vital.vim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vim-jp/vital.vim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vim-jp/vital.vim/teams","hooks_url":"https://api.github.com/repos/vim-jp/vital.vim/hooks","issue_events_url":"https://api.github.com/repos/vim-jp/vital.vim/issues/events{/number}","events_url":"https://api.github.com/repos/vim-jp/vital.vim/events","assignees_url":"https://api.github.com/repos/vim-jp/vital.vim/assignees{/user}","branches_url":"https://api.github.com/repos/vim-jp/vital.vim/branches{/branch}","tags_url":"https://api.github.com/repos/vim-jp/vital.vim/tags","blobs_url":"https://api.github.com/repos/vim-jp/vital.vim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vim-jp/vital.vim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vim-jp/vital.vim/git/refs{/sha}","trees_url":"https://api.github.com/repos/vim-jp/vital.vim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vim-jp/vital.vim/statuses/{sha}","languages_url":"https://api.github.com/repos/vim-jp/vital.vim/languages","stargazers_url":"https://api.github.com/repos/vim-jp/vital.vim/stargazers","contributors_url":"https://api.github.com/repos/vim-jp/vital.vim/contributors","subscribers_url":"https://api.github.com/repos/vim-jp/vital.vim/subscribers","subscription_url":"https://api.github.com/repos/vim-jp/vital.vim/subscription","commits_url":"https://api.github.com/repos/vim-jp/vital.vim/commits{/sha}","git_commits_url":"https://api.github.com/repos/vim-jp/vital.vim/git/commits{/sha}","comments_url":"https://api.github.com/repos/vim-jp/vital.vim/comments{/number}","issue_comment_url":"https://api.github.com/repos/vim-jp/vital.vim/issues/comments/{number}","contents_url":"https://api.github.com/repos/vim-jp/vital.vim/contents/{+path}","compare_url":"https://api.github.com/repos/vim-jp/vital.vim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vim-jp/vital.vim/merges","archive_url":"https://api.github.com/repos/vim-jp/vital.vim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vim-jp/vital.vim/downloads","issues_url":"https://api.github.com/repos/vim-jp/vital.vim/issues{/number}","pulls_url":"https://api.github.com/repos/vim-jp/vital.vim/pulls{/number}","milestones_url":"https://api.github.com/repos/vim-jp/vital.vim/milestones{/number}","notifications_url":"https://api.github.com/repos/vim-jp/vital.vim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vim-jp/vital.vim/labels{/name}","releases_url":"https://api.github.com/repos/vim-jp/vital.vim/releases{/id}","created_at":"2011-01-30T08:40:37Z","updated_at":"2014-08-11T14:40:58Z","pushed_at":"2014-08-13T08:52:38Z","git_url":"git://github.com/vim-jp/vital.vim.git","ssh_url":"git@github.com:vim-jp/vital.vim.git","clone_url":"https://github.com/vim-jp/vital.vim.git","svn_url":"https://github.com/vim-jp/vital.vim","homepage":"","size":6540,"stargazers_count":139,"watchers_count":139,"language":"VimL","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":29,"mirror_url":null,"open_issues_count":36,"forks":29,"open_issues":36,"watchers":139,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/vim-jp/vital.vim/pulls/190"},"html":{"href":"https://github.com/vim-jp/vital.vim/pull/190"},"issue":{"href":"https://api.github.com/repos/vim-jp/vital.vim/issues/190"},"comments":{"href":"https://api.github.com/repos/vim-jp/vital.vim/issues/190/comments"},"review_comments":{"href":"https://api.github.com/repos/vim-jp/vital.vim/pulls/190/comments"},"review_comment":{"href":"https://api.github.com/repos/vim-jp/vital.vim/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/vim-jp/vital.vim/pulls/190/commits"},"statuses":{"href":"https://api.github.com/repos/vim-jp/vital.vim/statuses/8b7d437e3bfe2bc606e4a5f4f8892c10ac7723f9"}}}}