Variable passed to macro gets resolved in wrong namespace?

后端 未结 4 2162
被撕碎了的回忆
被撕碎了的回忆 2021-01-12 05:04

The Noir macro defpage is giving me a little bit of trouble. I am trying to construct a call similar to this:

(defpage [:post \"some/url\"] [dat         


        
4条回答
  •  情歌与酒
    2021-01-12 05:47

    If we look through noir/core.clj file (source), find parse-route function and reason what it does with its method argument (it is called action there), we could find that method keyword is converted to string, uppercased and resolved in compojure.core namespace. All this is done during macro expansion time. So it is not possible to use variable instead of keyword without altering noir code.

提交回复
热议问题