Fork me on GitHub
#beginners
<
2015-07-08
>
seancorfield00:07:52

iae: fwiw, the dev packs in Emacs Live have the latest paredit, clj-refactor, and cider, as well as magit, and life is very good with it simple_smile I expect the next stable release to be fairly soon at this point.

mikecarter11:07:57

say i want to use clj-http in my clojure app - what’s the best way to check for the latest version?

mikecarter11:07:15

browse http://clojars.org or the clj-http github repo?

slipset11:07:52

Seems like the two are in sync

slipset11:07:20

What you could do is issue a pull-request for clj-http to include a version-badge from clojars in the readme

slipset11:07:38

[![Clojars Project]()]()

slipset11:07:44

@mikecarter: all you need to do is fork clj-http on github, edit the readme file and add this snippet, create a pull-request and you're done

mikecarter11:07:26

thanks @slipset - clj-http was just an example, i was wondering if there’s a quick way to get the latest version of a library

slipset11:07:36

a small step for man etc

mikecarter11:07:43

i’ve written a little package for emacs that does it but was wondering if i’m reinventing the wheel

slipset11:07:18

there is something like this in clj-refactor.el I think.

mikecarter11:07:30

thanks, i’ll check it out!

slipset11:07:49

or if it's in the cider middleware

mikecarter11:07:58

yeah, i was wondering that

slipset11:07:03

I cannot seem to recall, nor find it, but I know that http://github.com/expez showed it to me while he was working on clj-refactor

akiva15:07:35

I usually check GitHub and then Clojars. And if you’re using Leiningen, look into https://github.com/xsc/lein-ancient once you have a dependency in your project to automatically check (and update, if you’d like) your dependencies.

surreal.analysis15:07:20

Would there be any interest in a leiningen plugin along the lines of leiningen install-dependency clj-http, which adds clj-http to your project.clj file with the latest version?

surreal.analysis15:07:30

Alternatively, does that already exist?

rauh16:07:23

@surreal.analysis lein change :dependencies conj '[your.lib "0.1"]' But it'll make the vec ugly

surreal.analysis16:07:19

Yeah, I’m thinking of a setup where you don’t want to specify the 0.1

alexmiller16:07:51

there is something like this already, although I'm blanking on the name

surreal.analysis16:07:53

It’s not really a huge deal, but, for example, with npm you can pretty easily install a bunch of packages you know you want without worrying about specific versions

surreal.analysis16:07:12

So if I do lein new my-app

alexmiller16:07:43

you can do "lein search clj-http"

surreal.analysis16:07:48

And I know I want some basic things I use for db access

alexmiller16:07:04

after it updates the index it will tell you the latest

surreal.analysis16:07:29

Something like:

lein add-deps [org.postgresql/postgres org.clojure/java.jdbc honeysql hikari-cp migratus]

alexmiller16:07:54

ah, that's it!

mikecarter16:07:58

which makes use of the search on Clojars

mikecarter16:07:52

it’s very basic so far but you can do M-x helm-clojars and search for a library, i suppose it could add it to your project.clj and run lein deps too

meow22:07:25

So I've got this basic function:

(defn keyword->attr [k]
  (-> (name k)
      (string/split "-")
      (string/join)))
It takes a keyword like :foo-bar-baz and modifies it somewhat, but what I really need it to do is after the split it needs to do an initial cap on every part except the head, so in my example the result would be "fooBarBaz".

meow22:07:33

Anyone feel like helping?

roberto22:07:39

(defn camel [avector]
        (conj (head avector) (map clojure.string/capitalize (tail avector)))

 (defn keyword->attr [k]
  (-> (name k)
      (string/split "-“)
       camel
       (string/join)))

roberto22:07:43

maybe something like that?

roberto22:07:54

kinda hacky

meow22:07:41

now we should destructure it in the parameters

meow22:07:02

defn camel [head & rest]

meow22:07:29

but rest is already a func name - what's the canonical set of params for this situation

arrdem23:07:26

& rest or & more is common in clojure/core

meow23:07:02

@alejandro: the result of removing the head might be more than just the tail

meow23:07:37

so & rest or & more would be better, and & more won't shadow the rest builtin