beginners

Getting started with Clojure/ClojureScript? Welcome! Also try: https://ask.clojure.org. Check out resources at https://gist.github.com/yogthos/be323be0361c589570a6da4ccc85f58f.
Jim Newton 2020-10-03T06:43:50.157600Z

i received the https://www.amazon.fr/Functional-Programming-Patterns-Scala-Clojure-ebook/dp/B00HUEG8KK/ref=sr_1_2?__mk_fr_FR=ÅMÅŽÕÑ&dchild=1&keywords=functional+programming+patterns&qid=1601707215&sr=8-2 Functional Programming Patterns in Scala and Clojure book form amazon recently. Has anyone read it? I must say, i was immediately disappointed, but perhaps I'll give it another shot??? The idea of the book is to implement a complicated program in Java, and then rewrite it in Scala and Clojure. Me, I don't know java, and really hoped to avoid having to learn it. I was more hoping for a book which compares Scala and Clojure, not which compares them both to Java. 😞

Faris 2020-10-03T08:23:17.158200Z

Can anyone suggest a good open source Clojure repo for a beginner to dig into?

practicalli-john 2020-10-03T09:03:02.163700Z

@hewrin When just beginning with the language, I recommend some coding challenges https://practicalli.github.io/clojure/coding-challenges/ The 4Clojure challenges give excellent insight into the Clojure core functions. Once you have tried the 4Clojure challenges, I shared a GitHub repo that cover several different approaches to the solutions https://github.com/practicalli/four-clojure/ There are some very simpe project with code and video walk-throughs here https://practicalli.github.io/clojure/simple-projects/ If you are interested in building server side web applications, I am doing a series called Banking on Clojure https://practicalli.github.io/clojure-webapps/projects/banking-on-clojure/

Faris 2020-10-03T10:42:40.165400Z

Thanks a lot @jr0cket! I’m currently going through Programming Clojure. Coming from Ruby/JS, I’m still getting the hang of the (minimal) syntax

practicalli-john 2020-10-03T12:09:44.167100Z

@hewrin Please ask lots of questions, we are here with friendly help and suggestions As you have JavaScript experience, you may want to look at https://shadow-cljs.github.io/docs/UsersGuide.html

👍 1
borkdude 2020-10-03T14:42:58.168200Z

@hewrin I think writing scripts might also be a nice way of getting to know Clojure, while also doing something useful

👍 1
Faris 2020-10-03T15:01:19.169200Z

Noted @jr0cket and @borkdude, Thanks for the advice!

Eric Riese 2020-10-03T18:00:00.173300Z

Question about structural editing in Cursive. How do I get from

(defn word-lengths
  "Calculates the sequence of lengths of words in the given string"
  [txt]
  (map #(.length %) (split-ws txt)))
to
(defn word-lengths
  "Calculates the sequence of lengths of words in the given string"
  [txt]
  (map #(mod (.length %) 10) (split-ws txt)))
?

practicalli-john 2020-10-03T18:12:06.173400Z

I don't know the keys or commands, but I would do a wrap with before the (length %) part of the expression, then type mod and jump to the closing paren and type 10

practicalli-john 2020-10-03T18:13:48.173600Z

The cursive docs seem a bit vague on this. This video suggests Ctrl+Shift+9 to wrap https://www.youtube.com/watch?v=18WtDzYHKCI

Eric Riese 2020-10-03T18:17:29.174400Z

Thanks. I had originally gotten the parens wrong for what I thought I wanted, so that jammed me up I think. I'll check out that video.

Eric Riese 2020-10-03T18:19:54.174600Z

I think I want to wrap .length in parens and the slurp in the %

Panagiotis Mamatsis 2020-10-03T19:49:13.176400Z

Hi everyone. I wanted to ask. How can Clojure been upgraded? I have used the Clojure installation script for Linux.

2020-10-03T20:00:52.177200Z

If you mean "How can I upgrade the version of the Clojure CLI tools", then you can download and run the latest version of the Clojure install script from https://clojure.org/guides/getting_started#_installation_on_linux

2020-10-03T20:01:32.178300Z

If you mean "How can I select which version of the Clojure language implementation I want to use in my project?", then you can do so by specifying it in your deps.edn file (if you use the Clojure CLI tools) or project.clj (if you use Leiningen)

Panagiotis Mamatsis 2020-10-03T20:12:46.181400Z

Thank you so much @andy.fingerhut. I am starting with Clojure and I want to know the upgrade strategy that is popular for Clojurians! I also saw that Leiningen tool is a "must"!

dpsutton 2020-10-03T20:14:24.183600Z

What version are you on currently?

2020-10-03T20:14:44.184300Z

Leiningenn is definitely useful for following instructions to build and test existing Clojure projects that use them, but you can get by without it for your projects if you wish to use the Clojure Cli tools instead for those.

Panagiotis Mamatsis 2020-10-03T20:17:06.184800Z

@dpsutton I am using 1.10

dpsutton 2020-10-03T20:18:40.187200Z

The most recent release is 1.10.1. Most likely if you just switch that that in whatever project file you specified your current version it will be the same or perhaps much faster on startup. The people that work on clojure take breaking behavior quite seriously and hardly ever make breaking changes

Panagiotis Mamatsis 2020-10-03T20:25:21.188800Z

@dpsutton meaning that I need to just put the appropriate version into my project file as @andy.fingerhut wrote earlier?

dpsutton 2020-10-03T20:27:35.192500Z

Yes he asked some clarifying questions. I asked what version you are currently on as that would also answer what he was getting at. The “upgrade advice” I can give you is to just put the most recent version of clojure in your deps.edn or project.clj file and you will be fine

Panagiotis Mamatsis 2020-10-03T20:28:14.193200Z

I am really glad for all the guidance! It's my first touch of this language! Up to now I am really glad of starting to learn it!

practicalli-john 2020-10-03T20:33:42.193300Z

You may find this online book helpful https://practicalli.github.io/clojure/

seancorfield 2020-10-03T21:52:38.193500Z

I haven't used Leiningen for years but it is still popular and used in a lot of tutorials and books. I have been using the Clojure CLI since 2018 -- which is officially supported by the core Clojure team -- and it is what is documented on http://clojure.org

seancorfield 2020-10-03T21:53:22.193700Z

At work, we handle all our dev/test/build stuff with the Clojure CLI. We stopped using Leiningen in 2015 (switched to Boot, the the Clojure CLI).