{"action":"closed","issue":{"url":"https://api.github.com/repos/sisl/POMDPs.jl/issues/37","labels_url":"https://api.github.com/repos/sisl/POMDPs.jl/issues/37/labels{/name}","comments_url":"https://api.github.com/repos/sisl/POMDPs.jl/issues/37/comments","events_url":"https://api.github.com/repos/sisl/POMDPs.jl/issues/37/events","html_url":"https://github.com/sisl/POMDPs.jl/issues/37","id":110701335,"number":37,"title":"Macro to automatically generate error messages for interface functions","user":{"login":"zsunberg","id":4240491,"avatar_url":"https://avatars.githubusercontent.com/u/4240491?v=3","gravatar_id":"","url":"https://api.github.com/users/zsunberg","html_url":"https://github.com/zsunberg","followers_url":"https://api.github.com/users/zsunberg/followers","following_url":"https://api.github.com/users/zsunberg/following{/other_user}","gists_url":"https://api.github.com/users/zsunberg/gists{/gist_id}","starred_url":"https://api.github.com/users/zsunberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zsunberg/subscriptions","organizations_url":"https://api.github.com/users/zsunberg/orgs","repos_url":"https://api.github.com/users/zsunberg/repos","events_url":"https://api.github.com/users/zsunberg/events{/privacy}","received_events_url":"https://api.github.com/users/zsunberg/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-10-09T17:17:10Z","updated_at":"2015-10-10T23:42:21Z","closed_at":"2015-10-10T23:42:21Z","body":"Hi all, I am working on a macro that will automatically generate the error messages for the functions in the interface. I talked to Max about this yesterday, and I think it will be pretty useful.\r\n\r\nInstead of\r\n```julia\r\ncreate_state(pomdp::POMDP) = error(\"$(typeof(pomdp)) does not implement create_state\")\r\n```\r\n\r\nWe'll just be able to type\r\n```julia\r\n@pomdp_func create_state(pomdp::POMDP)\r\n```\r\n\r\nor something similar in the source and it will automatically generate the default error implementation. I think this will help us be more consistent and correct, and if we want to change the way these errors show up we can do it all from one place.\r\n\r\nI don't really think pomdp_func is a great name - if anyone has any ideas, let me know."}}