specter

Latest version: 1.1.3
phreed 2018-01-12T00:30:18.000328Z

@nathanmarz Yes I have been using the collect twins with select which constructs a seq. I will take a look at the example.

schmee 2018-01-12T08:21:36.000170Z

is there a way to make transform halt after the first successful navigation, something like transform-one?

schmee 2018-01-12T08:21:46.000006Z

I’m thinking about this case:

user=> (def a [{:name "foo" :id 1} {:name "bar" :id 2}])
#'user/a
user=> (transform [ALL (selected? :id (pred= 2))] #(assoc % :name "not-foo") a)
[{:id 1 :name "foo"} {:id 2 :name "not-foo"}]

schmee 2018-01-12T08:22:28.000004Z

since ids are unique, there will only be one element selected so there is no need to check the rest of the elements once it has been found

schmee 2018-01-12T08:25:45.000199Z

I don’t know if that makes any sense 😄

nathanmarz 2018-01-12T14:12:51.000233Z

@schmee no, nothing like that currently

nathanmarz 2018-01-12T14:13:42.000002Z

this idea might be applicable to that kind of behavior: https://github.com/nathanmarz/specter/issues/121

schmee 2018-01-12T14:33:22.000045Z

yeah that seems to be it, I’ll keep an eye on that issue :thumbsup: