# \`public\` cannot be used when quoting

**URL:** https://discourse.julialang.org/t/public-cannot-be-used-when-quoting/112657
**Category:** General Usage
**Created:** [April 8, 2024, 12:57am UTC](https://discourse.julialang.org/t/public-cannot-be-used-when-quoting/112657 "2024-04-08T00:57:02Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![matthias314](https://avatars.discourse-cdn.com/v4/letter/m/a88e4f/32.png) [@matthias314](https://discourse.julialang.org/u/matthias314)
#### Post date: [April 8, 2024, 12:57am UTC](https://discourse.julialang.org/t/public-cannot-be-used-when-quoting/112657/1 "2024-04-08T00:57:02Z")

</div>

To create an expression involving the new “keyword” `public` of Julia 1.11, one can say something like

```julia
julia> Expr(:public, :x)
:(public x)

```

The following does not work, however:

```julia
julia> :(public x)
ERROR: ParseError:
# Error @ REPL[2]:1:10
:(public x)
# ╙ ── Expected `)`

```

Maybe this is because `public` is actually _not_ a [reserved keyword](https://docs.julialang.org/en/v1.12-dev/base/base/#Keywords). Anyway, is this behaviour intended? Maybe there would be a way to allow the second form even if `public` is not a reserved keyword. After all, it works outside of quoted expressions.

---

<div class="post-metadata">

### Author: ![nsajko](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nsajko/32/221187_2.png) [@nsajko](https://discourse.julialang.org/u/nsajko)
#### Post date: [April 8, 2024, 1:23am UTC](https://discourse.julialang.org/t/public-cannot-be-used-when-quoting/112657/2 "2024-04-08T01:23:41Z")

</div>

> <https://github.com/JuliaLang/julia/issues/51450>
>
> It'd be great if this could work:
> 
> \`\`\`julia
> julia\> :(public foo)
> ERROR: Pars…eError:
> \# Error @ REPL\[13\]:1:10
> :(public foo)
> \# └─┘ ── Expected \`)\`
> Stacktrace:
> \[1\] top-level scope
> @ none:1
> \`\`\`
> 
> Found because I was exploring \`public\` behaviors interactively and was trying to do something like the below — the equivalent using \`export\` works:
> 
> \`\`\`julia
> julia\> @eval Base begin
> foo = 1
> public foo
> ERROR: ParseError:
> \# Error @ REPL\[16\]:3:8
> foo = 1
> public foo
> \# └─┘ ── Expected \`end\`
> Stacktrace:
> \[1\] top-level scope
> @ none:1
> \`\`\`
