이런 기본적인 질문은 죄송하지만이 기능이 작동하는 이유를 알 수 없습니다. "Clojure for the brave and true" 가이드를 수행하고 있습니다. 이 컬렉션에 : 내가 이해할 수없는 것은 사용하는 것입니다 3.clojure : 왜 (일부 # (및 ... 처음 false 항목을 반환하지 않음)
(some #(and (> (:critter %) 3) %) food-journal)
위의 값을 가진 생물 :
(def food-journal
[{:month 1 :day 1 :human 5.3 :critter 2.3}
{:month 1 :day 2 :human 5.1 :critter 2.0}
{:month 2 :day 1 :human 4.9 :critter 2.1}
{:month 2 :day 2 :human 5.0 :critter 2.5}
{:month 3 :day 1 :human 4.2 :critter 3.3}
{:month 3 :day 2 :human 4.0 :critter 3.8}
{:month 4 :day 1 :human 3.7 :critter 3.9}
{:month 4 :day 2 :human 3.7 :critter 3.6}])
이 기능의 사용 키를 가지고하는 최초의지도를 얻을 수 있습니다 내 생각에 내부 표현식에서 반환 된 첫 false 값을 반환해야합니다. 즉, 그것은 그지도의 : critter가 3보다 크지 않기 때문에 첫 번째지도를 반환해야합니다.
여기서'와'는'when'과 같은 일을합니다. –