code-reviews

mdallastella 2015-06-16T06:14:23.000287Z

@gmorpheme: I didn’t now about mapcat:simple_smile:

mdallastella 2015-06-16T06:20:10.000288Z

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

mdallastella 2015-06-16T06:21:07.000289Z

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

mdallastella 2015-06-16T06:23:17.000291Z

today I’m going to do some refactoring

slipset 2015-06-16T06:43:06.000292Z

Cool!

gmorpheme 2015-06-16T07:24:26.000293Z

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

gmorpheme 2015-06-16T07:26:29.000294Z

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.

gmorpheme 2015-06-16T07:27:28.000295Z

sorry I only had time for a superficial glance through

sveri 2015-06-16T07:31:09.000296Z

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

slipset 2015-06-16T07:39:52.000297Z

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

slipset 2015-06-16T07:40:19.000298Z

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

slipset 2015-06-16T07:40:48.000299Z

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

slipset 2015-06-16T07:41:09.000300Z

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

slipset 2015-06-16T07:41:48.000301Z

https://www.youtube.com/watch?v=GFQqyXoL0YQ

sveri 2015-06-16T07:46:37.000303Z

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

sveri 2015-06-16T07:47:03.000304Z

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

slipset 2015-06-16T07:48:09.000305Z

AFAIK, you can switch schema on and off.

slipset 2015-06-16T07:51:43.000309Z

asked and answered by @borkdude

sveri 2015-06-16T07:55:30.000310Z

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