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