Last active
March 9, 2017 15:32
-
-
Save yogidevbear/4b386f10c63ba008d3f7b49524262cf0 to your computer and use it in GitHub Desktop.
What is the best way to return a formatted data structure (like option_1.txt or option_2.txt) from the initial flat data structure (initial_flat_structure.txt) using Clojure?
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
(def initial_data [ | |
{ :entry "E1", :judge "J1", :comment "E1J1C1" }, | |
{ :entry "E1", :judge "J2", :comment "E1J2C1" }, | |
{ :entry "E1", :judge "J1", :comment "E1J1C2" }, | |
{ :entry "E2", :judge "J1", :comment "" }, | |
{ :entry "E2", :judge "J2", :comment "" }, | |
{ :entry "E3", :judge "J1", :comment "E3J1C1" }, | |
{ :entry "E3", :judge "J1", :comment "E3J1C2" }, | |
{ :entry "E3", :judge "J2", :comment "" } | |
]) |
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
[ | |
{ "entry":"Entry 1", "judge":"John", "comment":"Entry 1 Comment 1 John" }, | |
{ "entry":"Entry 1", "judge":"Alison", "comment":"Entry 1 Comment 1 Alison" }, | |
{ "entry":"Entry 1", "judge":"John", "comment":"Entry 1 Comment 2 John" }, | |
{ "entry":"Entry 2", "judge":"John", "comment":"" }, | |
{ "entry":"Entry 2", "judge":"Alison", "comment":"" }, | |
{ "entry":"Entry 3", "judge":"John", "comment":"Entry 3 Comment 1 John" }, | |
{ "entry":"Entry 3", "judge":"John", "comment":"Entry 3 Comment 2 John" }, | |
{ "entry":"Entry 3", "judge":"Alison", "comment":"" } | |
] |
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
[ | |
{ | |
"entry":"Entry 1", | |
"judge":"John", | |
"comments":[ | |
"Entry 1 Comment 1 John", | |
"Entry 1 Comment 2 John" | |
] | |
}, | |
{ | |
"entry":"Entry 1", | |
"judge":"Alison", | |
"comments":[ | |
"Entry 1 Comment 1 Alison" | |
] | |
}, | |
{ | |
"entry":"Entry 2", | |
"judge":"John", | |
"comments":[] | |
}, | |
{ | |
"entry":"Entry 2", | |
"judge":"Alison", | |
"comments":[] | |
}, | |
{ | |
"entry":"Entry 3", | |
"judge":"John", | |
"comments":[ | |
"Entry 3 Comment 1 John", | |
"Entry 3 Comment 2 John" | |
] | |
}, | |
{ | |
"entry":"Entry 3", | |
"judge":"Alison", | |
"comments":[] | |
} | |
] |
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
[ | |
{ | |
"entry":"Entry 1", | |
"judges":[ | |
"John":{ | |
"comments":[ | |
"Entry 1 Comment 1 John", | |
"Entry 1 Comment 2 John" | |
] | |
}, | |
"Alison":{ | |
"comments":[ | |
"Entry 1 Comment 1 Alison" | |
] | |
} | |
] | |
}, | |
{ | |
"entry":"Entry 2", | |
"judges":[ | |
"John":{ | |
"comments":[] | |
}, | |
"Alison":{ | |
"comments":[] | |
} | |
] | |
}, | |
{ | |
"entry":"Entry 3", | |
"judges":[ | |
"John":{ | |
"comments":[ | |
"Entry 3 Comment 1 John", | |
"Entry 3 Comment 2 John" | |
] | |
}, | |
"Alison":{ | |
"comments":[] | |
} | |
] | |
} | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment