{"action":"created","issue":{"url":"https://api.github.com/repos/magnars/dash.el/issues/205","repository_url":"https://api.github.com/repos/magnars/dash.el","labels_url":"https://api.github.com/repos/magnars/dash.el/issues/205/labels{/name}","comments_url":"https://api.github.com/repos/magnars/dash.el/issues/205/comments","events_url":"https://api.github.com/repos/magnars/dash.el/issues/205/events","html_url":"https://github.com/magnars/dash.el/pull/205","id":190202902,"number":205,"title":"Fix setf on emacs23","user":{"login":"Wilfred","id":70800,"avatar_url":"https://avatars.githubusercontent.com/u/70800?v=3","gravatar_id":"","url":"https://api.github.com/users/Wilfred","html_url":"https://github.com/Wilfred","followers_url":"https://api.github.com/users/Wilfred/followers","following_url":"https://api.github.com/users/Wilfred/following{/other_user}","gists_url":"https://api.github.com/users/Wilfred/gists{/gist_id}","starred_url":"https://api.github.com/users/Wilfred/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wilfred/subscriptions","organizations_url":"https://api.github.com/users/Wilfred/orgs","repos_url":"https://api.github.com/users/Wilfred/repos","events_url":"https://api.github.com/users/Wilfred/events{/privacy}","received_events_url":"https://api.github.com/users/Wilfred/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-11-18T00:16:34Z","updated_at":"2016-11-18T21:39:00Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/magnars/dash.el/pulls/205","html_url":"https://github.com/magnars/dash.el/pull/205","diff_url":"https://github.com/magnars/dash.el/pull/205.diff","patch_url":"https://github.com/magnars/dash.el/pull/205.patch"},"body":"`gv-define-simple-setter` is not defined on Emacs 23, so we need to use\r\nthe macro `defsetf` instead. `defsetf` is not autoloaded, so we must\r\nrequire 'cl before using it.\r\n\r\nHowever, the whole form is macro-expanded on all Emacs versions, so\r\nwriting:\r\n\r\n```emacs-lisp\r\n(eval-when-compile\r\n  (if (fboundp 'gv-define-simple-setter)\r\n      (gv-define-simple-setter -first-item setcar)\r\n    (require 'cl)\r\n    (defsetf -first-item (x) (val) `(setcar ,x ,val))))\r\n```\r\n\r\nproduces byte-compile errors on Emacs 24+. The byte compiler there is\r\nassuming that `(defsetf ...)` is a function call because it hasn't\r\nexecuted the `(require 'cl)`.\r\n\r\nWe solve this by wrapping in another level of `eval-when-compile`. I\r\nthink this is roughly equivalent to meta levels:\r\nhttp://www.phyast.pitt.edu/~micheles/scheme/scheme22.html\r\n"},"comment":{"url":"https://api.github.com/repos/magnars/dash.el/issues/comments/261648712","html_url":"https://github.com/magnars/dash.el/pull/205#issuecomment-261648712","issue_url":"https://api.github.com/repos/magnars/dash.el/issues/205","id":261648712,"user":{"login":"Wilfred","id":70800,"avatar_url":"https://avatars.githubusercontent.com/u/70800?v=3","gravatar_id":"","url":"https://api.github.com/users/Wilfred","html_url":"https://github.com/Wilfred","followers_url":"https://api.github.com/users/Wilfred/followers","following_url":"https://api.github.com/users/Wilfred/following{/other_user}","gists_url":"https://api.github.com/users/Wilfred/gists{/gist_id}","starred_url":"https://api.github.com/users/Wilfred/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wilfred/subscriptions","organizations_url":"https://api.github.com/users/Wilfred/orgs","repos_url":"https://api.github.com/users/Wilfred/repos","events_url":"https://api.github.com/users/Wilfred/events{/privacy}","received_events_url":"https://api.github.com/users/Wilfred/received_events","type":"User","site_admin":false},"created_at":"2016-11-18T21:39:00Z","updated_at":"2016-11-18T21:39:00Z","body":"OK, here's a fix. It's not as elegant or satisfying as the nested `eval-when-compile`, but it works and compiles cleanly."}}
{"actor":{"display_login":"Wilfred"}}