Simple macros are often sugar around functions. In Pedestal, defroutes
appears to be defined as:

(defmacro defroutes [name route-spec]
  `(def ~name (expand-routes (quote ~route-spec))))

So you could use expand-routes and syntax quotes instead.

- James

On 12 July 2015 at 20:40, Lynn Dylan Hurley <lynn.dylan.hur...@gmail.com>
wrote:

> Here is what I'm trying to do:
>
> ---
>
> ;; route defined outside of the defroutes macro
> (def foo-route ["/" {:get foo-handler}])
>
> (defroutes routes
>   [[["/"
>       ;; I'm trying to do this, but it does NOT work
>       ["/foo" foo-route]
>
>       ;; this does work
>       ["/bar" ["/" {:get bar-handler}]]]]])
>
> ---
>
> Where `defroutes` is a macro defined by pedestal. I've tried this a million 
> different ways and nothing seems to work. Is what I'm trying to do even 
> possible?
>
>  --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to