This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-05-30
Channels
- # admin-announcements (4)
- # alda (49)
- # beginners (42)
- # boot (55)
- # cider (33)
- # cljs-dev (4)
- # cljsjs (3)
- # cljsrn (152)
- # clojure (92)
- # clojure-belgium (3)
- # clojure-brasil (18)
- # clojure-dusseldorf (32)
- # clojure-france (2)
- # clojure-greece (10)
- # clojure-japan (1)
- # clojure-mexico (1)
- # clojure-russia (50)
- # clojure-sg (1)
- # clojure-spain (1)
- # clojure-spec (12)
- # clojurescript (262)
- # core-async (2)
- # cursive (7)
- # datomic (79)
- # emacs (16)
- # euroclojure (2)
- # events (1)
- # hoplon (260)
- # jobs (2)
- # jobs-discuss (1)
- # keechma (7)
- # luminus (8)
- # mount (7)
- # off-topic (3)
- # om (101)
- # onyx (33)
- # re-frame (34)
- # reagent (10)
- # slack-help (4)
I've just refactored an experimental/exploration project and have ran into a circular dependency issue. Having spent sometime in google and reading steve yegge's rant 5 years ago, it seems the two options that will stick is "put everything in one file" which I find unacceptable or "refactor." I saw Shaun's solution here: https://github.com/shaunlebron/cljs-circular-dependency but I'm not really feeling it. Since modeling my current problem fits most naturally with a circular dependencies with my previous experience in breaking down applications, I'm wondering what resources exist that provide alternatives to thinking about how to break apart an application to avoid these issues completely.
@naomarik: I am not sure what else to add, but, generally circular dependencies are considered to be a code smell, showing bad design / architecture. From my own experience I only hit this once (once when I can remember) and was able to solve it by splitting things into more granular namespaces. What helped me in that case, was to visualize the dependency graph, not sure if you did that already?
sequence and collection mean the same thing in clojure, right? They all refer to composite types?
seqs can be callable collections is a more broader concept
i think?
Perhaps other languages have let me lazily couple things together without effort, but finally came to a structure I like.
oh I mistook for arrays
"you may have heard of Clojure’s sequence abstraction—all the persistent collections use it"
persistent specifically refers to the fact that when you "update" a data structure, the old value is still accessible, i.e. "persists"
several collection types are not sequences, but you can get a sequence backed by that collection with (seq coll)
"A sequential collection is one that holds a series of values without reordering them"
many functions will call (seq ...)
internally on their argument, so you don't need to call seq
yourself that often
the most common reason you would use it yourself is to check if a collection is empty, because (seq [])
returns nil
yeah it's a common idiom, can be confusing the first time you see it, but that's how clojure people do it
I’m just wrapping my head around programming to abstractions. The fact that
conj
is reversed for vectors and lists really bothered me for awhilebut the abstractions thing is really nice, like the way that vectors, maps and sets are all associative
weyj4: The way I remembered that was by remembering vectors are like arrays so adding to the end of the vector is cheaper while lists are linked lists so adding to the front of the list is cheaper. Once you remember that it won't be so confusing 🙂