{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/9343","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/9343/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/9343/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/9343/events","html_url":"https://github.com/JuliaLang/julia/issues/9343","id":51894855,"number":9343,"title":"Dummy variable _","user":{"login":"RauliRuohonen","id":5933118,"avatar_url":"https://avatars.githubusercontent.com/u/5933118?v=3","gravatar_id":"","url":"https://api.github.com/users/RauliRuohonen","html_url":"https://github.com/RauliRuohonen","followers_url":"https://api.github.com/users/RauliRuohonen/followers","following_url":"https://api.github.com/users/RauliRuohonen/following{/other_user}","gists_url":"https://api.github.com/users/RauliRuohonen/gists{/gist_id}","starred_url":"https://api.github.com/users/RauliRuohonen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RauliRuohonen/subscriptions","organizations_url":"https://api.github.com/users/RauliRuohonen/orgs","repos_url":"https://api.github.com/users/RauliRuohonen/repos","events_url":"https://api.github.com/users/RauliRuohonen/events{/privacy}","received_events_url":"https://api.github.com/users/RauliRuohonen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":17,"created_at":"2014-12-13T18:03:17Z","updated_at":"2015-12-28T05:34:05Z","closed_at":null,"body":"It'd be convenient to have a designated dummy variable ```_``` (actually keyword), which would simply ignore everything stored into it. For example, you often want to deconstruct tuples like so\r\n\r\n    a, _, b, _, c = f()\r\n\r\nwhere the ```_``` values are uninteresting. Likewise, one may want to ignore function arguments, like so\r\n\r\n    function foo(a, _, b, _, c)\r\n        return (a, b, c)\r\n    end\r\n\r\nThis is actually a syntax error right now, because two arguments have the same name, which makes sense if you actually want to read their values. The idea here is to instead discard them, and reading the value of ```_``` would be a syntax error.\r\n\r\nIn theory, this is purely about code readability: when one sees ```_```, one knows that the value is not used and thus won't need to be thought about any further; OTOH if one sees something else, then the value is probably going to be used further down the line and needs to be kept track of. One also won't need to behold the unsightly output of wetware gensym() implementations in unused function argument names. In practice though, there is also a performance difference with the current compiler:\r\n\r\n    function f1(x1, x2, x3, x4, x5)\r\n        a, _, b, _, c = x1, x2, x3, x4, x5\r\n        return (a, b, c)\r\n    end\r\n\r\n    function f2(x1, x2, x3, x4, x5)\r\n        return (x1, x3, x5)\r\n    end\r\n\r\n    code_native(f1, (Int, String, Int, Int, Int))\r\n    code_native(f2, (Int, String, Int, Int, Int))\r\n\r\nThe assembly for f2 is significantly shorter."},"comment":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/comments/167489205","html_url":"https://github.com/JuliaLang/julia/issues/9343#issuecomment-167489205","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/9343","id":167489205,"user":{"login":"Ismael-VC","id":4594825,"avatar_url":"https://avatars.githubusercontent.com/u/4594825?v=3","gravatar_id":"","url":"https://api.github.com/users/Ismael-VC","html_url":"https://github.com/Ismael-VC","followers_url":"https://api.github.com/users/Ismael-VC/followers","following_url":"https://api.github.com/users/Ismael-VC/following{/other_user}","gists_url":"https://api.github.com/users/Ismael-VC/gists{/gist_id}","starred_url":"https://api.github.com/users/Ismael-VC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ismael-VC/subscriptions","organizations_url":"https://api.github.com/users/Ismael-VC/orgs","repos_url":"https://api.github.com/users/Ismael-VC/repos","events_url":"https://api.github.com/users/Ismael-VC/events{/privacy}","received_events_url":"https://api.github.com/users/Ismael-VC/received_events","type":"User","site_admin":false},"created_at":"2015-12-28T05:34:05Z","updated_at":"2015-12-28T05:34:05Z","body":"I was thinking the other day to port a PHP MIT licensed version of gettext to Julia, gettext use `_` (as seen [here](https://en.wikipedia.org/wiki/Gettext#Programming)) instead of `gettext` as a short hand, I would love to have support for something like this in Base (and beyond?) by default allowing Julia to be multilang and also users to be able to make multilang packages. \r\n\r\nI don't know what do you think about this? I haven't mentioned anywhere because I haven't even started implemented it yet, but it's one step in my efforts to explore multilang Julia [here](https://groups.google.com/forum/#!topic/julia-dev/Vu6zyCPkkFs).\r\n\r\nI'm just way too slow, wish I had more time."}}