Fork me on GitHub
#beginners
<
2018-01-15
>
adrian08:01:37

Hi guys, Clojure noob here, coming over from the Node.js land. I am about to kick-start a new Reagent website shortly. Just wondering what the consensus in the community are around Leiningen vs Boot, and figwheel vs boot-reload.

schmee09:01:32

Lein is the default option, but Boot has plenty of users as well

schmee09:01:09

I’d say start with Lein until you run into things that annoy you and at that point take a look at Boot or other options and see if they solve said annoyances πŸ™‚

adrian09:01:08

It reminds me of Grunt vs Gulp in the JS world, until Webpack walks in and clear the floor. πŸ™‚

sundarj10:01:28

if it helps, you can think of Lein as like npm, and Boot as like Grunt/Gulp/Rollup (except with dependency management as well)

sundarj10:01:42

also note that there's an official dependency manager now (though it's still in its early stages): https://clojure.org/guides/deps_and_cli

sundarj10:01:00

but that does not do any build stuff, so you do still need Lein/Boot

adrian07:01:21

This official one is interesting. Not a lot of people talk about it on the internet.

sundarj14:01:49

it's very new, so that would be why

adrian09:01:27

Thanks schmee, that's good advice. I'll give that a go

sb11:01:23

I would like to use local repo.

mvn install:install-file -Dfile=jep-2.24.jar -DgroupId=jep \
       -DartifactId=jep -Dversion=2.24 -Dpackaging=jar -DlocalRepositoryPath=maven_repository -DcreateChecksum=true

sb12:01:09

I tried with deploy/deploy-install too

sb11:01:40

I would like to add jep jar to local repo.

sb11:01:18

After this I add to project.clj >> :repositories {"local" "file:/Users/sb/Downloads/cljjep/maven_repository"} or before this :repositories {"local" ~(str (.toURI (java.io.File. "maven_repository")))} and lein deps .. but nothing happens. any idea, what I did in wrong way?

sb11:01:18

I tried via maven add [jep/jep "2.24"] too, but nothing happens

joe04112:01:29

Hi all, I'm receiving a strange error. I'm hoping someone here could provide some advice: > Unable to resolve symbol: vec__11682 in this context There's no mention of vec in the function; however the error is reported on a line that starts a clojure.core.async/go-loop. I'm thinking there might be something going wrong in the macro processing?

joe04112:01:20

Unfortunately, seems like I'm running into this issue when trying to macroexpand the go-loop: https://dev.clojure.org/jira/browse/CLJ-2011

bronsa13:01:05

@joe041 are you using macroexpand-all?

joe04113:01:07

I've tried that and macroexpand-1. This seems to be the smallest code sample that reproduces it:

(defn f []
  (go-loop [[command channel] nil]
    (recur (alts! [channel]))))

joe04113:01:51

but this compiles:

