Re: Bizzarre cond-> behavior

2017-07-21 Thread Milt Reder
Nicola, Wow, I certainly didn't expect to wake up to a patch, nice work. I think I get the underlying problem, seems like there might be other cases where this comes up. Thanks also to others who dared to drop my code into their REPLs to confirm, I am constantly impressed by the Clojure communi

Re: Bizzarre cond-> behavior

2017-07-21 Thread Nicola Mometto
correct > On 21 Jul 2017, at 12:11, Peter Hull wrote: > > That was quick! So, if I understand it, the problem is not with cond->, it's > the chain of let-bindings it expands to? > Pete > > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To

Re: Bizzarre cond-> behavior

2017-07-21 Thread Peter Hull
That was quick! So, if I understand it, the problem is not with cond->, it's the chain of let-bindings it expands to? Pete -- 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

Re: Bizzarre cond-> behavior

2017-07-21 Thread Nicola Mometto
Ticket with patch + explanation: https://dev.clojure.org/jira/browse/CLJ-2210 > On 21 Jul 2017, at 11:06, Nicola Mometto wrote: > > I have a patch that fixes this, will open a ticket later today. > >> On 21 Jul 2017, at 10:07, James Reeves >

Re: Bizzarre cond-> behavior

2017-07-21 Thread Nicola Mometto
I have a patch that fixes this, will open a ticket later today. > On 21 Jul 2017, at 10:07, James Reeves wrote: > > I can also confirm, tested on Clojure 1.8.0. The macro doesn't seem to take > long at all; it's the expanded code that takes a significant time to compile. > > On 21 July 2017 at

Re: Bizzarre cond-> behavior

2017-07-21 Thread James Reeves
I can also confirm, tested on Clojure 1.8.0. The macro doesn't seem to take long at all; it's the expanded code that takes a significant time to compile. On 21 July 2017 at 10:56, Peter Hull wrote: > On Friday, 21 July 2017 00:35:00 UTC+1, Milt Reder wrote: >> >> Here's a simplified example: >>

Re: Bizzarre cond-> behavior

2017-07-21 Thread Peter Hull
On Friday, 21 July 2017 00:35:00 UTC+1, Milt Reder wrote: > > Here's a simplified example: > > I can confirm that pasting that defn into a CIDER repl does take a long time before the prompt comes back. I tried doing a "macro expand all" and it was pretty much instantaneous. The resulting expansio

Re: Bizzarre cond-> behavior

2017-07-20 Thread Milt Reder
Here's a simplified example: (defn wat [& {:keys [a b c d e f map-0 map-1 map-2]}] (cond-> "foo" a (str a) b (str b) c (str c) d (str d) e (str e) f (str f) map-0 (cond-> (:a map-0) (str (:a map-0)) (:b map-0) (str (:b

Bizzarre cond-> behavior

2017-07-20 Thread Milt Reder
Hey Clojurians, I'm experiencing some odd behavior with cond-> and was wondering if anyone had any ideas. I was troubleshooting a very slow load time in one of our projects, and traced it to a web templating library we maintain. One of the functions in this lib, `cell` takes a *very* long time (