Skip to content

Commit 90407e7

Browse files
authored
0.0.1 release
1 parent 52844a7 commit 90407e7

File tree

1 file changed

+40
-2
lines changed

1 file changed

+40
-2
lines changed

README.md

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,46 @@
11
# Tiara
22
A small data structure library.
33

4-
deps.edn
4+
### deps.edn
55

66
Add the following dependency to the :deps map in deps.edn:
77

8-
io.github.quoll/tiara {:git/tag "v0.0.1" :git/sha ""}
8+
```clojure
9+
io.github.quoll/tiara {:git/tag "v0.0.1" :git/sha "52844a7"}
10+
```
11+
12+
## Usage
13+
At this point, Tiara only includes an ordered map. This has the same O(1) access characteristics as a hashmap, but maintains insertion order.
14+
15+
Ordered Maps behave the same as other maps, but are only created using the `ordered-map` function.
16+
17+
```clojure
18+
(require '[tiara.data :refer [ordered-map]])
19+
20+
(def m (ordered-map :a 1 :b 2 :c 3 :d 4 :e 5))
21+
(def h (hash-map :a 1 :b 2 :c 3 :d 4 :e 5))
22+
23+
(= h m) ;; returns true
24+
25+
(seq m) ;; => ([:a 1] [:b 2] [:c 3] [:d 4] [:e 5])
26+
27+
(assoc m :f 6) ;; => {:a 1, :b 2, :c 3, :d 4, :e 5, :f 6}
28+
;; but existing keys do not change location:
29+
(assoc m :c 7) ;; => {:a 1, :b 2, :c 7, :d 4, :e 5}
30+
;; to append, then remove first:
31+
(assoc (dissoc m :c) :c 7) ;; => {:a 1, :b 2, :d 4, :e 5, :c 7}
32+
```
33+
## TODO
34+
- Hashmaps
35+
- Remove the first underlying hashmap
36+
37+
## License
38+
39+
Copyright © 2023 Paula Gearon
40+
41+
_EPLv1.0 is just the default for projects generated by `deps-new`: you are not_
42+
_required to open source this project, nor are you required to use EPLv1.0!_
43+
_Feel free to remove or change the `LICENSE` file and remove or update this_
44+
_section of the `README.md` file!_
45+
46+
Distributed under the Eclipse Public License version 2.0.

0 commit comments

Comments
 (0)