# How to handle deprecations of new broadcast functions?

**URL:** <https://discourse.julialang.org/t/how-to-handle-deprecations-of-new-broadcast-functions/1287>\
**Category:** General Usage\
**Tags:** question, broadcast\
**Created:** [January 4, 2017, 5:22pm UTC](https://discourse.julialang.org/t/how-to-handle-deprecations-of-new-broadcast-functions/1287 "2017-01-04T17:22:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cormullion](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cormullion/32/49131_2.png) [@cormullion](https://discourse.julialang.org/u/cormullion)\
**Post date:** [January 4, 2017, 5:22pm UTC](https://discourse.julialang.org/t/how-to-handle-deprecations-of-new-broadcast-functions/1287/1 "2017-01-04T17:22:05Z")

</div>

I’m starting to see lots of warnings like this:

```julia
WARNING: deprecated syntax "function .*(...)".
Use "function Base.broadcast(::typeof(*), ...)" instead.

WARNING: deprecated syntax "function .*(...)".
Use "function Base.broadcast(::typeof(*), ...)" instead.

WARNING: deprecated syntax "function .*(...)".
Use "function Base.broadcast(::typeof(*), ...)" instead.

WARNING: deprecated syntax "function .*(...)".
Use "function Base.broadcast(::typeof(*), ...)" instead.

WARNING: deprecated syntax "function ./(...)".
Use "function Base.broadcast(::typeof(/), ...)" instead.

WARNING: deprecated syntax "function ./(...)".
Use "function Base.broadcast(::typeof(/), ...)" instead.

```

How do I edit the code so that it will work in versions 0.4, 0.5, and 0.6?

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [January 4, 2017, 5:33pm UTC](https://discourse.julialang.org/t/how-to-handle-deprecations-of-new-broadcast-functions/1287/2 "2017-01-04T17:33:40Z")

</div>

We probably need to add support to the `@compat` macro in Compat.jl.

For the most part, you shouldn’t need to define operators like `.*` at all in 0.6: just defining `*` for your type will automatically give you `x .* y` as a synonym for `broadcast(*, x, y)`.

But because this is a syntax deprecation, you will get a warning even if your definitions are protected by `if VERSION < v"0.6"`. So, we should define the `@compat` macro to make `@compat function Base.broadcast(::typeof(*), ...)` turn into a `.*(...)` definition in 0.5 and 0.4.

---

<div class="post-metadata">

**Author:** ![dlfivefifty](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlfivefifty/32/1959_2.png) [@dlfivefifty](https://discourse.julialang.org/u/dlfivefifty)\
**Post date:** [January 19, 2017, 6:01am UTC](https://discourse.julialang.org/t/how-to-handle-deprecations-of-new-broadcast-functions/1287/3 "2017-01-19T06:01:45Z")

</div>

It doesn’t look like this has been done yet, so I’ve added an issue:

[https://github.com/JuliaLang/Compat.jl/issues/308](https://github.com/JuliaLang/Compat.jl/issues/308)
