Fork me on GitHub
#beginners
<
2020-10-03
>
Jim Newton06:10:50

i received the https://www.amazon.fr/Functional-Programming-Patterns-Scala-Clojure-ebook/dp/B00HUEG8KK/ref=sr_1_2?__mk_fr_FR=ÅMÅŽÕÑ&amp;dchild=1&amp;keywords=functional+programming+patterns&amp;qid=1601707215&amp;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. 😞

Faris08:10:17

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

practicalli09:10:02

@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/

Faris10:10:40

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

practicalli12:10:44

@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

borkdude14:10:58

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

Faris15:10:19

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

Eric Riese18:10:00

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)))
?

practicalli18:10:06

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

practicalli18:10:48

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 Riese18:10:29

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 Riese18:10:54

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

Panagiotis Mamatsis19:10:13

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

andy.fingerhut20:10:52

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

andy.fingerhut20:10:32

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 Mamatsis20:10:46

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"!

seancorfield21:10:38

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

seancorfield21:10:22

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).

dpsutton20:10:24

What version are you on currently?

andy.fingerhut20:10:44

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 Mamatsis20:10:06

@dpsutton I am using 1.10

dpsutton20:10:40

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 Mamatsis20:10:21

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

dpsutton20:10:35

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 Mamatsis20:10:14

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!

practicalli20:10:42

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