Re: Is there a way to use spec/fdef function specs with clojure.test ?

2017-10-01 Thread avichalp
Hi Khalid, Yes, you can get these details in the output. I have found these helper functions useful for this purpose. On Friday, 29 September 2017 15:38:57 UTC+5:30, Khalid Jebbari wrote: > > Hello, > > I'm struggling to f

Code Review -- Testing truthiness twice

2017-10-01 Thread Scott Barrett
Clojure noob, here. I'm very excited to be learning about this language and becoming a part of this community :) I'm writing a function that works well, but seems just a bit wrong to me, stylistically speaking. I was hoping I could get some guidance from you all. Here's the code: (defn get-if

Re: Code Review -- Testing truthiness twice

2017-10-01 Thread Leon Grapenthin
1. In general this style of iteration is not idiomatic unless you are hunting performance or write sth. that simply can't be composed from core sequence library (s. b.). If you have to write this style, look at `when-first`, `seq`, `next`. Study implementation of core library. More idiomatic im

Re: Code Review -- Testing truthiness twice

2017-10-01 Thread Leon Grapenthin
fix (defn get-if [m pred] (let [[match & more] (filter (comp pred key) m)] (if (and match (not more)) (val match Apologies. On Sunday, October 1, 2017 at 11:44:27 PM UTC+2, Leon Grapenthin wrote: > > 1. In general this style of iteration is not idiomatic unless you are > hunting perf

Re: Code Review -- Testing truthiness twice

2017-10-01 Thread Scott Barrett
Very helpful! Thanks for the swift and response critique. -- 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 firs

Re: How to try/catch Let bindings?

2017-10-01 Thread Didier
I've seen this, I was still curious if the reason I was facing the issue was that let is simply the wrong tool for my use case or not. If let is the correct tool, I would propose that clojure.core should had a try/catch where the catch is in scope of the try. I feel the reason this is contrived

Re: How to try/catch Let bindings?

2017-10-01 Thread Luke Burton
> On Sep 30, 2017, at 3:14 PM, Didier wrote: > > Is there another way to execute a set of complex steps which does not rely on > let and can be try/catched in the manner I describe? I can't emphasize enough the utility of the interceptor chain pattern, as employed heavily in pedestal. I use

Re: How to try/catch Let bindings?

2017-10-01 Thread Didier
> > I can't emphasize enough the utility of the interceptor chain pattern, as > employed heavily in pedestal. > Interesting... Its almost like a workflow framework, but for simpler in code workflows. I'm reluctant to have a dependency on pedestal just for this though. On Sunday, 1 October 201