{"action":"closed","issue":{"url":"https://api.github.com/repos/manastech/crystal/issues/842","labels_url":"https://api.github.com/repos/manastech/crystal/issues/842/labels{/name}","comments_url":"https://api.github.com/repos/manastech/crystal/issues/842/comments","events_url":"https://api.github.com/repos/manastech/crystal/issues/842/events","html_url":"https://github.com/manastech/crystal/issues/842","id":90206012,"number":842,"title":"can I somehow get all @type.methods from first class-level macro call, not placing it in the end of class definition?","user":{"login":"Codcore","id":8759731,"avatar_url":"https://avatars.githubusercontent.com/u/8759731?v=3","gravatar_id":"","url":"https://api.github.com/users/Codcore","html_url":"https://github.com/Codcore","followers_url":"https://api.github.com/users/Codcore/followers","following_url":"https://api.github.com/users/Codcore/following{/other_user}","gists_url":"https://api.github.com/users/Codcore/gists{/gist_id}","starred_url":"https://api.github.com/users/Codcore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Codcore/subscriptions","organizations_url":"https://api.github.com/users/Codcore/orgs","repos_url":"https://api.github.com/users/Codcore/repos","events_url":"https://api.github.com/users/Codcore/events{/privacy}","received_events_url":"https://api.github.com/users/Codcore/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":9,"created_at":"2015-06-22T20:34:11Z","updated_at":"2015-09-30T14:49:34Z","closed_at":"2015-09-30T14:49:34Z","body":"Here is the code:\r\nhttp://play.crystal-lang.org/#/r/4ro\r\n```crystal\r\nmacro visible_methods\r\n  {% a = @type.methods.map { |m| {{p m.name.stringify}} } %}\r\n  \"Visible methods:\"\r\n  {{debug()}}\r\n  end\r\n\r\nclass A\r\n  \r\nvisible_methods\r\n\r\ndef a\r\n  visible_methods\r\nend\r\n  \r\nvisible_methods\r\n  \r\ndef b\r\n  visible_methods\r\nend\r\n  \r\nvisible_methods\r\n  \r\ndef c\r\n  visible_methods\r\nend\r\n  \r\nvisible_methods\r\n  \r\nend\r\n\r\na = A.new\r\na.a\r\na.b\r\na.c\r\n```\r\n\r\nOutput is:\r\n```\r\n\"Visible methods:\"\r\n  \r\n  \r\n\"a\"\r\n  \"Visible methods:\"\r\n  \r\n  \r\n\"a\"\r\n\"b\"\r\n  \"Visible methods:\"\r\n  \r\n  \r\n\"a\"\r\n\"b\"\r\n\"c\"\r\n  \"Visible methods:\"\r\n  \r\n  \r\n\"a\"\r\n\"b\"\r\n\"c\"\r\n  \"Visible methods:\"\r\n  \r\n  \r\n\"a\"\r\n\"b\"\r\n\"c\"\r\n  \"Visible methods:\"\r\n  \r\n  \r\n\"a\"\r\n\"b\"\r\n\"c\"\r\n  \"Visible methods:\"\r\n  \r\n```\r\nAll I need, it is to be able to be all class methods available at very first call of macro at class-level. Is it a way to say to interpreter not to call this macro while all Def's will not be setted to ```@type.methods```. I don't understand the whole picture what happens, so I can't figure out how to achieve this behavior."}}