Clojure Spec question with and/or composition

2018-05-28 Thread Philipp Neumann
Hi. I hope this is the right place for Spec questions. I try to composite different specs with and/or (I tried Google, but searching for and/or is useless :/): (s/def ::testa #{"a"}) (s/def ::testb #{"b"}) ;;;(sdef+ ::testaa {:a ::testa}) (do (clojure.spec.alpha/def :data$testaa/a :data/te

Re: Clojure Spec question with and/or composition

2018-05-29 Thread Philipp Neumann
Thanks a lot. Your solution is very appreciated. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To

Re: group rows on basis of value in a column in CSV with clojure

2018-07-03 Thread Philipp Neumann
Hi. This is a job for (group-by last ...) Regards Varun J.P schrieb am Di., 3. Juli 2018, 19:05: > My CSV file is something like the attached file which could have 'n' > number of line. I need to group by the values in the last column. > Current I believe the below code will return me a vector

Re: group rows on basis of value in a column in CSV with clojure

2018-07-08 Thread Philipp Neumann
is a > vector of vector but is throwing an error > >> "ClassCastException java.lang.String cannot be cast to clojure.lang.IFn >> clojure.core/group-by/fn--7011 >> (core.clj:6870)" > > > Can someone suggest a different approch > > > >

Re: OK idea to replace conj and cons with "prepend" and "append" macros that have consistent behavior and return same types as args?

2018-07-17 Thread Philipp Neumann
Macros aren't the right tool for that. If you want to create a function that behaves differently, depending on the input (Vector, seq or something else, like LinkedHashSet) you should look into multimethods. And if you want to do comprehensive data manipulation you should look into https://gith

Re: New developments in beginner-friendly editing/repl environments?

2018-08-30 Thread Philipp Neumann
I never understood how Python is so popular, where spacing is most important. Other than that, I really prefer parinfer over paredit, because I don't have to memorize all the key shortcuts to slurp, barf, split and slice. Using tab and shift tab to control parens is really intuitive, because I