Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (fn [ds]
- (let [is-map? (fn [ds] (:my-secret-key (conj ds [:my-secret-key true])))
- is-list? (fn [l] (= [:b :a] (take 2 (-> l (conj :a) (conj :b)))))
- is-vector? (fn [v] (= [:a :b] (take-last 2 (-> v (conj :a) (conj :b)))))
- is-set? (fn [s]
- (= 1 (-> (group-by identity (-> s (conj :test) (conj :test)))
- (get :test)
- (count))))]
- (cond (is-map? ds)
- :map
- (is-set? ds)
- :set
- (is-list? ds)
- :list
- (is-vector? ds)
- :vector
- :default
- :unknown)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement