open:if-do

if/do

if(condition) (
   statement #1
   statement #1.1
)

(
   statement #2
   statement #2.1
)

(ns clojure.examples.hello
   (:gen-class))

;; This program displays Hello World
(defn Example [] (
   if (= 2 2)
      (do(println "Both the values are equal")
         (println "true"))
      (do(println "Both the values are not equal")
         (println "false"))))
(Example)

Output

Both the values are equal
true

  • open/if-do.txt
  • 마지막으로 수정됨: 2021/11/22 23:38
  • 저자 127.0.0.1