我有一个字符串,它代表了一个clojure地图.有没有一种从字符串重建地图的简单方法?
字符串的一个例子 -
{:Location {:CountryData {:country_cf 99, :country_code "us", :country "united states"}, :longitude -80.17833, :msa 33100, :dma 528}
Run Code Online (Sandbox Code Playgroud)
使用read-string功能:
(read-string "{:Location {:CountryData {:country_cf 99, :country_code \"us\", :country \"united states\"}, :longitude -80.17833, :msa 33100, :dma 528}}")
Run Code Online (Sandbox Code Playgroud)