https://github.com/rutledgepaulv/hierarchical
Clojure hierarchy semantics for associative data structures.
https://github.com/rutledgepaulv/hierarchical
clojure data-structure hierarchy
Last synced: about 1 year ago
JSON representation
Clojure hierarchy semantics for associative data structures.
- Host: GitHub
- URL: https://github.com/rutledgepaulv/hierarchical
- Owner: RutledgePaulV
- License: mit
- Created: 2017-06-11T00:11:12.000Z (about 9 years ago)
- Default Branch: develop
- Last Pushed: 2017-06-11T01:15:23.000Z (about 9 years ago)
- Last Synced: 2025-02-08T06:42:17.496Z (over 1 year ago)
- Topics: clojure, data-structure, hierarchy
- Language: Clojure
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# hierarchical
[](https://travis-ci.org/RutledgePaulV/hierarchical)
Hierarchical is a library providing views over associative data structures that utilize
Clojure's hierarchy semantics for membership tests rather than strict equality.
## Usage
```clojure
(ns example
(:require [hierarchical.core :as h]))
(derive ::pets ::animals)
(derive ::farm ::animals)
(derive ::cows ::farm)
(derive ::cats ::pets)
(derive ::dogs ::pets)
(def kingdom
{::animals {:eat "Grass"}
::pets {:eat "Pet Food"}
::cats {:eat "Fancy Feast"}})
(def hiera (h/hierarchical kingdom))
(::cats hiera)
; {:eat "Fancy Feast"}
(::dogs hiera)
; {:eat "Pet Food"}
(::cows hiera)
; {:eat "Grass"}
```
### License
This project is licensed under [MIT license](http://opensource.org/licenses/MIT).