Sha256: 086b8648312da0b7c08ba8af927f817815cf05ed8b5b8a0fa074b19031b4cafd

Contents?: true

Size: 298 Bytes

Versions: 10

Compression:

Stored size: 298 Bytes

Contents

(defn myfunc []
  (println "Enter x and y")
  (let [x (read), y (read)]
    (doseq [op '(+ - * / Math/pow rem)]
      (let [exp (list op x y)]
	(printf "%s=%s\n" exp (eval exp))))))

user=> (myfunc)
Enter x and y
3
6
(+ 3 6)=9
(- 3 6)=-3
(* 3 6)=18
(/ 3 6)=1/2
(Math/pow 3 6)=729.0
(rem 3 6)=3
nil

Version data entries

10 entries across 7 versions & 1 rubygems

Version Path
zettacode-0.1.7 files.zettacode/arithmetic.integer/clojure.txt
zettacode-0.1.6 files.zettacode/arithmetic.integer/clojure.txt
zettacode-0.1.6 files.zettacode2/arithmetic.integer/clojure.txt
zettacode-0.1.5 files.zettacode/arithmetic.integer/clojure.txt
zettacode-0.1.5 files.zettacode2/arithmetic.integer/clojure.txt
zettacode-0.1.4 files.zettacode/arithmetic.integer/clojure.txt
zettacode-0.1.4 files.zettacode2/arithmetic.integer/clojure.txt
zettacode-0.1.3 files.zettacode/arithmetic.integer/clojure.txt
zettacode-0.1.2 files.zettacode/arithmetic.integer/clojure.txt
zettacode-0.1.1 zettacode.files/arithmetic.integer/clojure.txt