forked from carp-lang/Carp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmaps.carp
More file actions
30 lines (26 loc) · 795 Bytes
/
Copy pathmaps.carp
File metadata and controls
30 lines (26 loc) · 795 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
(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)))