{"action":"closed","issue":{"url":"https://api.github.com/repos/oakes/play-clj/issues/103","repository_url":"https://api.github.com/repos/oakes/play-clj","labels_url":"https://api.github.com/repos/oakes/play-clj/issues/103/labels{/name}","comments_url":"https://api.github.com/repos/oakes/play-clj/issues/103/comments","events_url":"https://api.github.com/repos/oakes/play-clj/issues/103/events","html_url":"https://github.com/oakes/play-clj/issues/103","id":176232872,"number":103,"title":"key-code shouldn't be a macro","user":{"login":"marad","id":1618489,"avatar_url":"https://avatars.githubusercontent.com/u/1618489?v=3","gravatar_id":"","url":"https://api.github.com/users/marad","html_url":"https://github.com/marad","followers_url":"https://api.github.com/users/marad/followers","following_url":"https://api.github.com/users/marad/following{/other_user}","gists_url":"https://api.github.com/users/marad/gists{/gist_id}","starred_url":"https://api.github.com/users/marad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marad/subscriptions","organizations_url":"https://api.github.com/users/marad/orgs","repos_url":"https://api.github.com/users/marad/repos","events_url":"https://api.github.com/users/marad/events{/privacy}","received_events_url":"https://api.github.com/users/marad/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-11T08:59:31Z","updated_at":"2016-09-15T01:26:35Z","closed_at":"2016-09-15T01:26:35Z","body":"The `key-code` function is defined as a macro here: https://github.com/oakes/play-clj/blob/894040fae0ced31568f464753bb780dee49f679f/src/play_clj/core_basics.clj#L110\r\n\r\nThis causes this code to fail:\r\n\r\n```clojure\r\n(key-code (:up controls))\r\n```\r\n\r\nI'ts because `key-code` body is not quoted, so it's executed at macro expansion time and the argument is unevaluated `'(:up controls)` instead of the actual value I'd like to have there. Then it breaks on `key->upper` function because it cannot convert the list `'(:up controls)` to a name.\r\n\r\nFix could be simple:\r\n\r\n```clojure\r\n(defn key-code [k]\r\n  (eval (u/gdx-field \"Input$Keys\" (u/key->upper k))))\r\n```"}}
{"actor":{"display_login":"oakes"}}