This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-09-14
Channels
- # aws-lambda (5)
- # beginners (38)
- # boot (197)
- # carry (7)
- # clara (3)
- # cljs-dev (7)
- # cljsjs (6)
- # cljsrn (24)
- # clojure (39)
- # clojure-art (10)
- # clojure-austin (7)
- # clojure-dusseldorf (1)
- # clojure-italy (8)
- # clojure-russia (89)
- # clojure-spec (119)
- # clojure-taiwan (1)
- # clojure-uk (19)
- # clojurescript (104)
- # community-development (2)
- # conf-proposals (22)
- # copenhagen-clojurians (8)
- # cursive (2)
- # datomic (35)
- # devcards (4)
- # dirac (79)
- # euroclojure (2)
- # immutant (35)
- # om (138)
- # om-next (2)
- # onyx (172)
- # proton (4)
- # protorepl (1)
- # re-frame (36)
- # reagent (34)
- # spacemacs (1)
- # specter (7)
- # untangled (89)
- # yada (2)
Is there any way to transform
keys of hashmaps to booleans without filtering out false
s?
@levitanong Not sure exactly what behavior you want. Could you give an example?
@codonnell given the following dataset:
(def data {1 {“false” 11 “true” 12} 2 {“false” 21 “true” 22}})
I want to turn the strings to proper booleans.
(transform [ALL LAST ALL FIRST]
boolean
data)
However, instead of
(def data {1 {false 11 true 12} 2 {false 21 true 22}})
I get
(def data {1 {true 12} 2 {true 22}})
So I’m assuming transform
automatically removes falsy values or keys.@levitanong (boolean "false")
returns true
I think you want to make a parse-boolean-string
function
My bad! Thanks @nathanmarz