Fork me on GitHub
#clojure
<
2016-10-08
>
fellshard00:10:35

At that point, might as well give the parameter a name...

fellshard00:10:45

Even if it is something as simple as x

fellshard01:10:27

The (number? %) (zero? %) clause is functionally equivalent to testing (and (number? %) (zero? %)) outside the cond

fellshard01:10:39

Same with the following clause

fellshard01:10:06

In this case, maybe breaking out each of the sub-clauses into its own (and... test function could simplify things

fellshard01:10:03

So (defn empty-number? [x] (and (number? x) (zero? x)) (could simply turn in to (zero? x), the number check becomes redundant!)

fellshard01:10:15

Not quite sure what you'd call the 'sequential-or-string' version

fellshard01:10:18

Then your empty check becomes (or (empty-number? %) (empty-sequential? %) (nil? %))

fellshard01:10:25

Or if you really wanna have fun

fellshard01:10:58

#(apply or ((juxt empty-number? empty-sequential? nil?) %))

fellshard01:10:46

Forgot about or being a macro. You get the idea, though. 😛

radon01:10:18

#((apply some-fn ((juxt empty-number? empty-sequential? nil?) %)))

radon01:10:25

we are going for maximum “fun” right?

radon01:10:25

Of course, this won’t fit the intended purpose because juxt is non-lazy, but I like the spirit 🙂

fellshard04:10:13

Make it stranger! ™️

borkdude11:10:25

How does one call [org.clojure/clojure “…”], a coordinate? Maven coordinate?

malcolmsparks11:10:36

GAV is a coordinate tuple (group, artifact, version)

borkdude11:10:03

What is the common term for this in clojure tooling? I’m writing a README

malcolmsparks11:10:25

I call it a 'dependency'

malcolmsparks11:10:55

I say something like 'add this to your dependencies'

malcolmsparks11:10:29

The term 'coordinate' isn't widely used

malcolmsparks11:10:06

(not everyone coming to Clojure is cursed with a background knowledge of Maven)

borkdude11:10:39

Thanks @malcolmsparks . I needed it for writing the README here. https://github.com/borkdude/boot-bundle

ludothehun23:10:30

@mahinshaw Thank you, that is very useful. I wonder if there would be appetite for a grpc client library.

lvh23:10:56

I’m not remembering the name of a lein plugin

lvh23:10:11

it automatically re-runs your tests, especially the failing ones, quickly, by reloading only the changed ones

lvh23:10:18

it’s not lein auto, because that just does lein test again

lvh23:10:30

it’s not lein retest, because that doesn’t do the fast reloading IIRC

lvh23:10:41

(also hasn’t been touched since 2011 and apparently has outstanding bugs on current clojure setups)

lvh23:10:28

[com.jakemccrary/lein-test-refresh "0.17.0”] !