Fork me on GitHub
#beginners
<
2016-08-14
>
senya2201:08:47

question, why are these 2 different:

(set/union (vals {:e #{:m :f}, :c #{:f}, :b #{:c :f}, :d #{:m :f}, :a #{:c :f}}) )
;;=> (#{:m :f} #{:f} #{:c :f} #{:m :f} #{:c :f})
(apply set/union (vals {:e #{:m :f}, :c #{:f}, :b #{:c :f}, :d #{:m :f}, :a #{:c :f}}) )
;;=> #{:m :c :f}

senya2203:08:02

👍:skin-tone-1:

saicheong10:08:48

What is the correct way to read a clob data type using clojure/java.jdbc (version 0.6.1 onwards)? An example on the internet (https://gist.github.com/simonholgate/1632764) uses the functions with-connection and with-query-results, but these functions are no longer found in version 0.6.1.

peter.d11:08:21

Hey Guys! I would love to get some feedback on my solution for one of the problems on 4clojure: https://www.4clojure.com/problem/28 My solution: https://www.refheap.com/122247 Can my solution be considered OK, or are there any better (simpler, more logical, best-practice) approaches to this problem?

madstap15:08:41

@peter.d: Style nitpick, in clojure things are named with kebab-case and not camelCase. So flattenImplementation -> flatten-implementation, finalList -> final-list, etc. Otherwise I'd consider your solution ok, but you should follow some users on the site to see their solutions after you've solved a problem, it's incredibly informative.

keith.moore15:08:53

TIL kebab-case 💯

keith.moore15:08:20

@peter.d thanks for the link to http://4clojure.com, it is pretty awesome

seancorfield18:08:39

@saicheong: The definitive java.jdbc is http://clojure.github.io/java.jdbc/ — which links to the community-managed docs http://clojure-doc.org/articles/ecosystem/java_jdbc/home.html (but those sometimes lag behind since that web site is not auto-published when updates are pushed to the repo).

seancorfield18:08:15

That example code you found hasn’t worked for years — those functions disappeared from the API many versions back.

seancorfield18:08:57

I’ve added a complete example of how to do it with the modern java.jdbc API.

peter.d21:08:39

@madstap: Thanks for the info about the naming convention! And good idea regarding following people on 4clojure - I started following some of the top users. Thanks 🙂 @keith.moore: np, here's another link with lots of good info for beginners; http://www.lispcast.com/ultimate-guide-to-learning-clojure-for-free