Hello everyone! Nice to be here
I made a simple app with Clojure, and i want some feedback about the code, if i could have done something better, or designed better according to the 'clojure way', any feedback is appreciated! https://github.com/cybersapiens97/fastmusictube
(dorun (map f coll))
can be replaced with (run! f coll)
https://github.com/cybersapiens97/fastmusictube/blob/master/src/fastmusictube/core.clj#L56
oh, that doesn't work with two collections though
yeah, my main function is one that i'm sure i could refactor it, because it's a little messy to be honest
but looking deeper, both collections are derived from separate line-seqs on the same file, you could consider one line-seq getting a series of name/resource tuples
but because there is a lot of side effects such as printing to the console, i found it to be hard to abstract it easily
also, fn / defn have an implicit do, so (defn -main [...] (do ...))
can just be (defn -main [...] ...)
Oh, i have just remembered, i was using a map with two seq's to show the user the actual music it was downloading but then i dropped this choice, i can refactor with dorun certainly
hmm i thought i should explicitly write do's to warn about side effects...
if you want to retain that, a transform that takes [a b c] and returns [[a (f a)] [b (f b}] [c (f c}]] is common, the core function juxt
is designed for this sort of usage
to me -main is implicitly side-effecting, as is any function or let body with more than one form
gotcha