Clojurians
#clojure-italy
<
2018-07-11
>

This page is not created by, affiliated with, or supported by Slack Technologies, Inc.

mpenet08:07:17

guten morgen

reborg16:07:54

Interessante uso di metadata:

(defn merge-multi [& maps]
  (apply merge-with
    #(if (:multi (meta %1))
       (conj %1 %2)
       ^:multi [%1 %2]) maps))

(merge-multi
  {:a [1 3] :b 2}
  {:a 'a :b 'b}
  {:a "a" :b "b" :c []})

;; {:a [[1 3] a "a"], :b [2 b "b"], :c []}