On Jan 22, 1:19 am, Mark Triggs mark.h.tri...@gmail.com wrote:
Daniel Werner daniel.d.wer...@googlemail.com writes:
After a few tries I've come up with the following algorithm to
transform :keys syntax into normal destructuring syntax, but am still
appalled by its complexity:
(let [vmap
Hi,
user= (let [vmap '{y :y z :z :keys [a b] :syms [e f] :strs [g h]}]
(- (dissoc vmap :keys :strs :syms)
(into (map #(vector % (keyword %)) (:keys vmap)))
(into (map #(vector % (name %))(:strs vmap)))
(into (map #(vector % %) (:syms vmap)
{y :y, z :z, a :a, b :b,
Hi everyone,
let's play a round of golf. I am currently implementing associative
destructuring for ClojureJS while trying not to peek into clojure.core
too often -- which wouldn't make things much easier since the
'destructure fn is a huge beast.
After a few tries I've come up with the following
Daniel Werner daniel.d.wer...@googlemail.com writes:
After a few tries I've come up with the following algorithm to
transform :keys syntax into normal destructuring syntax, but am still
appalled by its complexity:
(let [vmap {'y :y, 'z :z :keys ['a 'b]}]
(- vmap
((juxt :keys :strs