Thanks, I'll take a look at pallet. And thanks also to Tassilo for the
suggestion to use anonymous functions.
--Miikka
On Jan 10, 2012, at 4:36 PM, Sam Ritchie wrote:
> Mikka,
>
> The pallet/thread-expr library has the macros you're looking for:
>
> https://github.com/pallet/thread-expr
>
>
Mikka,
The pallet/thread-expr library has the macros you're looking for:
https://github.com/pallet/thread-expr
These would allow you to write:
(use 'pallet.thread-expr)
(-> {}
(status code)
(content-type "application/json;charset=utf-8")
(when-> (= error-type :unauthorized)
(head
Miikka Miettinen writes:
Hi Miikka,
> I sometimes find myself wanting to write simple conditional
> expressions inside -> and ->>. For example, it would be nice to create
> Ring responses like this:
>
> (-> {}
> (status code)
> (content-type "application/json;charset=utf-8")
> (when
Hi,
I sometimes find myself wanting to write simple conditional expressions inside
-> and ->>. For example, it would be nice to create Ring responses like this:
(-> {}
(status code)
(content-type "application/json;charset=utf-8")
(when (= error-type :unauthorized)
(header "WWW-A