Fork me on GitHub
#code-reviews
<
2015-06-16
>
mdallastella06:06:23

@gmorpheme: I didn’t now about mapcatsimple_smile

mdallastella06:06:10

@gmorpheme: anyway, you’re right coord-list is much more simple with a for loop

mdallastella06:06:07

(def files ["a" "b" "c" "d" "e" "f" "g" "h”])
(def coord-list
  (for [rank (range 8 0 -1) 
         file files]
    (keyword (str file rank))))

mdallastella06:06:17

today I’m going to do some refactoring

gmorpheme07:06:26

cool! I often find that I go first for something cunning with map, filter et al but for ends up giving a much neater simpler expression

gmorpheme07:06:29

similarly - I always worry if I end up reaching for flatten. More often than not it means I’ve lost track of the nesting going on and the rest of the expression is complicated enough that it’s blown my mental stack. Usually a signal that I’ve gone a bit too far down the wrong track.

gmorpheme07:06:28

sorry I only had time for a superficial glance through

sveri07:06:09

@gmorpheme: core.typed helps me with keeping the nested structures handeable

slipset07:06:52

sveri: Haven't used it myself, but it seems like prismatic schema is nice for this as well.

slipset07:06:19

Might be a bit less intrusive and can also be applied gradually.

slipset07:06:48

Jessica Kerrs talk on schema and gradual typing is worth its weight in gold.

slipset07:06:09

Which might not be much, I mean, how much does a youtube video actually weigh

sveri07:06:37

@slipset: I was tinkering between prismatic and core.typed a few times. What I like more about core.typed that it's a "compile time" check, not interfering with the runtime (not sure about prismatic though, I never really dived into it). However, I guess both do the job fine. Especially when coming back to a code base after a few days/weeks/months and you see the param "foo-m" which means it's a map with, yea, what is foo, ah, go back to that function, oh, there is a foo-m param too, goddamnit, what was that 😄

sveri07:06:03

btw. core.typed should get gradual typing too, IIRC

slipset07:06:09

AFAIK, you can switch schema on and off.

slipset07:06:43

asked and answered by @borkdude

sveri07:06:30

OTOH core.typed reminds me of haskell, having a bit of a geek factor 😄, but thanks, nice to know that simple_smile