Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

adds docs to proplist-to-map

  • Loading branch information...
commit bd14f05b02b80787569026587a083fc15b5a3133 1 parent 3f7c47e
Alvaro Videla authored

Showing 1 changed file with 7 additions and 0 deletions. Show diff stats Hide diff stats

  1. +7 0 src/closerl/core.clj
7 src/closerl/core.clj
@@ -87,6 +87,13 @@
87 87
88 88 nil
89 89 (otp-value [o] ""))
  90 +
  91 +(defn proplist-to-map [pl]
  92 + "Takes a property list like structure and converts it to a map.
  93 + For example:
  94 + [{a, 1}, {b, 2}, {c, 3}] or {{a, 1}, {b, 2}, {c, 3} in Erlang will become:
  95 + {:a 1, :b 2, :c 3}"
  96 + (reduce (fn [my-map my-value] (assoc my-map (keyword (first my-value)) (second my-value))) {} pl))
90 97
91 98 (defn otp-node
92 99 "Creates an OtpNode"

0 comments on commit bd14f05

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