# Fixing the Piping/Chaining/Partial Application Issue (Rev 2)

**URL:** <https://discourse.julialang.org/t/fixing-the-piping-chaining-partial-application-issue-rev-2/90408>\
**Category:** Internals & Design\
**Tags:** proposal, piping, chaining, partial-evaluation, threading\
**Created:** [November 17, 2022, 3:36pm UTC](https://discourse.julialang.org/t/fixing-the-piping-chaining-partial-application-issue-rev-2/90408 "2022-11-17T15:36:57Z")\
**Posts on this page:** 1\
**Showing post:** 30

<div class="post-metadata">

**Author:** ![uniment](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/uniment/32/24532_2.png) [@uniment](https://discourse.julialang.org/u/uniment)\
**Post date:** [November 19, 2022, 6:48pm UTC](https://discourse.julialang.org/t/fixing-the-piping-chaining-partial-application-issue-rev-2/90408/30 "2022-11-19T18:48:09Z")

</div>

Indeed, measuring compile time is a difficult thing to do. I detailed my misadventures with it [in this post](https://discourse.julialang.org/t/fixing-the-piping-chaining-issue/89654/213).

The runtime of this function is basically instantaneous, which you can confirm using `@btime` (a proper measurement will show single-digit nanoseconds)—so even though compile time and runtime are inseparable, the runtime is negligible in this measurement.

I force `Base.Fix1` to recompile by redefining the anonymous function every time. You can see that it’s a new function each time:

```julia
julia> f = (x,y) -> x+y; (f, typeof(f))
(var"#1#2"(), var"#1#2")

julia> f = (x,y) -> x+y; (f, typeof(f))
(var"#3#4"(), var"#3#4")

julia> f = (x,y) -> x+y; (f, typeof(f))
(var"#5#6"(), var"#5#6")

```

This makes anonymous functions an excellent stimulus for measuring these compile times, because a new anonymous function will have a different _type_ despite behaving exactly the same as before.

> [@jules](#):
>
> That was another reason why I wrote Chain, because you can avoid compilation of Fix instances or anonymous functions or whatever you need to make |\> work…

Chain.jl has been a huge inspiration for how this proposal should work. 👌 I pretty much copypasted it in imagining the behavior of `--` call chain syntax, except that I decided to localize variable scope within the chain using `let` statements instead of making unique variables at the parent scope with `gensym`. This enables me to use `it` as a local keyword, but it makes it difficult to create side-effects except by calling functions which have side-effects.

---

_[View the full topic](https://discourse.julialang.org/t/fixing-the-piping-chaining-partial-application-issue-rev-2/90408)._
