Re: Being "not Lisp" is a feature?

2010-11-09 Thread Brisance
"Easy transition from Java", and Java has a checkmark. -- 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 po

Re: Why does using a dynamic binding make a function impure?

2010-07-17 Thread Brisance
Interestingly, the results are different for me. ; SLIME 2010-05-01 user> (def *forty-two* 42) #'user/*forty-two* user> (defn impure-add42 [n] (+ n *forty-two*)) #'user/impure-add42 user> (impure-add42 1) 43 user> (binding [*forty-two* 23] (impure-add42 1)) 24 On Jul 18, 7:14 am, Moritz Ulrich w

Re: Clojure noob: refactoring factorial code

2010-07-16 Thread Brisance
Hello Mike, Thanks for taking time to respond. I replied to another post but somehow it didn't show up. Perhaps it is awaiting moderation. Anyway, perhaps I should explain the situation more clearly. In conventional imperative/procedural languages, as you pointed out, the algorithm used to calcu

Re: Clojure noob: refactoring factorial code

2010-07-16 Thread Brisance
Thanks for the response. To get an idea of what I mean, visit http://www.wolframalpha.com/''. Then enter something ridiculous (to me, at least) like 10! The answer is almost instantaneous. The question is: how would someone write idiomatic Clojure in such a way that it gives exact results f

Clojure noob: refactoring factorial code

2010-07-15 Thread Brisance
Here's a factorial function as found in the WikiBook "Learning Clojure" : (defn factorial [n] (defn fac [n acc] (if (zero? n) acc (recur (- n 1) (* acc n ; recursive call to fac, but reuses the stack; n will be (- n 1), and acc