Created
July 3, 2014 21:30
-
-
Save trikitrok/671e5b1498f19ed113e4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 school) | |
| (defn grade [school grade-num] | |
| (get school grade-num [])) | |
| (defn add [school name grade-num] | |
| (assoc | |
| school | |
| grade-num | |
| (conj (grade school grade-num) name))) | |
| (defn sorted [school] | |
| (into {} | |
| (map | |
| (fn [[grade students]] | |
| [grade (sort students)]) | |
| (sort-by key school)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment