Skip to content

Instantly share code, notes, and snippets.

@jsnikeris
Created July 19, 2011 03:10
Show Gist options
  • Save jsnikeris/1091232 to your computer and use it in GitHub Desktop.
Save jsnikeris/1091232 to your computer and use it in GitHub Desktop.
How can I remove the repetition found in the last two lines?
(require '[net.cgrand.enlive-html :as e])
(e/at entry
[:id] (e/content id)
[#{:published :updated}] (e/content (str pub-date))
[[:link (e/attr= :rel "edit")]] (e/set-attr :href (str edit-url))
[[:link (e/attr= :rel "alternate")]] (e/set-attr :href (str edit-url)))))
@jsnikeris
Copy link
Author

The only part of the last two lines that is changing are the strings "edit" and "alternate". How can I remove this repetition?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment