Fork me on GitHub

• Can I make some setting so print pretty prints for the rest of the repl session? ---

  (for [name ["hurr"]]
    (println name)))
why does this not return "hurr" as string? I figured out it's because for makes a lazy seq but I'm not sure what a good alternative is, then. I can call seq and it works


The equivalent of for in c style languages is doseq. However, your writing code that is joining a list of strings together and returning a single string. So you could use clojure.string/join. Other things to think about is that for is equivalent to map and (apply str ["foo" "bar"]) will return "foobar". println is a side-effecting function that prints something on standard out and returns nil ... When learning Clojure, it helps to get into the mindset of using a REPL (preferably from within your editor) to call functions that return values with no side effects as much as possible, and push all the side effects to the edges of your program.


I see thanks. So str/join is the way here

👍 1
Tobias Sjögren08:09:41

Hi, from what I heard there should be Datomic channel here, can’t find it though..


There is at least one channel called #datomic

🙌 1

Is there an equilavent to when-some that also checks for empty? ? Or is it a bad sign to want such a thing?


(when-some (seq ...) ...)