thank..
I change my source...
2013년 12월 9일 월요일 오후 6시 20분 34초 UTC+9, Walter van der Laan 님의 말:
>
> Hi,
>
> You could try to do it like this...
>
> Use a hashmap instead of a vector in the atom:
> (def room-list (atom {}))
>
> Insert rooms using a hashmap for the user-id's:
> (swap! room-list asso
Hi,
You could try to do it like this...
Use a hashmap instead of a vector in the atom:
(def room-list (atom {}))
Insert rooms using a hashmap for the user-id's:
(swap! room-list assoc "67890" {:user-list {"id-3" {:name "name-3"}}})
You can now find a user in a room like this:
(get-in @room-list
There are ways to achieve what you ask, but normally you wouldn't use
nested vectors for data structures you want to operate on associatively.
It will be inefficient, and the code will be ugly. Better to use more maps
and key them by:key and :id.
On Mon, Dec 9, 2013 at 12:46 AM, 박재혁 wrote:
> s