Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Execute Clojure Online

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

(defn hello-world [username]
(println (format "Hello, %s" username)))
(defn dziel-przez-zero [] (println (/ 1 0.0)))

(hello-world "world")
(dziel-przez-zero)
(println *e)

; nowy zbiór
(def visitors-old (atom #{}))
(swap! visitors-old conj "Janku")
(println (deref visitors-old))

(def visitors (atom #{}))
(defn hello 
    "Wywietla powitanie na wyjciu, uzywajac nazwy uzytkownika.
    Potrafi stwierdzi, e korzysta juz z programu."
    [username]
    (swap! visitors conj username)
    (println (str "Witaj, " username))
)

(hello "Marku")
(hello "Pawle")
(hello "Jurny")

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.