This commit is contained in:
Nathan Marz 2015-04-15 13:44:35 -04:00
parent d212140c8b
commit f66d09f9dd
2 changed files with 4 additions and 4 deletions

View file

@ -95,12 +95,12 @@ The update function receives as arguments all the collected values followed by t
The three built-in ways for collecting values are `VAL`, `val-selector`, and `val-selector-one`. `VAL` just adds whatever element it's currently on to the value list, while `val-selector` and `val-selector-one` take in a selector to navigate to the desired value. `val-selector` works just like `select` by finding a sequence of values, while `val-selector-one` expects to only navigate to a single value. The three built-in ways for collecting values are `VAL`, `val-selector`, and `val-selector-one`. `VAL` just adds whatever element it's currently on to the value list, while `val-selector` and `val-selector-one` take in a selector to navigate to the desired value. `val-selector` works just like `select` by finding a sequence of values, while `val-selector-one` expects to only navigate to a single value.
Each step of a selector implements the `StructurePath` protocol, which looks like: To make your own selector, implement the `StructurePath` protocol which looks like:
```clojure ```clojure
(defprotocol StructurePath (defprotocol StructurePath
(select* [this vals structure next-fn]) (select* [this structure next-fn])
(update* [this vals structure next-fn]) (update* [this structure next-fn])
) )
``` ```

View file

@ -1,4 +1,4 @@
(defproject com.rpl/specter "0.0.8" (defproject com.rpl/specter "0.0.9"
:dependencies [[org.clojure/clojure "1.6.0"] :dependencies [[org.clojure/clojure "1.6.0"]
] ]
:jvm-opts ["-XX:-OmitStackTraceInFastThrow"] ; this prevents JVM from doing optimizations which can remove stack traces from NPE and other exceptions :jvm-opts ["-XX:-OmitStackTraceInFastThrow"] ; this prevents JVM from doing optimizations which can remove stack traces from NPE and other exceptions