Skip to content
Browse files

adds docs to proplist-to-map

  • Loading branch information...
1 parent 3f7c47e commit bd14f05b02b80787569026587a083fc15b5a3133 @videlalvaro committed Aug 19, 2010
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/closerl/core.clj
View
7 src/closerl/core.clj
@@ -87,6 +87,13 @@
nil
(otp-value [o] ""))
+
+(defn proplist-to-map [pl]
+ "Takes a property list like structure and converts it to a map.
+ For example:
+ [{a, 1}, {b, 2}, {c, 3}] or {{a, 1}, {b, 2}, {c, 3} in Erlang will become:
+ {:a 1, :b 2, :c 3}"
+ (reduce (fn [my-map my-value] (assoc my-map (keyword (first my-value)) (second my-value))) {} pl))
(defn otp-node
"Creates an OtpNode"

0 comments on commit bd14f05

Please sign in to comment.
Something went wrong with that request. Please try again.