About This

If all goes well, this will become a little online Clojure tutorial for the Facebook Clojure Community.

If it doesn't go well, blame me - my name is Carl Smotricz and I'm the only (so far) author.

I'm no Clojure guru. I'm an enthusiast looking to share my enthusiasm with others. Comments, suggestions, criticism, contributions are welcome.

3. Adding Your Contribution

Math functions on integers are fun and easy. So to warm up,

First assignment

Write an expression to calculate the sum of (i.e. add) 3 and 4 !
 Hints:


  • Here, from the Cheat Sheet, are Clojure's arithmetic functions:


  • The way to run functions in Clojure is to throw the functions into parentheses along with their blank-separated arguments, if any.

Extra credit


Compute the sum of 3, 4, 5 and 6 !

Hint:
  • The addition function doesn't care how many arguments you give it.

No comments:

Post a Comment