Hi Jeremy,
There are a number of existing implementations of what you're describing,
the most well known of which is the Web Services Description Language
(WSDL)http://en.wikipedia.org/wiki/Web_Services_Description_Languagecommonly
used with
SOAP http://en.wikipedia.org/wiki/SOAP. A WSDL file
For the partition-by solution to work, you have to ensure that the result
set from the query is sorted by the foreign key:
(partition-by identity aaabbbcccaaabbbcc)
;;= ((\a \a \a) (\b \b \b) (\c \c \c) (\a \a \a) (\b \b \b) (\c \c))
(partition-by identity (sort aaabbbcccaaabbbcc))
;;= ((\a \a
Vectors and maps are already functions of their indices and keys,
respectively. I don't really think it makes sense for other sequence types
(seqs, lists, etc.) because they aren't naturally associative in the same
way. Finally, there isn't a Clojure form I'm aware of that allows negative
https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/APersistentMap.java#L24
The implementation assumes you're attempting to conj one of the following 3
things into the hash map:
1. A MapEntry object
2. A vector of the format [key value]
3. A seq of MapEntry objects