injest icon indicating copy to clipboard operation
injest copied to clipboard

somex>>

Open josuesantos1 opened this issue 3 years ago • 1 comments

How will this feature work?

josuesantos1 avatar Oct 04 '21 15:10 josuesantos1

For the injest.classical namespace, it'll be pretty simple. Just replace ->> with some->>:

(defmacro somex>>
  "Just like some->> but first composes consecutive transducing fns into a function
  that sequences the thread values through the transducers."
  [x & thread]
  `(some->> ~x ~@(->> thread (i/pre-transducify-thread &env 2 `i/xfn i/transducable?))))

For the injest.path namespace, we'll need to add another version of path->> called path-some->> to the injest.impl namespace. It should source inspiration from the some->> macro definition and convert it to the path semantics in the same way that path->> handles the ->> scenario.

PRs welcome!

johnmn3 avatar Oct 05 '21 17:10 johnmn3