Fork me on GitHub
#clojure
<
2020-03-07
>
jsyrjala10:03:47

What solutions there are for https://prettier.io/ like functionality? Basically a commit hook that automatically reformats the Clojure code to some sort of official style standard.

dominicm12:03:39

Zprint is the closest thing.

lilactown19:03:29

cljstyle is what we use at work

Cameron11:03:35

Just noticed

static final public Boolean T = Boolean.TRUE;//Keyword.intern(Symbol.intern(null, "t"));
in clojure.lang.RT; interesting to see Clojure presumably used something closer to the more typical lispian t to represent true (in this case, using :t) at some point (and then when aiming to look through the commits, I also happened to immediately land on this particular commit and it appears it in fact was originally a classic t )
-static public Symbol T = Symbol.create(null, "t");
+static public Keyword T = Keyword.intern(Symbol.create(null, "t"));

didibus22:03:47

Happy they moved away form that

dominicm14:03:45

Is clojure.xml part of the public API? The comment here makes me think not (or is it specifically emit? in which case the library is not useful to me.) https://clojure.atlassian.net/browse/CLJ-408

rickmoynihan14:03:33

I think only parse is. Also that library doesn’t handle xml namespaces properly iirc.

dominicm14:03:54

I have very simple requirements. I've switched to data.xml, and hopefully the api will remain stable enough for me to be okay with it.

Alex Miller (Clojure team)16:03:01

clojure.xml should be considered deprecated imo

pez17:03:36

Can reader tags be stacked?

Alex Miller (Clojure team)17:03:48

Readers be reading

😂 4
pez17:03:21

Thanks. Do you know about an example where this happens? (I'm trying to make Calva Paredit do the right thing when readers are present.)

dominicm18:03:54

Aero config files

pez20:03:38

Thanks!

Jakub Holý (HolyJak)20:03:24

Hi! I believed there was a function like somethat returns the index of the element found instead of the element itself but I cannot find the function. Was I wrong? (I guess I could use keep-indexedas a workaround...)

vlaaad22:03:49

.indexOf interop 🙂

Jakub Holý (HolyJak)10:03:50

But it doesn't take a predicate 😞

markbastian21:03:04

Maybe something like this?

(letfn [(index-of [desired s]
          (some #(when (= desired (s %)) %) (range (count s))))]
  (index-of :e [:a ::c :d :e :f]))

vlaaad22:03:05

or (.indexOf [:a :c :d :e :f] :e)

Jakub Holý (HolyJak)09:03:43

the problem is I don't want to compare for equality but use a custom predicate