문제

Why do both of these expressions give the same result?

> (macroexpand-all '(->> "string" (.charAt)))

(. "string" charAt)

> (macroexpand-all '(-> "string" (.charAt)))

(. "string" charAt)

Isn't "->>" macro supposed to insert "string" as the last element in the list?

도움이 되었습니까?

해결책

It expands first to (.charAt "string"), which indeed is last. Then that form further expands to (. "string" charAt).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top