# \[ANN\] ShowLint

**URL:** <https://discourse.julialang.org/t/ann-showlint/52140>\
**Category:** Package Announcements\
**Created:** [December 20, 2020, 7:14pm UTC](https://discourse.julialang.org/t/ann-showlint/52140 "2020-12-20T19:14:58Z")\
**Posts on this page:** 3\
**Page:** 2

<div class="post-metadata">

**Author:** ![mcabbott](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mcabbott/32/6603_2.png) [@mcabbott](https://discourse.julialang.org/u/mcabbott)\
**Post date:** [December 21, 2020, 6:43pm UTC](https://discourse.julialang.org/t/ann-showlint/52140/21 "2020-12-21T18:43:04Z")

</div>

My thinking was that this would save allocating an array here. Although for `findall` in particular, it might not actually be faster?

```julia
julia> @btime findfirst(x->!x, r) setup=(r=rand(Bool, 10^6)); # same as findfirst(!, r)
  2.283 ns (0 allocations: 0 bytes)

julia> @btime findfirst(.!r) setup=(r=rand(Bool, 10^6));
  137.891 μs (4 allocations: 126.42 KiB)

julia> @btime count(x->!x, r) setup=(r=rand(Bool, 10^6));
  80.810 μs (0 allocations: 0 bytes)

julia> @btime count(.!r) setup=(r=rand(Bool, 10^6));
  142.010 μs (4 allocations: 126.42 KiB)

julia> @btime findall(x->!x, r) setup=(r=rand(Bool, 10^6));
  671.744 μs (8 allocations: 3.92 MiB)

julia> @btime findall(.!r) setup=(r=rand(Bool, 10^6));
  668.053 μs (6 allocations: 3.93 MiB)

```

Edit – that’s because the second-last line explicitly calls the last here, `findall(testf::Function, A::AbstractArray) = findall(testf.(A))`, so there can’t be a difference. Sorry about the noise!

---

<div class="post-metadata">

**Author:** ![miguelraz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/miguelraz/32/631_2.png) [@miguelraz](https://discourse.julialang.org/u/miguelraz)\
**Post date:** [December 21, 2020, 11:17pm UTC](https://discourse.julialang.org/t/ann-showlint/52140/22 "2020-12-21T23:17:51Z")

</div>

This is a good idea and I hope it can gain some more traction / incorporation into IDEs. Traceur.jl has a similar design space and is perhaps worth looking into.

---

<div class="post-metadata">

**Author:** ![banksiaboy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/banksiaboy/32/27032_2.png) [@banksiaboy](https://discourse.julialang.org/u/banksiaboy)\
**Post date:** [July 31, 2021, 4:05am UTC](https://discourse.julialang.org/t/ann-showlint/52140/23 "2021-07-31T04:05:01Z")

</div>

I think the author of comby did this against a large GitHub code-base and automatically submitted PRs

[![](https://global.discourse-cdn.com/julialang/original/3X/f/9/f953d8839b731c19e6ed1ec5dade7a878339ebc2.jpeg ""Parser Parser Combinators for Program Transformation" by Rijnard van Tonder") ](https://www.youtube.com/watch?v=JMZLBB_BFNg)

Also see:

> **[Projects and Talks · Comby](https://comby.dev/projects)**
>
> Structural code search and replace for ~every language.

[Previous page](https://discourse.julialang.org/t/ann-showlint/52140.md?page=1)
