标签: clojure
有没有办法用速记符号返回这样的地图(或矢量)?
(#({:ok %}) "lol") => {:ok "lol"} ;; this doesn't work
功能相当的手写示例:
((fn [x] {:ok x}) "lol") => {:ok "lol"}
答案 0 :(得分:2)
有几种选择
(#(hash-map :ok %) :yoo)
(#(do {:ok %}) :yoo)