Re: Generating functions from data

2013-11-18 Thread Michael-Keith Bernard (SegFaultAX)
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

Re: Lazy group-by for sorted maps?

2013-08-12 Thread Michael-Keith Bernard (SegFaultAX)
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

Re: Adding implicit indexing to Clojure lists and arrays?

2013-06-26 Thread Michael-Keith Bernard (SegFaultAX)
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

Re: putting 2-element colls into a map: works with vectors, but not with lists?

2013-06-25 Thread Michael-Keith Bernard (SegFaultAX)
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