Skip to content

How to pass arguments to decorators? #2500

Answered by Kodiologist
rcarmo asked this question in Q&A
Discussion options

You must be logged in to vote

So you'd now write that as:

(defn
  [
   (get (+ PAGE_ROUTE_BASE "/<pagename:path>"))
   (report_processing_time STATS_ADDRESS STATS_PORT)
   (http_caching "pagename" "text/html" ASSET_HTTP_EXPIRY)
   (lru_cache 10)
   (view "wiki")]
  wiki_page [pagename]
  …)

except you should rename get or it will be shadowed by the core macro of the same name. Straightforward enough, no? Am I missing something?

Replies: 4 comments 9 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@Kodiologist
Comment options

@wrobell
Comment options

Comment options

You must be logged in to vote
3 replies
@wrobell
Comment options

@Kodiologist
Comment options

@wrobell
Comment options

Comment options

You must be logged in to vote
4 replies
@Kodiologist
Comment options

Answer selected by Kodiologist
@rcarmo
Comment options

@Kodiologist
Comment options

@rcarmo
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants