specter

Latest version: 1.1.3
ro6 2018-12-17T14:35:57.016100Z

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?

nathanmarz 2018-12-17T14:38:13.016400Z

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

nathanmarz 2018-12-17T14:38:58.016800Z

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

nathanmarz 2018-12-17T14:39:29.017200Z

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

nathanmarz 2018-12-17T14:40:23.018200Z

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

👍 2