Thought:
(defmacro as->
[expr name & forms]
`(let [~name ~expr
~@(interleave (repeat name) (butlast forms))]
~(last forms)))
On Sunday, October 5, 2014 1:02:50 AM UTC+2, Jan-Paul Bultmann wrote:
>
> Hey,
> I just noticed that while recur can be the last statement in most
> threading macros,
> it can’t be used within an `as->` macro.
>
> user=> (macroexpand '(-> x (recur)))
> (recur x)
>
> user=> (macroexpand '(as-> x % (recur %)))
> (let* [% x % (recur %)] %)
>
> This means that a recur within a `as->` will cause a CompilerException,
> because it is not at the tail position.
>
> Thoughts?
>
> Cheers,
> Jan-Paul
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
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 [email protected].
For more options, visit https://groups.google.com/d/optout.