Clojure is a general-purpose language supporting interactive development that encourages a functional programming style, and simplifies multithreaded programming.
Questions tagged [clojure]
91 questions
47
votes
5 answers
What did Rich Hickey mean when he said, "All that specificity [of interfaces/classes/types] kills your reuse!"
In Rich Hickey's thought-provoking goto conference keynote "The Value of Values" at 29 minutes he's talking about the overhead of a language like Java and makes a statement like, "All those interfaces kill your reuse." What does he mean? Is that…
GlenPeterson
- 14,950
46
votes
6 answers
Why is "tight coupling between functions and data" bad?
I found this quote in "The Joy of Clojure" on p. 32, but someone said the same thing to me over dinner last week and I've heard it other places as well:
[A] downside to object-oriented programming is the tight
coupling between function and…
GlenPeterson
- 14,950
41
votes
3 answers
What's so great about Clojure?
I've been taking a look at Clojure lately and I stumbled upon this post on Stackoverflow that indicates some projects following best practices, and overall good Clojure code. I wanted to get my head around the language after reading some basic…
marco-fiset
- 8,791
38
votes
4 answers
What limitations does the JVM impose on tail-call optimization
Clojure does not perform tail call optimization on its own: when you have a tail recursive function and you want to have it optimized, you have to use the special form recur. Similarly, if you have two mutually recursive functions, you can optimize…
Andrea
- 5,425
37
votes
7 answers
C# Dev - I've tried Lisps, but I don't get it
After a few months of learning about and playing with Lisp, both CL and a bit of Clojure, I'm still not seeing a compelling reason to write anything in it instead of C#.
I would really like some compelling reasons, or for someone to point out that…
Jonathan Mitchem
37
votes
7 answers
What are the functional equivalents of imperative break statements and other loop checks?
Let's say, I've the below logic. How to write that in Functional Programming?
public int doSomeCalc(int[] array)
{
int answer = 0;
if(array!=null)
{
for(int e: array)
{
answer…
Vicky
- 399
- 3
- 6
32
votes
13 answers
Problems (such as maintenance) in development with unpopular language
I'm developing some application with clojure(lisp) alone in my team. It starts as small application. No problem. But as it's having features and extending the area, it's becoming important program.
I worried about maintenance or something. No one in…
Hybrid
- 413
30
votes
5 answers
Why does the Lisp community prefer to accumulate all the parentheses at the end of the function?
Why does the Lisp community prefer to accumulate all the parentheses at the end of the function:
(defn defer-expensive [cheap expensive]
(if-let [good-enough (force cheap)]
good-enough
(force expensive)))
Why not employ a convention like…
Chiron
- 4,553
27
votes
5 answers
In what programming language did "let" first appear?
I was wondering about the origins of the "let" used in Lisp, Clojure, and Haskell. Does anyone know which language it appeared in first?
carinmeier
- 465
27
votes
1 answer
Is shipping a Clojure desktop app realistic?
I'm currently shipping a desktop Java application. It is a plain old Java 5 Java / Swing app and so far everything worked nicely. Java 5 was targetted because some users were on OS X version / computers that shall never have Java 6 (we may lift this…
Cedric Martin
- 1,067
26
votes
3 answers
On the path to Enlightenment: Scheme, Common Lisp, Clojure?
A lot of people smarter than me keep writing about when you learn Lisp it makes you a better programmer because you "get it".
Maybe all I hear about Lisp(s) changing your life is just a big practical joke on the newbies, but I figure there's no harm…
Conrad.Dean
- 369
26
votes
3 answers
Why do some functional languages need software transactional memory?
Functional languages, by definition, should not maintain state variables. Why, then, do Haskell, Clojure, and others provide software transactional memory (STM) implementations? Is there a conflict between two approaches?
Michael Spector
- 363
- 2
- 5
25
votes
7 answers
"Use map instead of class to represent data" -Rich Hickey
In this video by Rich Hickey, the Clojure creator, he advises to use map to represent data instead of using a class to represent it, as done in Java. I don't understand how it can be better, since how can the API user know what the input keys are if…
Emil
- 359
22
votes
6 answers
Best practices in comment writing and documentation
Commenting nowadays is easier than ever. In Java, there are some nice techniques for linking comments to classes, and Java IDEs are good at making comment shells for you. Languages like Clojure even allow you to add a description of a function in…
jayunit100
- 379
21
votes
3 answers
Does Clojure have continuations/coroutines/etc?
I started programming with Python, and I was really confused by concepts like coroutines and closures.
Now I think I know them on some superficial level, but I've never felt that "enlightement" moment, so I choose to learn Clojure. I bought the book…
Novice
- 211