(defn f []
 (go-loop [[command channel] [nil nil]
   (recur (alts! [channel]))))

bronsa13:01:26

no i mean, how are you getting that exception?

joe04113:01:51

if I evaluate that function I get it

bronsa13:01:14

looks like a bug

bronsa13:01:43

can you open a ticket? I can take a look at it later this evening

joe04113:01:48

cool, thanks for another set of eyes

joe04113:01:02

will do. under clojure.core.async?

teikfaiv14:01:20

Hi, is there somebody who would like to mentor me learning clojure? Give me some suggestions, review the code I write maybe.

teikfaiv15:01:34

Mainly I want to make sure I'm writing idiomatic code

charles.fourdrignier15:01:41

@teikfaiv I'm a beginner too. One way to learn is to write some training code (Advent of Code, katas, ...) and compare with experts' solutions.

seancorfield19:01:51

@teikfaiv We have a #code-reviews channel that might help.

kara21:01:01

Is there any type of "guided" getting started course or track for learning clojure/clojurescript? I done a few scattered tutorials and walk through, but I find once I've completed something I'm not sure where to go next. Would going through something like Clojure for the Brave and True be a good way to start? or some other video guide?

kara21:01:48

Sorry if this has been asked ad nauseam. 😐

seancorfield21:01:22

@kara I think Brave and True is a solid recommendation. Carin Meier's Living Clojure is also said to be very good.

scot-brown21:01:55

@kara Clojure for the brave and true is a great comprehensive resource and certainly could be worth working through, but don't feel like you have to go start-to-end. If there are specific aspects of clojure, or specific things you'd like to implement with it I'm sure that many people here can give some great recommendations on where to look! πŸ™‚

kara21:01:29

Thanks. πŸ™‚ Yes, I have a background in JavaScript so I tried to get started jumping in with ClojureScript... but the syntax is still kind of making it feel like I'm reading foreign language... I think getting some fundamentals down would be helpful... then hopefully I can start ramping up as my past JS knowledge kicks in

kara21:01:37

I was particularly interested in the patterns from Re-Frame/Reagent vs. trying to cobble together a React + ?? stack in JavaScript.

kara21:01:47

but it was a bit much to start with πŸ™ƒ

seancorfield21:01:26

Yeah, Clojure's web story is non-trivial and ClojureScript even more so.

josmith201621:01:20

Hi guys, I am having issues using the clojure.java.jdbc library to connect to a database. I have a gradle java project with some clojure code up and running. I have the library in my build.gradle and its pulling the dependency, but when I put the library in the require statement in my clojure namespace like this: (:require [clojure.java.jdbc :as jdbc] [clojure.string :as str]) I get this error: Caused by: java.lang.RuntimeException: Unable to resolve symbol: volatile! in this context

seancorfield21:01:25

@josmith2016 What version of Clojure are you trying to use?

josmith201622:01:17

clojure 1.6.0

seancorfield22:01:41

You need at least 1.7.0 for clojure.java.jdbc.

seancorfield22:01:11

Any reason for using such an ancient version of Clojure? 1.9.0 is the current version.

josmith201622:01:13

I'm new to clojure and just adding it to an existing java project, i assumed that was the latest version.

seancorfield22:01:51

Pretty much everyone is on Clojure 1.8 or 1.9 now. I think a year ago there was still a sizable percentage on 1.7 but even then only about 5% were on early versions. Lots of stuff has changed / been added since 1.6: https://github.com/clojure/clojure/blob/master/changes.md

seancorfield22:01:31

And "Welcome to Clojure!" by the way.

seancorfield22:01:13

One thing to watch out for -- since it sounds like you ran across an example online that showed using Clojure 1.6 -- a lot of old tutorials and blog posts are still out there and refer to outdated versions of libraries so you may run into API changes etc. If you have any doubts about versions, feel free to ask here @josmith2016

seancorfield22:01:53

(in particular, anything that refers to clojure.contrib.* dates back to Clojure 1.2 and should be considered extremely outdated -- that monolithic "contrib" library was dropped for Clojure 1.3 and many old examples based on those old namespaces no longer work!)

seancorfield22:01:29

Most of those namespaces live on in new libraries (but with new namespaces and, often, different APIs).

lee.justin.m22:01:22

@kara I liked working through https://funcool.github.io/clojurescript-unraveled/ to get a grasp of the language. It is example heavy and you can crank through it top-to-bottom pretty quickly. If you want to get started on frontend work and you’re already familiar with react, this is just my opinion: skip the larger frameworks for now, because they add a lot of clojure magic and complexity. It is easier to get something going if you just manager your own state with vanilla clojurescript and use a react wrapper (I prefer rum because it is more β€œreact” like but reagent seems more popular)

kara22:01:34

Nice. πŸ™‚ Thanks for the advice I'll check that out.

gmercer06:01:10

@kara @teikfaiv @ https://www.youtube.com/channel/UCsgl7n_Zj35ODRZ_a_K5R-A/playlists the live coding and Quantum Tic Tac Toe playlists might be interesting

josmith201622:01:01

Thanks a lot @seancorfield!

seancorfield22:01:13

Also @josmith2016 I'm the maintainer for clojure.java.jdbc so I'm happy to answer any questions about it -- but probably best to ask those in the #sql channel since it's much lower traffic than #beginners (and that's better than cross-posting a question to multiple channels).

pablore22:01:06

I am new to Ring/Compojure and I dont know why it is loading my tests files, hence making my service fail because the ring profile cant find Midje.sweet

pablore22:01:54

And no, Im not requiring my tests files by mistake

seancorfield22:01:19

@pablore Perhaps you could share your project.clj file so we can check your paths and dependencies?

seancorfield22:01:59

(also, there's a #ring channel if we get too far in the weeds and this looks to be very specific to Ring or Ring tooling)