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
(defn print-subtree [subtree prefix] | |
(if (empty? subtree) | |
"" | |
(apply str prefix (first subtree) "\n" | |
(map #(print-subtree %1 (str "\t" prefix)) (rest subtree))))) | |
(defn print-tree [tree] | |
(print-subtree tree "")) | |
(deftest print-empty-tree |
NewerOlder