Created
November 3, 2013 03:31
-
-
Save jebberjeb/7286347 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns test-app.core) | |
(def h (atom (make-hierarchy))) | |
(swap! h derive ::square ::shape) | |
(swap! h derive ::red-square ::square) | |
(def one (isa? @h ::red-square ::shape)) ;; => true | |
(swap! h underive ::red-square ::shape) | |
(def two (isa? @h ::red-square ::shape)) ;; => true (shape isn't parent of red-squares) | |
(swap! h underive ::red-square ::square) | |
(def three (isa? @h ::red-square ::shape)) ;; => false | |
[one two three] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment