{"action":"created","issue":{"url":"https://api.github.com/repos/manastech/crystal/issues/1690","labels_url":"https://api.github.com/repos/manastech/crystal/issues/1690/labels{/name}","comments_url":"https://api.github.com/repos/manastech/crystal/issues/1690/comments","events_url":"https://api.github.com/repos/manastech/crystal/issues/1690/events","html_url":"https://github.com/manastech/crystal/issues/1690","id":109709548,"number":1690,"title":"Macro-defs (and \"method\"-defs) inside method-defs","user":{"login":"ozra","id":563674,"avatar_url":"https://avatars.githubusercontent.com/u/563674?v=3","gravatar_id":"","url":"https://api.github.com/users/ozra","html_url":"https://github.com/ozra","followers_url":"https://api.github.com/users/ozra/followers","following_url":"https://api.github.com/users/ozra/following{/other_user}","gists_url":"https://api.github.com/users/ozra/gists{/gist_id}","starred_url":"https://api.github.com/users/ozra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ozra/subscriptions","organizations_url":"https://api.github.com/users/ozra/orgs","repos_url":"https://api.github.com/users/ozra/repos","events_url":"https://api.github.com/users/ozra/events{/privacy}","received_events_url":"https://api.github.com/users/ozra/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/manastech/crystal/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-10-04T22:41:48Z","updated_at":"2015-10-20T15:37:11Z","closed_at":"2015-10-18T13:27:30Z","body":"Is there any particular reason for not allowing macro-defs inside method-defs?\r\n\r\nI find it a good practise for DSL'ish helpers in certain methods (like setting up gui's or whatever, where you might repeat some similar constructs a lot) - without tainting the bigger namespace.\r\n\r\nA related issue is to also be able to define \"methods\", or rather \"functions\" - call it what you will (no closuring) - inside methods. That would of course basically serve the exact same purpose (especially after inlining in release mode), and could also be done with procs (albeit with sucky call syntax). \r\nStill - I would find it very usable. It's a practise I'm used to that also _avoids polluting bigger scopes than necessary_.\r\n"},"comment":{"url":"https://api.github.com/repos/manastech/crystal/issues/comments/149606849","html_url":"https://github.com/manastech/crystal/issues/1690#issuecomment-149606849","issue_url":"https://api.github.com/repos/manastech/crystal/issues/1690","id":149606849,"user":{"login":"ozra","id":563674,"avatar_url":"https://avatars.githubusercontent.com/u/563674?v=3","gravatar_id":"","url":"https://api.github.com/users/ozra","html_url":"https://github.com/ozra","followers_url":"https://api.github.com/users/ozra/followers","following_url":"https://api.github.com/users/ozra/following{/other_user}","gists_url":"https://api.github.com/users/ozra/gists{/gist_id}","starred_url":"https://api.github.com/users/ozra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ozra/subscriptions","organizations_url":"https://api.github.com/users/ozra/orgs","repos_url":"https://api.github.com/users/ozra/repos","events_url":"https://api.github.com/users/ozra/events{/privacy}","received_events_url":"https://api.github.com/users/ozra/received_events","type":"User","site_admin":false},"created_at":"2015-10-20T15:37:11Z","updated_at":"2015-10-20T15:37:11Z","body":"ok"}}