# A most harrowing collection of Julia WATs

**URL:** <https://discourse.julialang.org/t/a-most-harrowing-collection-of-julia-wats/77323>\
**Category:** General Usage\
**Tags:** wat\
**Created:** [March 2, 2022, 6:15pm UTC](https://discourse.julialang.org/t/a-most-harrowing-collection-of-julia-wats/77323 "2022-03-02T18:15:32Z")\
**Posts on this page:** 1\
**Showing post:** 80

<div class="post-metadata">

**Author:** ![Benny](https://avatars.discourse-cdn.com/v4/letter/b/49beb7/32.png) [@Benny](https://discourse.julialang.org/u/Benny)\
**Post date:** [June 20, 2022, 6:47pm UTC](https://discourse.julialang.org/t/a-most-harrowing-collection-of-julia-wats/77323/80 "2022-06-20T18:47:47Z")

</div>

Okay here’s a good one from [this thread](https://discourse.julialang.org/t/inference-bug-when-using-nested-generators/82991/7) a bit related to a WAT documented in the OP blog and noticed by the same @jakobnissen! I’ll condense it here:

```julia
julia> @which sum(i for i in 1:3; init=0)
(::Base.var"#sum##kw")(::Any, ::typeof(sum), a) in Base at reduce.jl:532

julia> @which sum(i for i in 1:3, init=0)
sum(a; kw...) in Base at reduce.jl:532

julia> @which sum((i for i in 1:3), init=0)
(::Base.var"#sum##kw")(::Any, ::typeof(sum), a) in Base at reduce.jl:532

```

In the middle case, the iterator is not `(i for i in 1:3)`, it’s `(i for i in 1:3, init in 0)` because `in` is lowered to `=` (we use that symbol for so many things), and the typo is silent because it’s valid to iterate over many scalars. Always remember to parenthesize your `Generator` comprehensions if they’re not the only argument in a call!

---

_[View the full topic](https://discourse.julialang.org/t/a-most-harrowing-collection-of-julia-wats/77323)._
