# Is Compat.jl worth it for the \`public\` keyword?

**URL:** https://discourse.julialang.org/t/is-compat-jl-worth-it-for-the-public-keyword/119041
**Category:** General Usage
**Tags:** macros, compatibility
**Created:** [September 4, 2024, 2:51pm UTC](https://discourse.julialang.org/t/is-compat-jl-worth-it-for-the-public-keyword/119041 "2024-09-04T14:51:50Z")
**Posts on this page:** 1
**Showing post:** 22

<div class="post-metadata">

### Author: ![Mason](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mason/32/2423_2.png) [@Mason](https://discourse.julialang.org/u/Mason)
#### Post date: [September 5, 2024, 8:28am UTC](https://discourse.julialang.org/t/is-compat-jl-worth-it-for-the-public-keyword/119041/22 "2024-09-05T08:28:39Z")

</div>

Why not just do

```julia
macro public(ex)
    if VERSION >= v"1.11.0-DEV.469"
        args = ex isa Symbol ? (ex,) : Base.isexpr(ex, :tuple) ? ex.args : error("something informative")
        esc(Expr(:public, args...))
    else
        nothing
    end
end

@public x, y

```

?

I strongly doubt this is worth bringing in Compat.jl for, that package is quite hefty with lots of piracy and invalidations.

---

_[View the full topic](https://discourse.julialang.org/t/is-compat-jl-worth-it-for-the-public-keyword/119041)._
