# \[ANN\] threading 2.0

**URL:** <https://racket.discourse.group/t/ann-threading-2-0/3219>\
**Category:** General\
**Created:** [October 11, 2024, 11:01pm UTC](https://racket.discourse.group/t/ann-threading-2-0/3219 "2024-10-11T23:01:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lexi.lambda](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/lexi.lambda/32/1969_2.png) [@lexi.lambda](https://racket.discourse.group/u/lexi.lambda)\
**Post date:** [October 11, 2024, 11:01pm UTC](https://racket.discourse.group/t/ann-threading-2-0/3219/1 "2024-10-11T23:01:26Z")

</div>

Some of you may be familiar with my [threading](https://github.com/lexi-lambda/threading) package, which is a port of [Clojure’s threading macros](https://clojure.org/guides/threading_macros) to Racket. The package is quite simple and has been essentially unchanged since I initially released it in 2015.

In the nine years I’ve been using it, there have been a handful of small tweaks I’ve wanted to make and helper forms I’ve found myself regularly writing. This week, I finally bothered to incorporate those changes into the package itself. The new version should be entirely backwards compatible, but it comes with several improvements and minor changes:

- `~>` has been made slightly more flexible: it allows the threaded form to be threaded into function position in a function application. That is, `(~> f (_ x))` is now legal.

- `when~>`, `unless~>`, and `cond~>` have been added, which allow portions of a pipeline to be conditionally executed. (I’ve found these to be particularly helpful when staging slides in `#lang slideshow`.)

- `tee~>` has been added, which allows splitting a pipeline similarly to the way the Unix `tee` utility does.

- The package documentation has been expanded and largely rewritten.

- Many forms have been deprecated, mainly `~>>` and its variants. They are still provided for backwards compatibility (and probably always will be), but I just haven’t found them useful enough to warrant continuing to provide `~>>` variants of every operator when `~>` can be used with `_` to the same effect.

[The latest documentation is available here](https://lexi-lambda.github.io/threading/), and it should also be available on the package server once docs are rebuilt. Feedback is welcome. If you find any breakage I’ve overlooked, please open a bug report.
