Kevin Downey a écrit :
> (into {} (apply map vector
>                 '((cars bmw chevrolet ford peugeot)
>                   (genres adventure horror mystery))))
>
> {ford mystery, chevrolet horror, bmw adventure, cars genres}
>   

or:
user=> (apply zipmap '((cars bmw chevrolet ford peugeot) (genres 
adventure horror mystery)))

{ford mystery, chevrolet horror, bmw adventure, cars genres}

But I'm unsure it's what Michel was after. I thought an alist was a list 
of pointed pairs (or a list of 2-elts lists) but I may be wrong since I 
come from Javaland.

user=> (into {} (map vec '((a 1) (b 2) (c 3))))
{c 3, b 2, a 1}


Christophe
>
> On Mon, May 4, 2009 at 4:03 PM, Michel S. <michel.syl...@gmail.com> wrote:
>   
>>
>> Yes, me too. The design is a bit unfortunate, as I cannot convert a
>> Scheme-style association list to a map easily:
>>
>> user=> (into {} '((cars bmw chevrolet ford peugeot)
>>             (genres adventure horror mystery)))
>>
>> java.lang.ClassCastException: clojure.lang.Symbol cannot be cast to
>> java.util.Map$Entry (NO_SOURCE_FILE:0)
>>
>> --
>> Michel
>>     


-- 
Professional: http://cgrand.net/ (fr)
On Clojure: http://clj-me.blogspot.com/ (en)



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to