{"action":"created","issue":{"url":"https://api.github.com/repos/vim-jp/issues/issues/121","repository_url":"https://api.github.com/repos/vim-jp/issues","labels_url":"https://api.github.com/repos/vim-jp/issues/issues/121/labels{/name}","comments_url":"https://api.github.com/repos/vim-jp/issues/issues/121/comments","events_url":"https://api.github.com/repos/vim-jp/issues/issues/121/events","html_url":"https://github.com/vim-jp/issues/issues/121","id":2761084,"number":121,"title":"type() の結果の定数が欲しい","user":{"login":"thinca","id":20474,"avatar_url":"https://avatars.githubusercontent.com/u/20474?v=3","gravatar_id":"","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},"labels":[{"url":"https://api.github.com/repos/vim-jp/issues/labels/kind/discuss","name":"kind/discuss","color":"e10c02"},{"url":"https://api.github.com/repos/vim-jp/issues/labels/kind/new%20feature","name":"kind/new feature","color":"e10c02"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2012-01-08T14:28:40Z","updated_at":"2016-07-16T02:56:22Z","closed_at":null,"body":"`type()` の結果は数値であり、`:help type()` では以下のような使い方をしろと書いてある。\r\n\r\n```vim\r\n:if type(myvar) == type(0)\r\n:if type(myvar) == type(\"\")\r\n:if type(myvar) == type(function(\"tr\"))\r\n:if type(myvar) == type([])\r\n:if type(myvar) == type({})\r\n:if type(myvar) == type(0.0)\r\n```\r\n\r\nしかし、\r\n\r\n- パッと見わかりづらい\r\n- function は長い\r\n- 定数を得るために関数呼び出しをするのはパフォーマンス上気になる(まあ微々たるもんでしょうが)\r\n\r\nなどの理由で改めて定数を用意することがよくある。\r\nどうせなら最初から `v:` などに組み込み定数として用意してあると嬉しい。"},"comment":{"url":"https://api.github.com/repos/vim-jp/issues/issues/comments/233104563","html_url":"https://github.com/vim-jp/issues/issues/121#issuecomment-233104563","issue_url":"https://api.github.com/repos/vim-jp/issues/issues/121","id":233104563,"user":{"login":"k-takata","id":840186,"avatar_url":"https://avatars.githubusercontent.com/u/840186?v=3","gravatar_id":"","url":"https://api.github.com/users/k-takata","html_url":"https://github.com/k-takata","followers_url":"https://api.github.com/users/k-takata/followers","following_url":"https://api.github.com/users/k-takata/following{/other_user}","gists_url":"https://api.github.com/users/k-takata/gists{/gist_id}","starred_url":"https://api.github.com/users/k-takata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/k-takata/subscriptions","organizations_url":"https://api.github.com/users/k-takata/orgs","repos_url":"https://api.github.com/users/k-takata/repos","events_url":"https://api.github.com/users/k-takata/events{/privacy}","received_events_url":"https://api.github.com/users/k-takata/received_events","type":"User","site_admin":false},"created_at":"2016-07-16T02:56:22Z","updated_at":"2016-07-16T02:56:22Z","body":"現状、jobとchannelはマジックナンバーを使わざるを得ないので、そこを焦点にすればいけるかもしれない。"}}
{"actor":{"display_login":"k-takata"}}