clojure

Clojure vs Haskell for web applications?

I want to learn a functional language that will be good for building web applications in the future. I am choosing between Clojure and Haskell. Which one is a better choice for my purpose? ...

"Don't know how to create ISeq from: Symbol" error in Clojure

I have the following Clojure code and I'm not sure why it's not working: (defn match (x y &optional binds) (cond ((eql x y) (values binds t)) ((assoc x binds) (match (binding x binds) y binds)) ((assoc y binds) (match x (binding y binds) binds)) ((var? x) (values (cons (cons x y) binds) t)) ((var? y) (values (cons (cons...

Common Lisp's symbol-name in Clojure?

Is there anything in Clojure that is equivalent to Common Lisp's symbol-name function? ...

Clojure - Side Effects Happening Out Of Order

While dabbling in Clojure I've written a very basic program to echo whatever the user types into it. However, it doesn't run in a way that I'm perceiving to be natural. Here's the code: (defn goo [] (print "echo> ") (def resp (read-line)) (print resp) ) I would expect the code to run like this (for me typing in foo as the input ...

webjure vs compojure?

I've heard of two Clojure based web application frameworks: Webjure and Compojure. Can someone let me know which is better? ...

Is there a working real world project using Clojure that take advantage of multi-core system that I can take a look?

Is there a working real world project using Clojure that take advantage of multi-core system that I can take a look? I want to if Clojure is still in a toy-language phrase or it's really "happening soon". ...

What is your opinion on Clojure?

What do you guys think about Clojure? I'm thinking of learning it next, currently using Erlang and in general happy with it except the records fiasco... Is Clojure as powerful as LISP? thanks ...

Evaluation of part of Clojure cond

Trying to do exercise 1.16 (iterative version of fast-exp) in "Structure and Interpretation of Computer Programs" with Clojure I came up with this: (defn fast-it-exp [base exp res] (cond (= exp 0) res (odd? exp) fast-it-exp base (- exp 1) (* base res) :else fast-it-exp base (/ exp 2) (* base base res))) Trying it out: user=> (f...

Clojure IDE on Windows?

How do you develop in Clojure on Windows systems? ...

Distinctive traits of the functional languages

It is known that all functional languages share some basic properties like using functions as basic building block for programs with all the consequences like using recursion instead of iteration. However, some fundamental differences also exist. Lisp uses a single representation for both Lisp code and data, while ML has no standard repr...

Learning Clojure without Java Knowledge

Ok, so I'm psyched about another list. I got myself a copy of the beta Clojure programming book... And the one thing I'm noticing most is that it's assumed I know... like all the major java classes. Except, generally, I don't really care about Java. I just want enough knowledge of it for Clojure to be an option for me. Any suggestio...

Clojure read-line function problem

I'm trying to get console input in my Clojure program, but when it gives me this error when it gets to that part of the program. Exception in thread "main" java.lang.ClassCastException: clojure.lang.LineNumberingPushbackReader cannot be cast to java.io.BufferedReader the 'read' function works, but it's not what I need. Here is the cod...

Clojure 'if' never evaluating its third argument.

I've been trying to figure this one our for a while now. (defn is-decimal [astr] (if (. astr (indexOf (int \.))) (Double/parseDouble astr) (Integer/parseInt astr))) That is the function I wrote. is-decimal is either passed something like this "2.5" or "5" or something of the sort, but it always uses 'if's second argument never its thi...

The Clojure (or Lisp) Equivalent of a Compound Boolean Test

In C++ I'd write something like this: if (a == something && b == anotherthing) { foo(); } Am I correct in thinking the Clojure equivalent is something like this: (if (= a something) (if (= b anotherthing) (foo))) Or is there another way to perform a logical "and" that I've missed? As I said the latter form seems to ...

Lisp Code Formatting

One of the people who took the time to comment on my other question about Clojure/LISP syntax pointed out that I had not written my sample code in the standard LISP way. So he was kind enough to rewrite the code snippet and that's a big help. But it raised another question in my mind. Why would this: (if (= a something) (if (= b ot...

Clojure Structure Nested Within Another Structure

Is it possible to have a structure nested within a structure in Clojure? Consider the following code: (defstruct rect :height :width) (defstruct color-rect :color (struct rect)) (defn #^{:doc "Echoes the details of the rect passed to it"} echo-rect [r] (println (:color r)) (println (:height r)) (println (:width r))) (def first...

Which Lisp should I learn?

To piggyback on http://stackoverflow.com/questions/59428/learning-lisp-scheme-interpreter, O gods of StackOverflow: Which Lisp (dialect) should I learn, and why? The fragmentation between CL and Scheme slows uptake (at least for me!). So give me the True Answer, please. I have tried to read feature comparisons, and they seem to get...

Can you mix the JVM languages? ie: Groovy & Clojure

I understand that you can easily mix groovy&java, clojure&java, whateverJvmLang&java. Does this also mean I can have clojure and groovy code interact as well? If I use Grails or jRoR, can I also make use of clojure in that environment? ...

Porting Common Lisp code to Clojure

How practical is it to port a Common Lisp application to Clojure? To be more specific, what features exist in Common Lisp that do not exist in Clojure, and would have to be re-written? ...

Which tutorial on Clojure is best?

I'm interested in learning Clojure. The Getting Started page on Clojure.net is pretty minimal. Is there a good language introduction or tutorial out there? Which would you recommend? Answer: I have watched the videos on youtube called Intro to Clojure. I don't recommend those. They are a little too brief and don't give a lot of back...