X> & x>>: auto-transducifying thread macros (now with parallelizing |>> and =>>)

looks like at least one fundamental reason strings and numbers are not accessors in eval and likely never will be is performance related. Since the related classes are final (at the jvm level), there is no capacity it extend IFn to them and get efficient invocation as it currently exists. So lifting that to the language level (via eval) would imply adding relevant checks to every function call, whether the language semantics are desired (a separate question).

In the case of your lib, it probably makes sense to provide your own ->>, → implementations (uncertain if other threading macros would be affected) that extend the accessor semantics you desire. Callers could opt-in at the library level and have a consistent experience, e.g. using injest/->> and the like, which would be interchangeable with injest/x>> but not necessarily clojure.core/->>. Maybe concurrently submit a patch with proposed changes to the core threading macros to jira and see if it gets traction with the core devs; or post the enhancement on ask.clojure.org as an enchancement (I think that’s the non-jira means of communicating with core dev folks).

1 Like