Running this at the repl:
user> (def xbox {:bushido ["only on PS" {:country :notavailable}]
:parappa "only on PS" :oni "only on PS"})
;; => #'user/xbox
user> (def playstation {:bushido ["available" {:country :japan}]
:parappa "classic" :oni "need to play"})
;; => #'user/playstation
user> (for [{[_ x] :bushido} [xbox playstation]]
x)
;; => ({:country :notavailable} {:country :japan})
user>
We can see what this actually does. And yes, as mentioned in the other answer, this is a no-op because for
generates a lazy sequence, so no work is actually done before it's needed. The reason the work gets done here is because the REPL wants to print the result, and thus the lazy sequence is realized.
As for what the for loop actually does. We make a vector of the two maps xbox
and playstation
. for
will loop over that vector and assign each value to the var in the binding vector here ({[_ x] :bushido}
) which in this case is a also a destructuring.
This destructuring takes a map and extracts the value under the key :bushido
which it then expected to be a vector of two elements, where it assigned the first element to a symbol _
and the second element to the symbol x
.
The for loop then returns x
for each of the elements.
This could also have been written as:
user> (map (comp second :bushido) [xbox playstation])
;; => ({:country :notavailable} {:country :japan})
user>
Note that the games in you xbox
and playstation
doesn't have the same shape, because :parappa
does not contain a vector as its value.