Re: Clojure beginner: IF statement error!

2016-03-06 Thread Bryan Maass
Welcome to Clojure Renata! Since you're familiar with lisp but not the Clojure idioms, you may want to take a scan through the clojure style guide . -- You received this message because you are subscribed to the

Re: Clojure beginner: IF statement error!

2016-03-05 Thread Mars0i
Just spelling out what the previous comments implied: You're giving 'if' five arguments: (= M 0) 1 "in case pow is 0 return 1" (do (* N (recur N (- M 1) "decrease power M each itr" 'if' needs at least two arguments, and is normally used with three. If you delete the strings, your code wi

Re: Clojure beginner: IF statement error!

2016-03-04 Thread Jason Felice
Comments start with a semicolon (;). On Fri, Mar 4, 2016 at 7:23 PM, Joseph Smith wrote: > Those strings are in the if form. > > --- > Joe R. Smith > j...@uwcreations.com > @solussd > > > On Mar 4, 2016, at 6:48 PM, Renata Akhm wrote: > > Hi! I've just strated coding on Clojure and tried to mov

Re: Clojure beginner: IF statement error!

2016-03-04 Thread Joseph Smith
Those strings are in the if form. --- Joe R. Smith j...@uwcreations.com @solussd > On Mar 4, 2016, at 6:48 PM, Renata Akhm wrote: > > Hi! I've just strated coding on Clojure and tried to move some of my Lisp > code to Clojure: > (defn mpow > [N M] > (if (= M 0) 1 "in case pow is

Clojure beginner: IF statement error!

2016-03-04 Thread Renata Akhm
Hi! I've just strated coding on Clojure and tried to move some of my Lisp code to Clojure: (defn mpow [N M] (if (= M 0) 1 "in case pow is 0 return 1" (do (* N (recur N (- M 1) "decrease power M each itr" ) So it just calculates power recursively. When I run it the "Too many arguments to if" e