Fork me on GitHub
#beginners
<
2017-09-02
>
petterik00:09:19

@juanjo.lenero It was the same for me. Coming from Java I did something similar. Now I'm used to something more similar to [most-specific -> most-general]. I rarely use declare myself nor see it in open source projects

juanjo.lenero00:09:33

Yep, seems better to just change that habit now, thanks

bfabry00:09:38

@juanjo.lenero I would recommend changing the habit, because the nice thing about clojure requiring forward declarations means that the namespace will be ordered specific->general automatically, rather than you having to remember it

johnj00:09:21

I would prefer main functions at the top than viceversa but its not really a issue.

johnj00:09:47

You just have to start reading bottom-up 🙂

bfabry00:09:03

yeah understood, I used to prefer the same and if I was choosing between two I'd probably choose top to bottom. but I'll take bottom to top enforced over top to bottom unenforced

javazquez01:09:39

Is there a macro thread for map values? I have a function (encode {:k1 2 :j _}) that results in a value that I want to thread into two other encode functions who's k1 is know

juanjo.lenero03:09:45

@bfabry but I'll take bottom to top enforced over top to bottom unenforced completely agree

grounded_sage13:09:57

Exercism or 4Clojure or Codewars or Hackerrank?

curlyfry14:09:52

4Clojure sorted by difficulty is very nice.

sb14:09:36

Gameincode is good too. Many levels.

yogidevbear14:09:34

I would say it depends on your end goal. I like hackerrank, but it seems more focused on finding solutions to problems that may require thinking in algorithms for example, whereas some of the other options are more about learning the Clojure language itself (e.g. 4clojure)... although I might be mistaken simple_smile

gonewest81800:09:22

ProjectEuler is another one, more on the algorithm side and plenty challenging... some of the upper problems have stumped my engineering dept.

grounded_sage01:09:22

I think Exercism + Other Clojure specific ones + Hackrank seems the way to go.

hmaurer14:09:48

Is there a consensus on which tool is “better” between Lein and Boot? Or do they both have their strengths and weaknesses ?

donyorm14:09:14

I think they both have strengths and weakness

donyorm14:09:19

I believe the gernalization is that lein does everything "for you", which is easier to setup but results in more rigidity. Boot if very flexible but a little more involved, though far from difficult to use. I personally prefer boot.

pj15:09:13

Quick question, why is it necessary in the definition of 'comp' to handle 4 different arities (parameters) when presented with 2 functions to compose?

pj15:09:29

specifically this part

pj15:09:36

(fn 
       ([] (f (g)))
       ([x] (f (g x)))
       ([x y] (f (g x y)))
       ([x y z] (f (g x y z)))
       ([x y z & args] (f (apply g x y z args)))))

pj16:09:02

instead of having [x] then [x y] then [x y z] and then the one with the rest and the apply

pj16:09:27

couldn't i have just been the handler of no parameters and then the rest and apply one?

pj16:09:40

or is this just for clarity so that when someone reads the source code of a method, they know what's going on?

akiroz16:09:30

@piegie pretty sure it was done for performance reasons

pj16:09:20

ahhh I see

pj16:09:41

apply makes it slower so they just added the most frequent cases as arities

akiroz16:09:43

technically it will work with only the [& args] case since the args can be empty

pj16:09:54

mhm makes sense, thanks!

vinai20:09:26

Got it - the issue was caused that a :dev profile in a profile.clj was overriding the one in project.clj - they are NOT merged. https://github.com/weavejester/environ/issues/15#issuecomment-54002457