Fork me on GitHub
#specter
<
2018-12-17
>
ro614:12:57

Today I found myself using assoc-in on the ex-data inside an exception while keeping the rest of the info the same, then re-forming and re-throwing. It definitely felt like a "Specter-shaped" problem. Is this the sort of thing Specter could do (or already does)? If so, what would be the approach to implementing a navigator for a closed data object like an IExceptionInfo?

nathanmarz14:12:13

@robert.mather.rmm you can make customer navigators with defnav

nathanmarz14:12:58

though for that i think the best approach would be something like the new datafy stuff

nathanmarz14:12:29

where you can turn the closed object into regular clojure data, navigate it normally, and then at the end convert it back

nathanmarz14:12:23

so something like this would be ideal: (transform [DATAFY :some-field ALL] inc some-obj), where DATAFY would do the conversion both ways

👍 8