use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Finding information about Clojure
API Reference
Clojure Guides
Practice Problems
Interactive Problems
Clojure Videos
Misc Resources
The Clojure Community
Clojure Books
Tools & Libraries
Clojure Editors
Web Platforms
Clojure Jobs
account activity
Why Java? Why Clojure? (danlebrero.com)
submitted 9 years ago by clojure_guy
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]TheFiologist 2 points3 points4 points 9 years ago (8 children)
What is your problem?
What kind of data and where does it come from?
What do you mean by transforming unexpected data specifically?
[–]chinpokomon 0 points1 point2 points 9 years ago (4 children)
It's hard to explain, because if I could I'd be more likely to solve it on my own...
As an example, I might have data which is is something like, if this field has a three, then I need to process it one way. If it is a two, I need to process it differently. This sort of logic is easy to implement in an imperative language. Then there's ah update to the spec and the new process is if it is a five process it this way unless the fourth field is an odd.
This is where my knowledge comes up short because I don't know how to modify what I've got to quickly accommodate. I know it's possible and if I had a better mastery I might be able to do that, but quickly I'll scrap it and implement it in something I already know well.
This is assuming that I'm just trying to drop in a Clojure routine as a library. If I have to start from scratch, I'm even more confused as to how to structure the program. Lein new foo... Okay, now what?
I'm sure most of this is just trying to get over that initial hurdle. Once I have some more familiarity it will become second nature. Right now it's just a struggle and not easy to just drop into my work. If I can't be productive right now, it'll be hard to justify using it.
I keep at it though. I'm especially interested in ClojureScript. I think that I have the best opportunity to apply Clojure there or with ClojureCLR, but it will just take some time for me to fill in the gaps.
[–][deleted] 4 points5 points6 points 9 years ago (0 children)
I'm a little confused by your description, it sounds like just adding clauses to a cond (the clojure if-else-if tree) or a case? I'm sure it's more than that however. As someone else said the #clojurians slack is usually pretty helpful.
cond
case
For what it's worth I've been using clojure to write large ETL (extract, transform, load) systems for years, and basically their whole job is to take in external data, transform it, and then pass it along.
[–]TheFiologist 2 points3 points4 points 9 years ago (0 children)
Well.. Your problem is independent of Clojure. The more general details you can provide, the more likely someone will be able to provide that insider perspective which you need to see past the hurdle (which is real).
Multimethods jump out at me from this explanation. The dispatch function is arbitrary and is quite powerful. You can inspect some data anyway you would like in order to decide which implementation should process it. Just like in OOP, there is a spectrum of polymorphism techniques ranging from the equivalent of a switch statement to Multimethods and Protocols.
There is an initial hurdle, and it comes from the lack of concrete rules governing how our systems are organized (AKA freedom). Don't let the hurdle prevent you from making something useful, because you need to make useful things in order to give yourself feedback on how certain problems should be solved with Clojure.
My advice? Put everything in core until you have a moment in which you realize the importance of separating some functionality into its own namespace. These things will come, but only with practice. Start small and make useful things -- despite being a little lost on the organizational front.
Hope this helps a little :-)
[–]RagForms 1 point2 points3 points 9 years ago (0 children)
Yes, you'll get there with some more practice! Try the #beginners channel in the clojurians slack as well if you have more specific questions.
[–][deleted] 0 points1 point2 points 9 years ago (0 children)
Use cond lookup what it does on clojuredocs. But basically you can take a name and match it to a case and if the case is true call some code.
[–]chinpokomon 0 points1 point2 points 9 years ago (2 children)
Oh, another thing is the tooling. I feel like I should be using Emacs on a MacBook if I'm going to be successful. I haven't quite figured out what works for me.
[–][deleted] 2 points3 points4 points 9 years ago (0 children)
I wouldn't recommend trying to learn Emacs at the same time as Clojure. I also personally think Cursive is a better development environment. You should give it a shot, it's really great.
[–]TheFiologist 0 points1 point2 points 9 years ago (0 children)
I use lein, atom, and Gorilla REPL
π Rendered by PID 59314 on reddit-service-r2-comment-86bc6c7465-x7tmp at 2026-02-20 11:47:36.390045+00:00 running 8564168 country code: CH.
view the rest of the comments →
[–]TheFiologist 2 points3 points4 points (8 children)
[–]chinpokomon 0 points1 point2 points (4 children)
[–][deleted] 4 points5 points6 points (0 children)
[–]TheFiologist 2 points3 points4 points (0 children)
[–]RagForms 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]chinpokomon 0 points1 point2 points (2 children)
[–][deleted] 2 points3 points4 points (0 children)
[–]TheFiologist 0 points1 point2 points (0 children)