Closed jiacai2050 closed 6 years ago
(let [m {:x {:y #{"apple"}}}] (setval [:x (compact :y) (set-elem "apple")] NONE m)) ;; => {:x {:y #{}}}
I want to know what's the idiomatic way if I want this demo return {}
{}
compact needs to surround all the steps you want compacted if empty. In this case, you just need to do:
compact
(setval [:x (compact :y (set-elem "apple"))] NONE m)
I want to know what's the idiomatic way if I want this demo return
{}