Wednesday, July 20, 2016

Clojure (1) add two number

First time, I blog about Clojure.
IDE = Nightcode1.0.1

this code is from Clojure in action and I rewrited it.

With REPL I run.

Sum two values
hello.core=> (+ 1 2)

make function add two values
hello.core=> (defn my-add [op1 op2] (+ op1 op2))

use add function
hello.core=> (my-add 1 2)

use add function
hello.core=> (my-add 1000000000000000000 300000000000000000000)

No comments:

Post a Comment