This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-09-15
Channels
- # admin-announcements (7)
- # alda (6)
- # beginners (34)
- # boot (23)
- # cljs-dev (3)
- # clojure (73)
- # clojure-italy (4)
- # clojure-japan (6)
- # clojure-nlp (1)
- # clojure-russia (104)
- # clojure-sg (2)
- # clojurescript (222)
- # clojurex (7)
- # cursive (41)
- # datascript (2)
- # datomic (56)
- # docs (1)
- # editors (6)
- # emacs (3)
- # events (8)
- # hoplon (139)
- # jobs (2)
- # ldnclj (24)
- # luminus (2)
- # off-topic (3)
- # om (12)
- # onyx (24)
- # re-frame (5)
- # remote-jobs (1)
- # yada (1)
As long as it's just data you're splitting you could read chunks from separate files into one namespace.
I have to write a good 10-25 tests for this function, so the cond
error-occured
approach is an attempt to have a more compact way of checking for all of the errors
does that approach let me do some fancy let
stuff before my :pre
and then access those in my :pre
?
Also: Your code is very imperative style. Try to make it more functional. Eg: Get ride of negatives
and error-occured
.
I also wouldn't constrict this function to not allow only positive values. You're making that function less useful then. If you don't allow negative values then split it up into two functions. One doing only the parsing returning the sequence of numbers and then your application code checking for negative numbers and calling reduce.
;;(deftest empty-string-test) ;;(deftest negative-number-test) ;;(deftest single-number-test) ;;(deftest multiple-number-test) ;;(deftest new-line-delimeter-test) ;;(deftest mixed-delimeter-test) ;;(deftest custom-delimeter-test) ;;(deftest multiple-negative-number-test) ;;(deftest numbers-larger-than-1000-test) ;;(deftest long-custom-delimeter-test) ;;(deftest multiple-custom-delimeter-test) ;;(deftest multiple-long-customer-delimeter-test) ;;(deftest can-use-numeric-delimiters)
I understood I could run lein repl
, then (ns unit-test-exercise.core)
, and then in my repl I could just freely call any function defined in my core file to test it out