{"action":"created","issue":{"url":"https://api.github.com/repos/nathanmarz/specter/issues/255","repository_url":"https://api.github.com/repos/nathanmarz/specter","labels_url":"https://api.github.com/repos/nathanmarz/specter/issues/255/labels{/name}","comments_url":"https://api.github.com/repos/nathanmarz/specter/issues/255/comments","events_url":"https://api.github.com/repos/nathanmarz/specter/issues/255/events","html_url":"https://github.com/nathanmarz/specter/issues/255","id":317130699,"number":255,"title":"compact on empty collection","user":{"login":"jiacai2050","id":3848910,"avatar_url":"https://avatars1.githubusercontent.com/u/3848910?v=4","gravatar_id":"","url":"https://api.github.com/users/jiacai2050","html_url":"https://github.com/jiacai2050","followers_url":"https://api.github.com/users/jiacai2050/followers","following_url":"https://api.github.com/users/jiacai2050/following{/other_user}","gists_url":"https://api.github.com/users/jiacai2050/gists{/gist_id}","starred_url":"https://api.github.com/users/jiacai2050/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jiacai2050/subscriptions","organizations_url":"https://api.github.com/users/jiacai2050/orgs","repos_url":"https://api.github.com/users/jiacai2050/repos","events_url":"https://api.github.com/users/jiacai2050/events{/privacy}","received_events_url":"https://api.github.com/users/jiacai2050/received_events","type":"User","site_admin":false},"labels":[{"id":181183240,"url":"https://api.github.com/repos/nathanmarz/specter/labels/question","name":"question","color":"cc317c","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-04-24T08:54:40Z","updated_at":"2018-04-24T12:02:51Z","closed_at":"2018-04-24T12:02:51Z","author_association":"NONE","body":"```\r\n(let [m {:x {:y #{\"apple\"}}}]\r\n  (setval [:x (compact :y) (set-elem \"apple\")]\r\n          NONE\r\n          m))\r\n;; => {:x {:y #{}}}\r\n```\r\n\r\nI want to know what's the idiomatic way if I want this demo return `{}`\r\n"},"comment":{"url":"https://api.github.com/repos/nathanmarz/specter/issues/comments/383905522","html_url":"https://github.com/nathanmarz/specter/issues/255#issuecomment-383905522","issue_url":"https://api.github.com/repos/nathanmarz/specter/issues/255","id":383905522,"user":{"login":"nathanmarz","id":131416,"avatar_url":"https://avatars0.githubusercontent.com/u/131416?v=4","gravatar_id":"","url":"https://api.github.com/users/nathanmarz","html_url":"https://github.com/nathanmarz","followers_url":"https://api.github.com/users/nathanmarz/followers","following_url":"https://api.github.com/users/nathanmarz/following{/other_user}","gists_url":"https://api.github.com/users/nathanmarz/gists{/gist_id}","starred_url":"https://api.github.com/users/nathanmarz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nathanmarz/subscriptions","organizations_url":"https://api.github.com/users/nathanmarz/orgs","repos_url":"https://api.github.com/users/nathanmarz/repos","events_url":"https://api.github.com/users/nathanmarz/events{/privacy}","received_events_url":"https://api.github.com/users/nathanmarz/received_events","type":"User","site_admin":false},"created_at":"2018-04-24T12:02:51Z","updated_at":"2018-04-24T12:02:51Z","author_association":"OWNER","body":"`compact` needs to surround all the steps you want compacted if empty. In this case, you just need to do:\r\n\r\n```\r\n(setval [:x (compact :y (set-elem \"apple\"))]\r\n          NONE\r\n          m)\r\n```"}}
{"actor":{"display_login":"nathanmarz"}}