It expands first to (.charAt "string")
, which indeed is last. Then that form further expands to (. "string" charAt)
.
Thread-first, thread-last and “dot” form
-
30-07-2021 - |
Pergunta
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?
Solução
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow