Clojure オブジェクト配列があります。次のようなもの:
(def data {
:genre "fantasy"
:books [
{ :id 1 :name "Lord of the rings" }
{ :id 2 :name "Game of thrones" }
{ :id 3 :name "Harry potter" }]
})
本のすべてのIDを取得したい..次のようなもの[1 2 3]
私はいくつかのことを試しました:
(seq (data :books :id))
(data :books) :id)
;results in an error, as expected
しかし、IDの取得方法がわかりません。ID を取得するために dosq やその他のイテレータ関数を使用する必要がありますか?
ありがとう