From e92fd674b18c199e3dde65328f482f9ba84cddc1 Mon Sep 17 00:00:00 2001 From: nathanmarz Date: Sun, 24 Dec 2017 18:39:01 -0500 Subject: [PATCH] add examples --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 1904f35..bd46ef5 100644 --- a/README.md +++ b/README.md @@ -146,6 +146,20 @@ user> (setval [:a ALL nil?] NONE {:a [1 2 nil 3 nil]}) {:a [1 2 3]} ``` +Remove key/value pair from nested map: + +```clojure +user> (setval [:a :b :c] NONE {:a {:b {:c 1}}}) +{:a {:b {}}} +``` + +Remove key/value pair from nested map, removing maps that become empty along the way: + +```clojure +user> (setval [:a (compact :b :c)] NONE {:a {:b {:c 1}}}) +{} +``` + Increment all the odd numbers between indices 1 (inclusive) and 4 (exclusive): ```clojure