# Can't we create a macro named "?"

**URL:** <https://discourse.julialang.org/t/cant-we-create-a-macro-named/92027>\
**Category:** General Usage\
**Tags:** macros\
**Created:** [December 22, 2022, 11:31pm UTC](https://discourse.julialang.org/t/cant-we-create-a-macro-named/92027 "2022-12-22T23:31:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![joa-quim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joa-quim/32/227_2.png) [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Post date:** [December 22, 2022, 11:31pm UTC](https://discourse.julialang.org/t/cant-we-create-a-macro-named/92027/1 "2022-12-22T23:31:05Z")

</div>

```julia
julia> @? meca
┌ Error: Failed to revise C:\Users\joaqu\.julia\dev\GMT\src\common_options.jl
│ exception =
│ LoadError: "invalid identifier name \"?\""

```

But we have the broadcast macro `@.` (which I can’t find the definition) and if I try to create another `@.` I get the same error

```julia
LoadError: "invalid identifier name \".\""

```

So with some trickery it seems to be possible. How?

Thanks

---

<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 22, 2022, 11:34pm UTC](https://discourse.julialang.org/t/cant-we-create-a-macro-named/92027/2 "2022-12-22T23:34:46Z")

</div>

One way is:

```julia
julia> macro var"?"(ex)
         @show ex
         nothing
       end
@? (macro with 1 method)

julia> @? c1 ? 1 : c2 ? 2 : 3
ex = :(if c1
      1
  else
      if c2
          2
      else
          3
      end
  end)

```

---

<div class="post-metadata">

**Author:** ![joa-quim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joa-quim/32/227_2.png) [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Post date:** [December 22, 2022, 11:41pm UTC](https://discourse.julialang.org/t/cant-we-create-a-macro-named/92027/3 "2022-12-22T23:41:47Z")

</div>

> [@mcabbott](#):
>
> `var"?"`

Cool, thanks.
