Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In clojure, you can do this with as->, but there are reasons to be careful. Stuart Sierra has a great (brief) article about it[0]. The long and short of it is that it's really easy to change the "type" of an expression as it goes through your pipeline in unintuitive ways. This can cause surprises later down the line, so it's probably better to refactor the functions you are calling so that they play nicely with thread-first or with thread-last.

[0]https://stuartsierra.com/2018/07/15/clojure-donts-thread-as



Did you mean Stuart Sierra? :-)


Whoops! Clojure is the only community I know with a confusion of Stuarts.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: