mirror of
https://github.com/carp-lang/Carp.git
synced 2024-09-11 05:25:28 +03:00
31 lines
795 B
Plaintext
31 lines
795 B
Plaintext
(Project.no-echo)
|
|
|
|
(defn simple []
|
|
(let [ages1 {@"Alice" 31
|
|
@"Bob" 40
|
|
@"Charlie" 23
|
|
@"Dave" 56
|
|
@"Emily" 42}
|
|
ages2 (Map.put ages1 "Dave" &57)]
|
|
(do
|
|
(println* "Charlie is " (Map.get &ages2 "Charlie") " years old.")
|
|
(println* "Dave is " (Map.get &ages2 "Dave") " years old.")
|
|
(println* "Maria is " (Map.get &ages2 "Maria") " years old."))))
|
|
|
|
(defn start-with-empty []
|
|
(let [a {}
|
|
b (Map.put a "aha" &123)]
|
|
(println* (Map.get &b "aha"))))
|
|
|
|
(defn checking []
|
|
(let [char-map {\a @"Aha"
|
|
\b @"Boo"}]
|
|
(do
|
|
(println* (Map.contains? &char-map &\b))
|
|
(println* (Map.contains? &char-map &\c)))))
|
|
|
|
(defn main []
|
|
(do (simple)
|
|
(start-with-empty)
|
|
(checking)))
|